Skip to content

Commit

Permalink
feat(#687): update sequence utils
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Mar 19, 2024
1 parent 6a75a09 commit 287f5b8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/generate_screendocs/screenshot_sequence.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void main() {
await loadApp(tester);

// login
await wait(5); // wait for logo
await settleAndWait(tester, 5); // wait for logo
await takeScreenshot(tester, binding, 'login');

// login-redirect (not working; only taking screenshot of loading screen)
Expand Down
34 changes: 32 additions & 2 deletions app/generate_screendocs/sequence_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,28 @@ Future<void> useBottomNavigation(
).first);
}

Future<void> changeDrugStatus(
WidgetTester tester,
String drug,
String activity,
) async {
final dropdownKey = 'drug-status-selection-${drug.toLowerCase()}';
await tester.tap(
find.byKey(Key(dropdownKey)).first,
);
await settleAndWait(tester, 2);
await tester.tap(
find.byKey(Key('$dropdownKey-$activity')).first,
);
}

Future<void> tapFirstFaqItem(WidgetTester tester) async {
await tester.tap(find.byType(ExpansionTile).first);
await tester.tap(
find.descendant(
of: find.byType(ExpansionTile).first,
matching: find.byType(Icon),
),
);
}

Future<void> tapDrugSearchTooltip(WidgetTester tester) async {
Expand All @@ -212,8 +232,18 @@ Future<void> closeDrugFilters(WidgetTester tester) async {
await tester.tap(find.byKey(Key('close-filter-drawer-button')).first);
}

Future<void> filterByDrugStatus(
WidgetTester tester,
{ required bool showInactive }
) async {
await tester.tap(find.byKey(Key('drug-status-filter-dropdown')).first);
await settleAndWait(tester, 1);
await tester.tap(
find.byKey(Key('drug-status-filter-${showInactive.toString()}')).first,
);
}

Future<void> hideMissingWarningLevel(WidgetTester tester) async {
Future<void> toggleMissingWarningLevel(WidgetTester tester) async {
await tester.tap(find.byType(ActionChip).last);
}

Expand Down

0 comments on commit 287f5b8

Please sign in to comment.