leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
856 stars 126 forks source link

Testing Biometrics features #7

Closed kubawojtczakLC closed 9 months ago

bartekpacia commented 2 years ago

Android:

Additional problem: many, many vendors.

iOS:

JulianBissekkou commented 1 year ago

Is this on some roadmap to be implemented soon? We are currently evaluating if this framework can be used and biometrics would be a feature that is nice (but urgent required)

So far this lib looks amazing, keep pushing guys 💪🏽

bartekpacia commented 1 year ago

Hello @JulianBissekkou! Glad you like Patrol 💙

Is this on some roadmap to be implemented soon?

We'll share our roadmap with the community soon, and researching biometrics should be there, but I'm not sure what priority it has. I'll ping you here when it happens.

mzdm commented 1 year ago

I was able to activate biometry settings via PIN (emulator) however I'm stuck on this screen because there is no "Confirm" button. If someone finds a workaround for this please let me know!

  // Setting up biometry from Security settings
  await $.native.tap(Selector(text: 'Screen lock'));
  await $.native.tap(Selector(text: 'PIN'));

  await $.native.enterTextByIndex('1234', index: 0);
  await $.native.tap(Selector(text: 'NEXT'));
  await $.native.enterTextByIndex('1234', index: 0);
  await $.native.tap(Selector(text: 'CONFIRM'));
  await Future.delayed(Duration(seconds: 1));
  await $.native.tap(Selector(text: 'DONE'));

  // Biometry set up, go back to app
  await $.native.pressBack();

  final loginButton = find.text('Aktivovat');
  await tester.pumpUntilFound(loginButton);
  await tester.tap(loginButton);

  await $.native.enterTextByIndex('1234', index: 0);
  await $.native.tap(Selector(className: 'android.widget.EditText'));   // Stuck on biometry PIN validation screen (see screenshot) because there is no button and no way to send "ENTER" key
bartekpacia commented 1 year ago

@mzdm You can try taking a native view hierarchy dump and trying to find the "->|" (continue) button there. Maybe it has some unique resource-id that you can use.

mzdm commented 1 year ago

@mzdm You can try taking a native view hierarchy dump and trying to find the "->|" (continue) button there. Maybe it has some unique resource-id that you can use.

I tried but unfortunately "->|" seems to be a part of the keyboard which is not included in the native hierarchy tree

Code ```xml ```
sebastianbuechler commented 1 year ago

I was able to activate biometry settings via PIN (emulator) however I'm stuck on this screen because there is no "Confirm" button. If someone finds a workaround for this please let me know!

  // Setting up biometry from Security settings
  await $.native.tap(Selector(text: 'Screen lock'));
  await $.native.tap(Selector(text: 'PIN'));

  await $.native.enterTextByIndex('1234', index: 0);
  await $.native.tap(Selector(text: 'NEXT'));
  await $.native.enterTextByIndex('1234', index: 0);
  await $.native.tap(Selector(text: 'CONFIRM'));
  await Future.delayed(Duration(seconds: 1));
  await $.native.tap(Selector(text: 'DONE'));

  // Biometry set up, go back to app
  await $.native.pressBack();

  final loginButton = find.text('Aktivovat');
  await tester.pumpUntilFound(loginButton);
  await tester.tap(loginButton);

  await $.native.enterTextByIndex('1234', index: 0);
  await $.native.tap(Selector(className: 'android.widget.EditText'));   // Stuck on biometry PIN validation screen (see screenshot) because there is no button and no way to send "ENTER" key

Did you find a solution for continuing with PIN?

bartekpacia commented 1 year ago

As for the Enter key: we could do this with [UiDevice#pressEnter()](https://developer.android.com/reference/androidx/test/uiautomator/UiDevice#pressEnter()) on Android.

See also #1516.

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.