HomeiOS Developmentandroid - Find out how to make 'navigation.push()' works for integration check...

android – Find out how to make ‘navigation.push()’ works for integration check in Flutter?


It’s my first time utilizing an integration check in Flutter.

I write the check code beneath :

testWidgets('Navigate to password web page', (tester) async {

      // ! Launch the app.
      app.most important();
      await tester.pumpAndSettle();
      await Future.delayed(const Length(seconds: 2));

      // ! Faucet on the enter person login web page
      await tester.faucet(discover.byKey(const Key('enter_login_page_btn')));
      await tester.pumpAndSettle();

      // Test if the brand new web page is displayed appropriately
      anticipate(discover.byKey(const Key('page_user_login')), findsWidgets);

      // Enter textual content into the login/e-mail enter area.
      await tester.enterText(
          discover.byKey(const Key('user_input_login')), "[email protected]");
      await tester.testTextInput.receiveAction(TextInputAction.performed);
      await tester.pumpAndSettle();
      await Future.delayed(const Length(seconds: 2));

      // ! Faucet on the validate person login button.
      await tester.faucet(discover.byKey(const Key('validate_login_btn')));
      await tester.pumpAndSettle();
      await Future.delayed(const Length(seconds: 2));
}

that is code when the ‘login’ button is pressed :

Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => PasswordPage(
                  e-mail ?? '',
                  key: const Key('page_user_password'), 
                ),
                maintainState: true,
              ),
            );

In regular handbook check, the navigation works completely, however when I attempt to check it utilizing the mixing check, nothing occur, it would not navigate to the following web page which is the password web page and the check ends.

Does anyone has any concept why the navigation just isn’t working in integration check ?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments