Skip to content

Commit

Permalink
FR-18979: Added login via Apple
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-minaiev-frontegg committed Dec 11, 2024
1 parent 949939e commit f4d8912
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions example/integration_test/src/login_via_google_test.dart
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"));
},
);
}

0 comments on commit f4d8912

Please sign in to comment.