-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64b2786
commit 3d1c0df
Showing
9 changed files
with
79 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: example | ||
name: e2e_app | ||
description: A new Flutter project. | ||
publish_to: none | ||
version: 1.0.0+1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/patrol/example/android/app/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:patrol/patrol.dart'; | ||
import 'package:patrol_challenge/main.dart'; | ||
import 'package:patrol_challenge/pages/quiz/form_page.dart'; | ||
import 'package:patrol_challenge/ui/components/button/elevated_button.dart'; | ||
import 'package:patrol_challenge/ui/style/colors.dart'; | ||
|
||
void main() { | ||
patrolTest('main flow', ($) async { | ||
await $.pumpWidgetAndSettle(const MyApp()); | ||
|
||
await $('Go to the quiz').tap(); | ||
|
||
await $('Start').tap(); | ||
|
||
await $(TextField).enterText('text'); | ||
|
||
final colors = [PTColors.lcYellow, PTColors.lcBlack, PTColors.lcWhite]; | ||
|
||
for (final color in colors) { | ||
await $(SelectableBox) | ||
.which<SelectableBox>((box) => box.color == color) | ||
.scrollTo() | ||
.tap(); | ||
} | ||
|
||
await $('Ready!').tap(); | ||
|
||
// Why doesn't it work? | ||
// await $(ElevatedButton).$(Center).$('Fluttercon').tap(); | ||
|
||
await $(PTElevatedButton) | ||
.which<PTElevatedButton>((widget) => widget.caption == 'Fluttercon') | ||
.tap(); | ||
|
||
await $(ListTile).containing($(Icons.flutter_dash)).$('click').tap(); | ||
|
||
await $(ElevatedButton) | ||
.which<ElevatedButton>( | ||
(widget) => widget.enabled, | ||
) | ||
.at(2) | ||
.scrollTo() | ||
.tap(); | ||
|
||
if (await $.native.isPermissionDialogVisible()) { | ||
await $.native.grantPermissionWhenInUse(); | ||
} | ||
|
||
await $.native.pressHome(); | ||
await $.native.openNotifications(); | ||
|
||
// wait for notification to show up | ||
await Future<void>.delayed(const Duration(seconds: 5)); | ||
|
||
await $.native.openNotifications(); | ||
|
||
await $.native.tapOnNotificationByIndex(0); | ||
|
||
await $.pumpAndSettle(); | ||
|
||
expect($('Congratulations!'), findsOneWidget); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters