Monday, February 12, 2024
HomeiOS Developmentandroid - How one can make 'navigation.push()' works for integration check in...

android – How one can 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 under :

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

      // ! Launch the app.
      app.predominant();
      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();

      // Verify 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 discipline.
      await tester.enterText(
          discover.byKey(const Key('user_input_login')), "[email protected]");
      await tester.testTextInput.receiveAction(TextInputAction.achieved);
      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 guide check, the navigation works completely, however when I attempt to check it utilizing the mixing check, nothing occur, it would not navigate to the subsequent web page which is the password web page and the check ends.

Does anyone has any thought why the navigation shouldn’t be working in integration check ?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments