mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.83k stars 273 forks source link

[v1.27.0] `inputText` failing on `secureTextEntry` #1061

Open KrisLau opened 1 year ago

KrisLau commented 1 year ago

Describe the bug inputText failing on secureTextEntry. The Input is showing a "Strong Password" message and text entry just becomes disabled

To Reproduce Steps to reproduce the behavior, e.g.:

  1. Start the simulator
  2. Run maestro test with - inputText: 'whatever" on a secure text entry Input
  3. The Flow fails at the text input

Expected behavior Enter the password

Screenshots image

Environment information (please complete the following information):

Workspace (if applicable) N/A

Bug report output (if applicable) N/A

Additional context N/A

filipgerat commented 1 year ago

Facing the same issue. Android does not suffer from this. It also doesn't help to set the secureTextEntry property to false

andrejguran commented 1 year ago

I have the same issue and can't get through login/signup step

hkawii commented 1 year ago

Same here, any recommendation to fix it please ?

orbiteleven commented 1 year ago

It's not great, but as a workaround I'm setting those fields to be normal text fields when I detect I'm in testing mode.

thalmann-christof commented 1 year ago

As a workaround, you could disable auto-filling in your simulator. Inside your simulator: Settings → Passwords → Type in a random password → Password options → Disable toggle

In Maestro Cloud, it seems to be disabled by default, so there are no issues there.

EDIT: Depending on the OS version of the simulator, this is disabled or enabled by default. If enabled, it fails, or you manually do this workaround.

solidcell commented 1 year ago

For anyone else running into this, I have two solutions:

Maestro

- launchApp:
    appId: "com.apple.Preferences"
- tapOn: "Passwords"
- inputText: "a" # anything works here as the password
- pressKey: Enter
- tapOn: "Password Options"
- runFlow:
    when:
      visible: "1" # Only toggle when currently ON. This isn't great, but I don't know of a way to be more explicit about which toggle it is. Luckily, there's just the one for AutoFill Passwords (for now...)
    commands:
      - tapOn: "AutoFill Passwords"

That's obviously not great.

However, here's how you can do it via the CLI beforehand:

plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO /Users/jesse/Library/Developer/CoreSimulator/Devices/5CF9D7C1-293E-4EB7-8FAB-B0B9A083B4DB/data/Library/UserConfigurationProfiles/EffectiveUserSettings.plist

Replace your simulator's device ID of course.

Note: The CLI approach doesn't seem to work in all environments. It works locally for me on my laptop, but seems to have no effect on CircleCI.

imjn commented 7 months ago

Hi 👋🏽 Any updates on this issue? I'm facing the same issue.

However, here's how you can do it via the CLI beforehand:

plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO /Users/jesse/Library/Developer/CoreSimulator/Devices/5CF9D7C1-293E-4EB7-8FAB-B0B9A083B4DB/data/Library/UserConfigurationProfiles/EffectiveUserSettings.plist

↑ For my case, just running this command didn't solve the issue but running this command ↓ too solved it.

plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/YOUR_DEVICE_ID/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/UserSettings.plist

eeston commented 7 months ago

Having the same issue here on maestro 1.36.0. I've temporarily worked around this by disabling secureTextEntry in test environments.

pehoracek commented 7 months ago

I managed to get it working with specifying the text in env variable and then using the variable:

appId:  someId
env:
  PASSWORD: "111111"
---

- tapOn:
    id: "inputId"
- inputText: ${PASSWORD}

EDIT: with combination of secureTextEntry={false}

KrisLau commented 3 months ago

@axelniklasson