Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Accepting alert on iOS presses the "precise" button instead #17754

Closed
1 task done
jamesvanhorn opened this issue Nov 9, 2022 · 2 comments
Closed
1 task done

bug: Accepting alert on iOS presses the "precise" button instead #17754

jamesvanhorn opened this issue Nov 9, 2022 · 2 comments
Labels
ThirdParty upstream problems XCUITest regarding xcuitest driver

Comments

@jamesvanhorn
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Simulator Screen Shot - iPhone 14 - 2022-11-09 at 10 38 21

While this screen is active, calling driver.switchTo().alert().accept() taps the "Precise: On" button changing it to"Precise: Off"

Expected Behavior

I would expect it to tap on either "Allow Once" or "Allow While Using the App"

Minimal Reproducible Example

driver.switchTo().alert().accept(); //you'll need an alert showing that is location based and allows for toggling precise location on/off

Environment

Operating system: Mac OSX 12.6
If running via appium CLI...
Appium CLI version (output of appium --version): 2.0.0-beta.46
Node.js version (output of node --version): v16.17.0
npm version (output of npm --version): 8.15.0
Last appium version which did not exhibit the problem: Unsure
Appium driver(s) and their version(s): xcuitest@4.12.1
Appium plugin(s) and their version(s): N/A
Platform and version under test: iOS 16.0
Real device or emulator/simulator: Both

Link to Appium Logs

No response

Futher Information

appiumLogs.txt

Side note, is there a suggested better way to have control on Alerts with more than 2 buttons? accept/dismiss work fine for binary alerts, but not for this location alert (bug notwithstanding) as accept() is ambiguous and could be "allow once" or "allow while using app" while dismiss() should map to "don't allow" obviously.

I wrote a class to handle this that uses xpath index to tapAlertAtIndex(int), but that feels hacky/wrong. Thanks!

@jamesvanhorn jamesvanhorn added Bug a problem that needs fixing Needs Triage bugs which are not yet confirmed labels Nov 9, 2022
@mykola-mokhnach
Copy link
Collaborator

This is expected as xctest does not provide a reliable way of alert buttons detection. You could either click the necessary button in your client script or define a custom value to acceptAlertButtonSelector/dismissAlertButtonSelector settings

@mykola-mokhnach mykola-mokhnach added ThirdParty upstream problems XCUITest regarding xcuitest driver and removed Bug a problem that needs fixing Needs Triage bugs which are not yet confirmed labels Nov 9, 2022
@jamesvanhorn
Copy link
Author

thanks as always for the quick response and guidance @mykola-mokhnach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ThirdParty upstream problems XCUITest regarding xcuitest driver
Projects
None yet
Development

No branches or pull requests

2 participants