Finished updating the tour
This commit is contained in:
parent
606106e5ec
commit
2fcc6dcab7
7 changed files with 288 additions and 83 deletions
|
|
@ -129,11 +129,17 @@ void main() {
|
|||
return appState;
|
||||
}
|
||||
|
||||
testWidgets('shows step 1 (Receipts) automatically on first launch', (tester) async {
|
||||
testWidgets('shows the "What This App Does" intro automatically on first launch, with the '
|
||||
'refund-rate and lawmakers disclaimer', (tester) async {
|
||||
await pumpShellWithFreshTour(tester);
|
||||
|
||||
expect(find.text('Add Receipts Here'), findsOneWidget);
|
||||
expect(find.text('Step 1 of 4'), findsOneWidget);
|
||||
expect(find.text('What This App Does'), findsOneWidget);
|
||||
expect(find.text('Step 1 of 6'), findsOneWidget);
|
||||
expect(find.textContaining('12.5¢'), findsOneWidget);
|
||||
expect(find.textContaining('Disclaimer'), findsOneWidget);
|
||||
expect(find.textContaining('Missouri lawmakers'), findsOneWidget);
|
||||
// No specific element to spotlight for the intro — stays on
|
||||
// whichever tab MainShell defaults to.
|
||||
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget);
|
||||
});
|
||||
|
||||
|
|
@ -150,13 +156,19 @@ void main() {
|
|||
);
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Add Receipts Here'), findsNothing);
|
||||
expect(find.text('What This App Does'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('tapping the dimmed barrier does not dismiss the tour or reach the highlighted button',
|
||||
(tester) async {
|
||||
await pumpShellWithFreshTour(tester);
|
||||
|
||||
// Advance to the Receipts step, which is the one with an actual
|
||||
// highlighted, tappable element (the "+") behind the barrier.
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Add Receipts Here'), findsOneWidget);
|
||||
|
||||
// Top-left corner, away from the card and from the highlighted "+"
|
||||
// (which sits top-right in the AppBar).
|
||||
await tester.tapAt(const Offset(10, 10));
|
||||
|
|
@ -168,28 +180,44 @@ void main() {
|
|||
"vehicles yet — was not actually reached");
|
||||
});
|
||||
|
||||
testWidgets('Next advances through all four steps, switching tabs and pushing Settings > Data',
|
||||
testWidgets(
|
||||
'Next advances through all six steps, switching tabs, then pushing Settings > Data',
|
||||
(tester) async {
|
||||
await pumpShellWithFreshTour(tester);
|
||||
|
||||
expect(find.text('What This App Does'), findsOneWidget);
|
||||
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Add Receipts Here'), findsOneWidget);
|
||||
expect(find.text('Step 2 of 6'), findsOneWidget);
|
||||
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Add Vehicles Here'), findsOneWidget);
|
||||
expect(find.text('Step 2 of 4'), findsOneWidget);
|
||||
expect(find.text('Step 3 of 6'), findsOneWidget);
|
||||
expect(find.widgetWithText(AppBar, 'Vehicles'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Choose a Report Date Range'), findsOneWidget);
|
||||
expect(find.text('Step 4 of 6'), findsOneWidget);
|
||||
expect(find.widgetWithText(AppBar, 'Fuel Report'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Find Data Settings'), findsOneWidget);
|
||||
expect(find.text('Step 5 of 6'), findsOneWidget);
|
||||
expect(find.widgetWithText(AppBar, 'Settings'), findsOneWidget);
|
||||
expect(find.byType(DataSettingsScreen), findsNothing,
|
||||
reason: 'still on the Settings landing page, not pushed into Data yet');
|
||||
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Back Up to the Cloud'), findsOneWidget);
|
||||
expect(find.text('Step 4 of 4'), findsOneWidget);
|
||||
expect(find.text('Step 6 of 6'), findsOneWidget);
|
||||
expect(find.byType(DataSettingsScreen), findsOneWidget, reason: 'tour pushed Settings > Data');
|
||||
expect(find.text('Cloud Storage'), findsOneWidget);
|
||||
expect(find.widgetWithText(FilledButton, 'Got It'), findsOneWidget,
|
||||
|
|
@ -201,7 +229,7 @@ void main() {
|
|||
(tester) async {
|
||||
final appState = await pumpShellWithFreshTour(tester);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
for (var i = 0; i < 5; i++) {
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
|
@ -226,7 +254,7 @@ void main() {
|
|||
await tester.tap(find.widgetWithText(TextButton, 'Skip Tour'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Add Receipts Here'), findsNothing);
|
||||
expect(find.text('What This App Does'), findsNothing);
|
||||
expect(appState.hasSeenOnboardingTour, isTrue);
|
||||
expect(find.widgetWithText(AppBar, 'Receipts'), findsOneWidget,
|
||||
reason: 'stayed on the tab it started on');
|
||||
|
|
@ -236,7 +264,7 @@ void main() {
|
|||
(tester) async {
|
||||
await pumpShellWithFreshTour(tester);
|
||||
|
||||
for (var i = 0; i < 3; i++) {
|
||||
for (var i = 0; i < 5; i++) {
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Next'));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue