Skip to content

Commit

Permalink
feat(runner-flutter): refacto simple text lookup sentence, #604
Browse files Browse the repository at this point in the history
  • Loading branch information
luifr10 committed May 3, 2024
1 parent a9a9d51 commit cd21a36
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
5 changes: 4 additions & 1 deletion packages/runner-flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ Feature: Panoramax mobile App
```

## Available sentences
### `I see {'text'} text`
### `I put the device in portrait mode`
Turns device into portrait orientation

### `I put the device in landscape mode`
Turns device into landscape orientation

### `I should see the text {'text'}`
Checks that the specified text is present

### `I should not see the text {'text'}`
Checks that the specified text is not present

### `I should see a button named {'My button'}`
Checks that a button exists with the specified [accessible name](https://pub.dev/packages/flutter_finder_usercentric)

Expand Down
3 changes: 2 additions & 1 deletion packages/runner-flutter/lib/generate_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ class GenerateTestsBuilder implements Builder {
'testerName': '\$',
'testerType': 'PatrolIntegrationTester',
'externalSteps': [
'package:uuv_flutter/src/step/i_see_text.dart',
'package:uuv_flutter/src/step/i_put_the_device_in_landscape_mode.dart',
'package:uuv_flutter/src/step/i_put_the_device_in_portrait_mode.dart',
'package:uuv_flutter/src/step/i_should_see_the_text.dart',
'package:uuv_flutter/src/step/i_should_not_see_the_text.dart',
'package:uuv_flutter/src/step/i_should_see_a_button_named.dart',
'package:uuv_flutter/src/step/i_should_not_see_a_button_named.dart',
'package:uuv_flutter/src/step/i_should_see_a_text_field_named.dart',
Expand Down
9 changes: 0 additions & 9 deletions packages/runner-flutter/lib/src/step/i_see_text.dart

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'package:flutter_test/flutter_test.dart';

/// Usage: I should not see the text {'Todo List'}
Future<void> iShouldNotSeeTheText(WidgetTester tester, String text) async {
expect(find.text(text), findsNothing);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'package:flutter_test/flutter_test.dart';

/// Usage: I should see the text {'Todo List'}
Future<void> iShouldSeeTheText(WidgetTester tester, String text) async {
expect(find.text(text), findsOneWidget);
}
2 changes: 1 addition & 1 deletion packages/runner-flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: uuv_flutter
description: "An accessibility driven solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and flutter"
version: 0.0.1-beta.3
version: 0.0.1-beta.4
homepage: https://orange-opensource.github.io/uuv/
repository: https://github.com/Orange-OpenSource/uuv.git

Expand Down
2 changes: 1 addition & 1 deletion packages/runner-flutter/test/general.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: General

Scenario: Find app title
Given the app is running
Then I should see a title named {'Todo List'}
Then I should see a title named {'Todo List'}

Scenario: Find existing button
Given the app is running
Expand Down

0 comments on commit cd21a36

Please sign in to comment.