Skip to content

Commit

Permalink
Fix tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Sep 15, 2023
1 parent 65a747f commit cb67ceb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions integration_test/app_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,28 @@ void main() {

testWidgets('Run app and login', (tester) async {
await prep(tester, username, password, name);

SharedPreferences prefs = await SharedPreferences.getInstance();
expect(prefs.get("email"), equals(username));
expect(prefs.get("password"), equals(password));
expect(find.text(name, skipOffstage: false), findsWidgets);
expect(find.text("Username"), findsNothing);
});

testWidgets('Test TimeTable page', (tester) async {
await prep(tester, username, password, name);

await tester.tap(find.byType(NavigationDestination).at(1));
await pumpUntilFound(tester, find.textContaining("Today"));
expect(find.textContaining("Today"), findsOneWidget);
expect(find.textContaining("TODAY"), findsOneWidget);
});

testWidgets('Test TimeTable page scroll', (tester) async {
await prep(tester, username, password, name);

await tester.tap(find.byType(NavigationDestination).at(1));
await pumpUntilFound(tester, find.textContaining("Today"));
expect(find.textContaining("Today"), findsOneWidget);
expect(find.textContaining("TODAY"), findsOneWidget);

await tester.tap(find.byKey(const Key("TimeTableScrollForward")));
await pumpUntilFound(tester, find.textContaining("Tomorrow"));
//expect(find.textContaining("Tomorrow"), findsOneWidget);
expect(find.textContaining("TOMORROW"), findsOneWidget);
});
});
}
Expand All @@ -60,5 +58,5 @@ Future<void> prep(
await tester.tap(find.byType(ElevatedButton));

await pumpUntilFound(tester, find.text(name));
await tester.pump(const Duration(seconds: 5));
await tester.pump(const Duration(seconds: 1));
}

0 comments on commit cb67ceb

Please sign in to comment.