maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Biometrics?

Open nealsanche opened this issue 3 years ago • 10 comments

I have an app that I want to automate that performs some fingerprint biometric checks. We really only need to test on one platform, so can restrict it to Android emulators. Would it be possible to add execution of something like:

adb -e emu finger touch 1

In Maestro so that the script can provide the necessary fingerprint when needed? I've only just started looking at Maestro and find it promising. Thanks.

nealsanche avatar Oct 17 '22 16:10 nealsanche

+1 for biometrics

We are implementing passkeys as a auth mechanism & cannot accept the passkey request in the maestro test without fingerpint

peterferguson avatar Mar 30 '23 10:03 peterferguson

Having the same problem and just grab a workaround from the Maestro Slack channel. We can achieve it by running the localhost server and accessing it via Maestro JavaScript. The localhost can get a request and execute any command in the file system (e.g.: xcrun simctl push …) Hope this help.

xuanmai-agilityio avatar May 26 '23 13:05 xuanmai-agilityio

@xuanmai-agilityio have you got a code snippet / repo showing how you achieve this?

peterferguson avatar Jun 01 '23 21:06 peterferguson

@peterferguson Not fully tested with the push notification or any simulator/emulator control. But this snippet works with simple commands like ls, la,.... curl http://localhost:3000/runcmd\?cmd\=ls hope this help

const express = require('express');
const { exec } = require('child_process');

const app = express();
const port = 3000;

app.get('/runcmd', (req, res) => {
  const cmd = req.query.cmd;

  exec(cmd, (error, stdout, stderr) => {
    if (error) {
      console.error(`Error executing command: ${error.message}`);
      res.status(500).send('An error occurred');
    } else {
      console.log(`Command executed successfully: ${cmd}`);
      res.send(stdout);
    }
  });
});

app.listen(port, () => {
  console.log(`Server is running on port ${port}`);
});

xuanmai-agilityio avatar Jun 02 '23 05:06 xuanmai-agilityio

+1 for biometrics

We have device authentication for app access that is constantly breaking. Would be great to be able to catch it with automated e2e tests.

DannyPat44 avatar Aug 18 '23 18:08 DannyPat44

There's some docs on Android Developers about simulating fingerprint, dropping it in case it's useful. It's emulator-only, though.

bartekpacia avatar Sep 17 '23 13:09 bartekpacia

Just a note – there's no active development going on here, but if someone wants to take a stab at it, we are always more than happy to review the PR!

bartekpacia avatar Sep 03 '24 10:09 bartekpacia

Hi, there is a similar command for iOS Simulator that emulates a biometric check. I believe this should be fairly straightforward to implement since maestro already uses simctl for some operations.

xcrun simctl spawn 'SIMULATOR_ID' notifyutil -p com.apple.BiometricKit_Sim.fingerTouch.match
xcrun simctl spawn 'SIMULATOR_ID' notifyutil -p com.apple.BiometricKit_Sim.fingerTouch.nomatch

xcrun simctl spawn 'SIMULATOR_ID' notifyutil -p com.apple.BiometricKit_Sim.pearl.match
xcrun simctl spawn 'SIMULATOR_ID' notifyutil -p com.apple.BiometricKit_Sim.pearl.nomatch

There are two separate notifications for TouchID and FaceID, but for some reason fingerTouch works for both in my tests.

alex-medinsh avatar Sep 06 '24 09:09 alex-medinsh

+1 for biometrics

@RepliedSage11 Does this work in Maestro cloud?

cmw9706 avatar Oct 10 '24 04:10 cmw9706

I haven't tried Maestro Cloud.

alex-medinsh avatar Oct 10 '24 05:10 alex-medinsh

@peterferguson Not fully tested with the push notification or any simulator/emulator control. But this snippet works with simple commands like ls, la,.... curl http://localhost:3000/runcmd\?cmd\=ls hope this help

const express = require('express');
const { exec } = require('child_process');

const app = express();
const port = 3000;

app.get('/runcmd', (req, res) => {
  const cmd = req.query.cmd;

  exec(cmd, (error, stdout, stderr) => {
    if (error) {
      console.error(`Error executing command: ${error.message}`);
      res.status(500).send('An error occurred');
    } else {
      console.log(`Command executed successfully: ${cmd}`);
      res.send(stdout);
    }
  });
});

app.listen(port, () => {
  console.log(`Server is running on port ${port}`);
});

adb -e emu finger touch 45146572 adb -t 5554 emu finger touch 45146572

if i call the request in browser manually it's woking fine all times but when the cmd is executed through local host node server it's failing some times -> http://localhost:3000/runcmd?cmd=adb%20-e%20emu%20finger%20touch%2045146572

Prathiv7 avatar Dec 09 '24 11:12 Prathiv7

+1 to biometrics on iOS

dasha-frolova-roo avatar Jan 06 '25 16:01 dasha-frolova-roo

Would it be possible to requalify this P3 into maybe a P1 or P2, as more and more mobile application and web3 uses passkey as authentication instead of login/password ?

yoobi avatar Oct 31 '25 14:10 yoobi