1

I'm writting my very first widget tests in dart. I have to check if clicking on a button bring us to the next screen. What am I doing wrong here?

 testWidgets('Tapping staring the meeting button leads to conference screen', (widgetTester) async {
    await widgetTester.pumpWidget(const MaterialApp(home: WelcomeScreen()));

    await widgetTester.enterText(find.byKey(const Key('nameInput')), 'User');
    await widgetTester.enterText(find.byKey(const Key('titleInput')), 'Title');
    await widgetTester.enterText(find.byKey(const Key('passwordInput')), 'Password');
    expect(find.byType(CallToActionButton), findsOneWidget);

    await widgetTester.tap(find.byType(CallToActionButton));
    await widgetTester.pump();

    expect(find.byType(ConferenceScreen), findsOneWidget);
  });
Yunnane
  • 85
  • 9

0 Answers0