Skip to content

Commit

Permalink
all passkey tests polished
Browse files Browse the repository at this point in the history
  • Loading branch information
jokkon committed Sep 10, 2024
1 parent 93f4df8 commit 65c4e66
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
4 changes: 2 additions & 2 deletions integration_test/passkey_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ void main() {
await tester.shortWait();

await tester.enterText(find.byKey(newPin), simplePin);
await tester.shortWait();
await tester.longWait();
await tester.enterText(find.byKey(confirmPin), simplePin);
await tester.shortWait();
await tester.longWait();

await tester.tap(find.byKey(saveButton).hitTestable());
await tester.shortWait();
Expand Down
51 changes: 41 additions & 10 deletions integration_test/utils/passkey_test_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,63 @@ extension Fido2Functions on WidgetTester {
await shortWait();
}

/// Factory reset Fido2 application
/// Factory reset FIDO application
Future<void> resetFido2() async {
final targetKey = approvedKeys[0]; // only reset approved keys!

/// 1. make sure we are using approved key
await switchToKey(targetKey);
await shortWait();

/// 2. open the key menu
await tapPopupMenu(targetKey);
/// 2. open the home view
await tap(find.byKey(homeDrawer).hitTestable());
await shortWait();
await tap(find.byKey(yubikeyFactoryResetMenuButton).hitTestable());
await longWait();

/// 3. then toggle 'Fido2' in the 'Factory reset' reset_dialog.dart
/// 3. open menu
await tap(find.byKey(actionsIconButtonKey).hitTestable());
await shortWait();
await tap(find.byKey(yubikeyFactoryResetMenuButton));
await shortWait();

/// 4. then toggle 'Piv' in the 'Factory reset' reset_dialog.dart
await tap(find.byKey(factoryResetPickResetFido2));
await longWait();

/// 4. Click reset TextButton: done
/// 5. Click reset TextButton: done
await tap(find.byKey(factoryResetReset));
await fido2DanceWait();

/// 5. Click the 'Close' button
/// 6. Click the close button
await tap(find.text('Close').hitTestable());
await shortWait();

/// TODO 6. Verify Resetedness
}

// /// Factory reset Fido2 application
// Future<void> resetFido2() async {
// final targetKey = approvedKeys[0]; // only reset approved keys!
//
// /// 1. make sure we are using approved key
// await switchToKey(targetKey);
// await shortWait();
//
// /// 2. open the key menu
// await tapPopupMenu(targetKey);
// await shortWait();
// await tap(find.byKey(yubikeyFactoryResetMenuButton).hitTestable());
// await longWait();
//
// /// 3. then toggle 'Fido2' in the 'Factory reset' reset_dialog.dart
// await tap(find.byKey(factoryResetPickResetFido2));
// await longWait();
//
// /// 4. Click reset TextButton: done
// await tap(find.byKey(factoryResetReset));
// await fido2DanceWait();
//
// /// 5. Click the 'Close' button
// await tap(find.text('Close').hitTestable());
// await shortWait();
//
// /// TODO 6. Verify Resetedness
// }
}

0 comments on commit 65c4e66

Please sign in to comment.