Skip to content

Commit ac9dc32

Browse files
committed
fix(allure): handle flutter golden assertions
1 parent 2b1dc75 commit ac9dc32

File tree

6 files changed

+23
-11
lines changed

6 files changed

+23
-11
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
/dev/integration_tests/**/xcuserdata
4343
/dev/integration_tests/**/Pods
4444
/packages/flutter/coverage/
45+
/test/**/failures/
4546
version
4647
analysis_benchmark.json
4748
pubspec_overrides.yaml
@@ -139,4 +140,8 @@ app.*.symbols
139140
!.vscode/settings.json
140141

141142
allure-report/
142-
allure-results/
143+
allure-results/
144+
145+
# Package specific
146+
**/reports/
147+
**/test/**/failures/

apps/sandbox/lib/widgets/benefit/frost_benefit.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class FrostBenefit extends StatelessWidget {
99
Widget build(BuildContext context) {
1010
return BenefitContainer(
1111
icon: const BenefitIcon(icon: Icon(Icons.bolt)),
12-
title: 'Заморозку',
13-
subtitle: 'Теперь не страшно пропустить занятие',
12+
title: '+2 frost',
13+
subtitle: 'Dont be afraid to skip lesson',
1414
color: Theme.of(context).colorScheme.surface,
1515
);
1616
}

apps/sandbox/lib/widgets/benefit/rating_benefit.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ class RatingBenefit extends StatelessWidget {
99
Widget build(BuildContext context) {
1010
return BenefitContainer(
1111
icon: const BenefitIcon(icon: Icon(Icons.alternate_email_rounded)),
12-
title: '+1 балл к рейтингу',
13-
subtitle: 'Будут все шансы стать фаворитом недели',
12+
title: '+1 score to rating',
13+
subtitle: 'Will have every chance to be the favorite of the week',
1414
color: Theme.of(context).colorScheme.surface,
1515
);
1616
}

packages/allure_report/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.2.5
2+
3+
- **fix:** handle flutter golden assertions
4+
15
## 1.2.4
26

37
- **fix:** handle flutter errors

packages/allure_report/lib/src/allure_reporter.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,14 @@ class AllureReporter implements TestReporter {
305305

306306
/// Flutter errors are pushed to console and require additional processing.
307307
void handleFlutterError(TestMessageEvent event) {
308-
if (event.message.contains('EXCEPTION CAUGHT')) {
309-
final parts = event.message
310-
.split('When the exception was thrown, this was the stack:');
308+
final message = event.message;
309+
if (message.contains('EXCEPTION CAUGHT')) {
310+
final parts =
311+
message.split('When the exception was thrown, this was the stack:');
312+
313+
final isTestFailure = message.contains('following TestFailure was') || //
314+
message.contains('Pixel test failed');
311315

312-
final isTestFailure = event.message.contains('following TestFailure was');
313316
final String details;
314317
final String stackTrace;
315318

@@ -324,7 +327,7 @@ class AllureReporter implements TestReporter {
324327

325328
stackTrace = parts[1].replaceAll(RegExp(r'\n═+$'), '');
326329
} else {
327-
details = event.message;
330+
details = message;
328331
stackTrace = '';
329332
}
330333

packages/allure_report/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: allure_report
22
description: Allure Report Adapter. Use it with [test_reporter](https://pub.dev/packages/test_reporter) package
3-
version: 1.2.4
3+
version: 1.2.5
44
repository: https://github.com/rIIh/dart_test_reporter
55
issue_tracker: https://github.com/rIIh/dart_test_reporter/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+%5Ballure_report%5D
66

0 commit comments

Comments
 (0)