Skip to content

Commit

Permalink
Fix crashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f committed Jan 8, 2025
1 parent 4d19479 commit 845cf70
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions integration_test/features/checkout/checkout_flow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ void main() {
final continueBtn = $.tester.widget<Button>($(Button));
expect(continueBtn.disabled, true);

await $(CTextField).enterText("[email protected]");

// check if payment is available or not
await $.tester.enterText($(CTextField), '[email protected]');
await $.pump(const Duration(seconds: 1));
FocusManager.instance.primaryFocus?.unfocus();
await $.pump(const Duration(seconds: 1));
// // check if payment is available or not
final stripeFound = $.tester.any(find.byTooltip(Providers.stripe.name));
if (stripeFound) {
// Check if continue button is disabled
Expand All @@ -58,30 +60,31 @@ void main() {
expect($(AppWebView), findsOneWidget);
expect($(AppWebView).visible, true);
}

// go back
await $(IconButton).tap();
await $.pump(const Duration(seconds: 1));
await $.tester.tap($(IconButton));
await $.pump(const Duration(seconds: 1));
await $.pump(const Duration(seconds: 1));
}
FocusManager.instance.primaryFocus?.unfocus();
await $.pump(const Duration(seconds: 1));

/// Check out flow for shepherd
final shepherdFound =
$.tester.any(find.byTooltip(Providers.shepherd.name));
if (shepherdFound) {
final shepherdProvider = find.byTooltip(Providers.shepherd.name);
await $.tester.tap(shepherdProvider);
await $.pump(const Duration(seconds: 1));
await $.tester.tap($(Button));
await $.pumpAndTrySettle();
await $.pumpAndSettle();

expect($(AppWebView), findsOneWidget);
expect($(InAppWebView), findsOneWidget);

await $.pump(const Duration(seconds: 1));
await $.tester.tap($(IconButton));
await $.pump(const Duration(seconds: 1));
await $.pump(const Duration(seconds: 1));
}
FocusManager.instance.primaryFocus?.unfocus();

/// Check out flow for froPay
final froPayFound = $.tester.any(find.byTooltip(Providers.fropay.name));
if (froPayFound) {
Expand Down

0 comments on commit 845cf70

Please sign in to comment.