Open NatalieDinh opened 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
Asaf, please look 👀 @asafkorem
The issue has been closed for inactivity.
With the new XCode update my tests fails because of the password prompt. As already asked: there is a permission that we would be able to set to bypass the save password prompt?
Having the same issue, Xcode 14.3.
Also seeing the same thing after updating to Xcode 14.3. Our current workaround is just falling back to Xcode 14.2(you can get it via this link). If the problem persists and it doesn't seem easily fixable, we will likely set up some logic to log the test user in without actually using the password input if thats helpful for anyone else..
Rolled back to 14.2, not seeing the issue anymore.
Having the same issue with Xcode 14.3. As already mentioned is there a way that we would able to set to bypass the save password prompt?
Am new to Detox and also faced the same issue and would rather not downgrade Xcode to 14.2 bc of the fairly large download size and it not detecting my iPhone which has been updated to iOS 16.4.1 already.
Not sure if this helps in your case. I don't think this has been mentioned anywhere else.
I found a rather simple workaround. By backgrounding the app and opening it back, the "Save Password" prompt goes away.
Put this in the sign in test case:
await device.sendToHome();
await device.launchApp({ newInstance: false });
The whole thing should look like this (Maybe, I'm new to Detox and all code testing in general):
it('should sign in', async () => {
await element(by.text('SIGN IN')).tap();
await element(by.id('email')).typeText('test@gmail.com');
await element(by.id('password')).typeText('password');
await element(by.text('SIGN IN')).tap();
await device.sendToHome();
await device.launchApp({ newInstance: false });
await expect(element(by.text('Home screen'))).toBeVisible();
});
});
@asafkorem please answer
Hello @NatalieDinh, unfortunately, the save password prompt is a system dialog, so we are unable to provide a solution through Detox or AppleSimUtils. We recommend tracking this issue related to XCUITest integration: https://github.com/wix/Detox/issues/3208. This upcoming solution for Detox iOS will allow for interaction with system dialogs, addressing cases like yours.
In the meantime, you can manually disable the Autofill feature for passwords on the iOS Simulator, which should alleviate the issue (https://stackoverflow.com/questions/55378639/strong-password-autofill-appears-in-ios-simulator): Navigate to Simulator -> Settings -> Passwords, and toggle the AutoFill passwords option off by first turning it on and then turning it off.
@JasonHiew this workaround is interesting, I wonder if it works for older/newer Xcode versions as well. How did you found it? I wonder if it's an iOS feature or bug.
@asafkorem I found it by accident through trial and error while checking the docs since I couldn't find any solution without downgrading Xcode or modifying the existing form.
I think this workaround will work regardless of Xcode version. On older Xcode versions, as mentioned by others, doesn't have the prompt. As long as app doesn't background itself in the middle of the login process, I don't see why it wouldn't work.
It should instead depend on the way the "Save Password" prompt is handled by the iOS version. Can't guarantee that it'll work on all iOS versions. Have not tested it myself on other iOS versions, but it should work as long as the prompt behaves like this (closes after backgrounding the app).
This seems like a major blocker for upgrading to 14.3 until https://github.com/wix/Detox/issues/3208 is concluded, is there no way to programmatically disable AutoFill via simulator options or something?
I have used this workaround using plutil
-> https://stackoverflow.com/a/76105538
Example:
beforeAll(async () => {
if (device.getPlatform() === 'ios') {
// disable password autofill
execSync(
`plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/${device.id}/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles/Library/ConfigurationProfiles/UserSettings.plist`,
);
execSync(
`plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/${device.id}/data/Library/UserConfigurationProfiles/EffectiveUserSettings.plist`,
);
execSync(
`plutil -replace restrictedBool.allowPasswordAutoFill.value -bool NO ~/Library/Developer/CoreSimulator/Devices/${device.id}/data/Library/UserConfigurationProfiles/PublicInfo/PublicEffectiveUserSettings.plist`,
);
}
await device.launchApp();
});
Tested on Xcode 14.3
and iOS 16.4
@asafkorem looks like it is interesting workaround too with plists.
Also, do I understand right that Detox 21.0.0 will solve this issue or not?
@mdolinin's solution worked flawless on my side. I just had to add below:
const execSync = require('child_process').execSync;
@asafkorem looks like it is interesting workaround too with plists.
Also, do I understand right that Detox 21.0.0 will solve this issue or not?
You understand correctly, it will enable interactions with system dialogs.
The workaround looks interesting. I believe we can refer to this issue from the docs for the meanwhile..
@mdolinin's workaround works for me only if I do the execSync
part after await device.launchApp();
On checking those plist
files for some reason putting execSync
before await device.launchApp();
does not change the values, but putting it after gives me correct values
@JasonHiew's workaround also works
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
Hello, any news about this?
Facing the same issue.
Seeing the same issue in xcode 14.3.1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
Still a valid request.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
I'm not a Detox user, but landed here because Xcode 15.1 and iOS 17.2 broke the Simulator -> Settings -> Passwords -> Disable AutoFill we had implemented via registering a test observer (XCTestObservation
).
The reason, as far as I can tell, is that as soon as the Passwords screen is pushed in the navigation stack, it's popped back:
https://github.com/wix/Detox/assets/1218433/4dd84b23-8535-4d9e-ab27-e6f7d6925f38
Unfortunately, this is all I have to offer. It doesn't help much in terms of finding a solution, but hopefully can serve as a good explanation for folks who experience this issue anew.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this repository, read this discussion.
Having the same issue in Xcode 15.2
This is still an issue, Xcode 15.1 and 15.2, and only on iphone 15.
Description
Hi,
I was wondering if there was a permission that we would be able to set to bypass the save password prompt, similarly to how we are able to bypass notifications/locations prompt.
Your environment
Detox version: ^19.6.5, React Native version: ^0.69.1, Node version: v14.17.0 Device model: iPhone 13 OS: 15 Test-runner: jest