Skip to content

Commit

Permalink
FR-18979: Added Log out test
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-minaiev-frontegg committed Dec 10, 2024
1 parent 0d55914 commit df76b77
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions example/integration_test/src/logout_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 Logout',
($) 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();
await $.waitUntilVisible(find.text("Not Authenticated"));
},
);
}

0 comments on commit df76b77

Please sign in to comment.