Skip to content

Commit

Permalink
fix(allure): handle flutter golden assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
rIIh committed Dec 21, 2024
1 parent 2b1dc75 commit ac9dc32
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
/dev/integration_tests/**/xcuserdata
/dev/integration_tests/**/Pods
/packages/flutter/coverage/
/test/**/failures/
version
analysis_benchmark.json
pubspec_overrides.yaml
Expand Down Expand Up @@ -139,4 +140,8 @@ app.*.symbols
!.vscode/settings.json

allure-report/
allure-results/
allure-results/

# Package specific
**/reports/
**/test/**/failures/
4 changes: 2 additions & 2 deletions apps/sandbox/lib/widgets/benefit/frost_benefit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class FrostBenefit extends StatelessWidget {
Widget build(BuildContext context) {
return BenefitContainer(
icon: const BenefitIcon(icon: Icon(Icons.bolt)),
title: 'Заморозку',
subtitle: 'Теперь не страшно пропустить занятие',
title: '+2 frost',
subtitle: 'Dont be afraid to skip lesson',
color: Theme.of(context).colorScheme.surface,
);
}
Expand Down
4 changes: 2 additions & 2 deletions apps/sandbox/lib/widgets/benefit/rating_benefit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class RatingBenefit extends StatelessWidget {
Widget build(BuildContext context) {
return BenefitContainer(
icon: const BenefitIcon(icon: Icon(Icons.alternate_email_rounded)),
title: '+1 балл к рейтингу',
subtitle: 'Будут все шансы стать фаворитом недели',
title: '+1 score to rating',
subtitle: 'Will have every chance to be the favorite of the week',
color: Theme.of(context).colorScheme.surface,
);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/allure_report/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.5

- **fix:** handle flutter golden assertions

## 1.2.4

- **fix:** handle flutter errors
Expand Down
13 changes: 8 additions & 5 deletions packages/allure_report/lib/src/allure_reporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,14 @@ class AllureReporter implements TestReporter {

/// Flutter errors are pushed to console and require additional processing.
void handleFlutterError(TestMessageEvent event) {
if (event.message.contains('EXCEPTION CAUGHT')) {
final parts = event.message
.split('When the exception was thrown, this was the stack:');
final message = event.message;
if (message.contains('EXCEPTION CAUGHT')) {
final parts =
message.split('When the exception was thrown, this was the stack:');

final isTestFailure = message.contains('following TestFailure was') || //
message.contains('Pixel test failed');

final isTestFailure = event.message.contains('following TestFailure was');
final String details;
final String stackTrace;

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

stackTrace = parts[1].replaceAll(RegExp(r'\n═+$'), '');
} else {
details = event.message;
details = message;
stackTrace = '';
}

Expand Down
2 changes: 1 addition & 1 deletion packages/allure_report/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: allure_report
description: Allure Report Adapter. Use it with [test_reporter](https://pub.dev/packages/test_reporter) package
version: 1.2.4
version: 1.2.5
repository: https://github.com/rIIh/dart_test_reporter
issue_tracker: https://github.com/rIIh/dart_test_reporter/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+%5Ballure_report%5D

Expand Down

0 comments on commit ac9dc32

Please sign in to comment.