-
Notifications
You must be signed in to change notification settings - Fork 2
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
949939e
commit f4d8912
Showing
1 changed file
with
41 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:frontegg_flutter_example/main.dart'; | ||
import 'package:patrol/patrol.dart'; | ||
|
||
void main() { | ||
const googleButtonLabel = "continue with google"; | ||
late final String email; | ||
patrolSetUp(() { | ||
email = const String.fromEnvironment('GOOGLE_EMAIL'); | ||
|
||
assert(email.isNotEmpty); | ||
}); | ||
|
||
patrolTest( | ||
'Success Login via Google Provider', | ||
($) async { | ||
await $.pumpWidget(const MyApp()); | ||
await $.pumpAndSettle(); | ||
|
||
await $.tap(find.byKey(const ValueKey("LoginButton"))); | ||
await Future.delayed(const Duration(seconds: 5)); | ||
|
||
await $.native.tap(Selector(text: googleButtonLabel)); | ||
await Future.delayed(const Duration(seconds: 5)); | ||
if (Platform.isIOS) { | ||
await $.native.tap(Selector(text: "Continue")); | ||
await Future.delayed(const Duration(seconds: 7)); | ||
} | ||
await $.native.tap(Selector(text: email)); | ||
|
||
await $.waitUntilVisible(find.text("Logout"), timeout: const Duration(seconds: 15),); | ||
|
||
await $.tap(find.byKey(const ValueKey("LogoutButton"))); | ||
await $.pumpAndSettle(); | ||
await $.waitUntilVisible(find.text("Not Authenticated")); | ||
}, | ||
); | ||
} |