uuv_flutter 0.0.1-beta.1
uuv_flutter: ^0.0.1-beta.1 copied to clipboard
An accessibility driven solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and flutter
UUV_FLUTTER #
An accessibility driven solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and flutter
Create or edit the build.yaml file at the root of your project #
targets:
$default:
sources:
- integration_test/** # By default, build runner will not generate code in the integration folder
- test/** # so we override paths for code generation here
- lib/**
- $package$
builders:
bdd_widget_test|featureBuilder:
enabled: false
uuv_flutter|generateTests:
enabled: true
Write your tests #
Create a test file integration_test/first-test.feature
Feature: Panoramax mobile App
Scenario: Homepage
Given the app is running
Then I should see a title named {'Your sequences'}
And I should see a button named {'Create a new sequence'}
Scenario: Capture page
Given the app is running
When I tap on a button named {'Create a new sequence'}
Then I should see a button named {'Take a picture'}
And I should see a button named {'Switch camera'}
And I should see a button named {'Create a new sequence with captured pictures'}
Generate test files from feature files #
One shot #
dart run build_runner build --delete-conflicting-outputs
Watch change #
dart run build_runner watch --delete-conflicting-outputs
Implement generated step the app is running #
Edit the generated file integration_test/step/the_app_is_running.dart to start your app during the step :
import 'package:flutter_test/flutter_test.dart';
import 'package:panoramax_mobile/main.dart'; // <-- Replace this path
Future<void> theAppIsRunning(WidgetTester tester) async {
await tester.pumpWidget(const PanoramaxApp()); // <-- Replace PanoramaxApp by your app
}
Run generated tests #
flutter test integration_test