Skip to content

Commit 7ee9f80

Browse files
committed
- Fix #231 - using local coordinate system when taking a screenshot on Android (thanks to @youssef-t for the solution)
- Fix #216 - ensure step exceptions and `expect` failure results are added as errors to the json report - Scenarios can now have descriptions which also appear in the json reporter output
1 parent b73da40 commit 7ee9f80

15 files changed

+2423
-68
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## [3.0.0-rc.16] - 01/07/2022
2+
- Fix #231 - using local coordinate system when taking a screenshot on Android (thanks to @youssef-t for the solution)
3+
- Fix #216 - ensure step exceptions and `expect` failure results are added as errors to the json report
4+
- Scenarios can now have descriptions which also appear in the json reporter output
5+
6+
NOTE: Due to the above changes generated files will need to be re-generated
7+
8+
```
9+
flutter pub run build_runner clean
10+
flutter pub run build_runner build --delete-conflicting-outputs
11+
```
12+
113
## [3.0.0-rc.15] - 28/06/2022
214
- Exposed `frameBindingPolicy` on the test runner when running tests which can affect how frames are painted and the speed of the test run, I've removed the default value which might be responsible for #231
315

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@debug
2+
Feature: Expect failure
3+
Ensure that when a test fails the exception or test failure is reported
4+
5+
Scenario: Exception should be added to json report
6+
Given I expect the todo list
7+
| Todo |
8+
| Buy blueberries |
9+
When I tap the "add" button
10+
And I fill the "todo" field with "Buy hannah's apples"
11+
12+
Scenario: Failed expect() should be added to json report
13+
Description for this scenario!
14+
When I tap the "add" button
15+
And I fill the "todo" field with "Buy hannah's apples"
16+
Then I expect a failure

example_with_integration_test/integration_test/gherkin/configuration.dart

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@ import 'package:flutter_gherkin/flutter_gherkin.dart';
55
import 'package:flutter_simple_dependency_injection/injector.dart';
66
import 'package:gherkin/gherkin.dart';
77

8-
import 'hooks/attach_screenshot_after_step_hook.dart';
98
import 'hooks/reset_app_hook.dart';
9+
import 'steps/expect_failure.dart';
1010
import 'steps/expect_todos_step.dart';
1111
import 'steps/multiline_string_with_formatted_json.dart';
1212
import 'steps/when_await_animation.dart';
1313
import 'steps/when_step_has_timeout.dart';
1414
import 'world/custom_world.dart';
1515

1616
FlutterTestConfiguration gherkinTestConfiguration = FlutterTestConfiguration(
17-
// tagExpression: '@debug', // can be used to limit the tests that are run
17+
// tagExpression: '@debug', // can be used to limit the tests that are run
1818
stepDefinitions: [
1919
thenIExpectTheTodos,
2020
whenAnAnimationIsAwaited,
2121
whenStepHasTimeout,
22-
givenTheData
22+
givenTheData,
23+
thenIExpectFailure,
2324
],
2425
hooks: [
2526
ResetAppHook(),
26-
AttachScreenshotAfterStepHook(),
27+
AttachScreenshotOnFailedStepHook(),
28+
// AttachScreenshotAfterStepHook(),
2729
],
2830
reporters: [
2931
StdoutReporter(MessageLevel.error)

example_with_integration_test/integration_test/gherkin/reports/2022-07-01T13-22-35-v1.json

+1
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "reports",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1"
7+
},
8+
"keywords": [],
9+
"author": "",
10+
"license": "ISC",
11+
"devDependencies": {
12+
"cucumber-html-reporter": "^5.5.0"
13+
},
14+
"dependencies": {
15+
"ansi-styles": "^3.2.1",
16+
"chalk": "^2.4.2",
17+
"color-convert": "^1.9.3",
18+
"color-name": "^1.1.3",
19+
"escape-string-regexp": "^1.0.5",
20+
"find": "^0.3.0",
21+
"fs-extra": "^8.1.0",
22+
"graceful-fs": "^4.2.10",
23+
"has-flag": "^3.0.0",
24+
"is-wsl": "^1.1.0",
25+
"js-base64": "^2.6.4",
26+
"jsonfile": "^5.0.0",
27+
"lodash": "^4.17.21",
28+
"node-emoji": "^1.11.0",
29+
"open": "^6.4.0",
30+
"supports-color": "^5.5.0",
31+
"traverse-chain": "^0.1.0",
32+
"universalify": "^0.1.2",
33+
"uuid": "^3.4.0"
34+
},
35+
"description": ""
36+
}

0 commit comments

Comments
 (0)