-
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.
FR-18979: Added Login Via email and password test
- Loading branch information
1 parent
da0b805
commit 17b8b02
Showing
4 changed files
with
100 additions
and
3 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,5 @@ | ||
const loginEmail = '[email protected]'; | ||
const loginPassword = 'Testing123?'; | ||
|
||
const loginWrongEmail = '[email protected]'; | ||
const loginWrongPassword = 'Testing123?2231'; |
92 changes: 92 additions & 0 deletions
92
example/integration_test/src/login_via_email_and_password_test.dart
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,92 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:frontegg_flutter_example/main.dart'; | ||
import 'package:patrol/patrol.dart'; | ||
|
||
import '../fixtures/const.dart'; | ||
|
||
void main() { | ||
patrolTest( | ||
'Success Login via email and password', | ||
($) async { | ||
await $.pumpWidget(const MyApp()); | ||
await $.pumpAndSettle(); | ||
|
||
await $.tap(find.byKey(const ValueKey("LoginButton"))); | ||
await Future.delayed(const Duration(seconds: 5)); | ||
|
||
await $.native.enterTextByIndex( | ||
loginEmail, | ||
index: 0, | ||
keyboardBehavior: KeyboardBehavior.alternative, | ||
); | ||
|
||
await $.native.enterTextByIndex( | ||
loginPassword, | ||
index: 1, | ||
keyboardBehavior: KeyboardBehavior.alternative, | ||
); | ||
|
||
await $.native.tap(Selector(text: "Sign in")); | ||
|
||
await $.waitUntilVisible(find.text("Logout")); | ||
|
||
await $.tap(find.byKey(const ValueKey("LogoutButton"))); | ||
await $.pumpAndSettle(); | ||
}, | ||
); | ||
|
||
patrolTest( | ||
'Failure Login via wrong email and password', | ||
($) async { | ||
await $.pumpWidget(const MyApp()); | ||
await $.pumpAndSettle(); | ||
|
||
await $.tap(find.byKey(const ValueKey("LoginButton"))); | ||
await Future.delayed(const Duration(seconds: 5)); | ||
|
||
await $.native.enterTextByIndex( | ||
loginWrongEmail, | ||
index: 0, | ||
keyboardBehavior: KeyboardBehavior.alternative, | ||
); | ||
|
||
await $.native.enterTextByIndex( | ||
loginPassword, | ||
index: 1, | ||
keyboardBehavior: KeyboardBehavior.alternative, | ||
); | ||
|
||
await $.native.tap(Selector(text: "Sign in")); | ||
|
||
await $.native.waitUntilVisible(Selector(text: "Incorrect email or password")); | ||
}, | ||
); | ||
|
||
patrolTest( | ||
'Failure Login via email and wrong password', | ||
($) async { | ||
await $.pumpWidget(const MyApp()); | ||
await $.pumpAndSettle(); | ||
|
||
await $.tap(find.byKey(const ValueKey("LoginButton"))); | ||
await Future.delayed(const Duration(seconds: 5)); | ||
|
||
await $.native.enterTextByIndex( | ||
loginEmail, | ||
index: 0, | ||
keyboardBehavior: KeyboardBehavior.alternative, | ||
); | ||
|
||
await $.native.enterTextByIndex( | ||
loginWrongPassword, | ||
index: 1, | ||
keyboardBehavior: KeyboardBehavior.alternative, | ||
); | ||
|
||
await $.native.tap(Selector(text: "Sign in")); | ||
|
||
await $.native.waitUntilVisible(Selector(text: "Incorrect email or password")); | ||
}, | ||
); | ||
} |
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