Apple's XCUITest framework for UI Testing on iOS and Mac OS.
Questions tagged [xcuitest]
638 questions
2
votes
2 answers
Assert that Image exists on button in UITest
I have a button with a foreground image in a ZStack:
Button(action: {
self.highlighted = !self.highlighted
}) {
ZStack {
Text("Text")
if self.highlighted {
Image("highlighted").resizable()
}
}
}
The…

L3n95
- 1,505
- 3
- 25
- 49
2
votes
2 answers
Appium auto grant permission on iOS
It is super annoying when a popup appears asking for permissions while the tests are running, and it also makes the test very unstable and unreliable.
On Android, we can use autoGrantPermissions, but I couldn't find anything for iOS XCUITest…

Tedxxxx
- 238
- 3
- 19
2
votes
1 answer
How can I add an accessibilityIdentifier to a textField within a UIAlertController
Using XCUITest I'm struggling to locate a textField on an UIAlertController which is used to add items to a list.
I've added an accessibilityIdentifier to the alert itself, but would like to add one to the textField if possible too as so far my test…

0-CJW-0
- 23
- 2
2
votes
0 answers
Xcode Button missing from element tree hierarchy
Using:
Xcode 11.3.1
Simulators 13.3
We have a table cell in our app that has 2 text fields and a button. When we view the element hierarchy, the button does not appear. Below is what it appears like in the app and the element hierarchy obtained by…

reutsey
- 1,743
- 1
- 17
- 36
2
votes
2 answers
How to access the iOS 14 time picker in XCUITest
I want to make use of the inline date picker style that was recently introduced in iOS 14. However, I need to make adjustments to a couple of XCUITests that include the previous picker wheel style.
The problem is I can't change the value of the time…

Anna Fortuna
- 1,071
- 2
- 17
- 33
2
votes
1 answer
How to change date and time on simulator when using XCUITest
I need to automate some UI tests and I have to assert some results that only occur if changing the date on the simulator to a few days the future.
Does anyone know any way of doing that on the simulator without having to change the date on my mac or…

Razvan Baraboi
- 193
- 5
2
votes
1 answer
CDN: trunk URL couldn't be downloaded:https://cdn.jsdelivr.net/cocoa/Specs/1/d/4/CocoaAsyncSocket/7.6.1/CocoaAsyncSocket.podspec.json
I tried pod install command and am getting this error.
% pod install
Analyzing dependencies
[!] CDN: trunk Repo update failed - 18 error(s):
CDN: trunk URL couldn't be downloaded:
…

Jeevitha
- 21
- 2
2
votes
1 answer
XCUItest addUIInterruptionMonitor is not capturing alerts on iOS14 simulator and xcode 12
override func setUp() {
addUIInterruptionMonitor(withDescription: "App store alert") { (alert) -> Bool in
alert.buttons.element(boundBy: 0).tap()
return true
}
}
func test() {
functionThatCausesAlertToAppear()
…

Dimi
- 193
- 1
- 3
- 13
2
votes
1 answer
How to disable some test case in Test suit XCUI?
Currently I have issue that I can't disable some test case ( XCUI Test ).
I already try to disable case from schema, It worked when I test from xcode but when I run it from script it doesn't work.
My Script
/usr/bin/xcodebuild test-without-building…

Nawin P.
- 223
- 1
- 4
- 11
2
votes
0 answers
How does one check the state of a menu item in an XCUI test
Here is my use case...
My application has a number of menu items that have their state toggled between on and off based on a boolean that is also tied to a user default. That is, when the user clicks the menu item it not only toggles the state, it…

Steven W. Klassen
- 1,401
- 12
- 26
2
votes
0 answers
Appium for iOS takes too long to find an element on a screen which displays a video advertisement
I'm trying to find an element on a screen of an iOS native app which is an overlay that displays these components:
A label with text as "Advertisement"
A button with text "skip ad"
A container in the middle which displays a video advertisement for…

Abhijeet Vaikar
- 1,578
- 4
- 27
- 50
2
votes
2 answers
XCUITest to background the app is returning the wrong XCUIApplication.State
I have a XCUITest that requires the app to be put in the background. My understanding was that when pressing the home button the app would be put into the background, which I have coded as…
user1162328
2
votes
0 answers
XCUITest - resetAuthorizationStatus(for:) not working
I'm trying to use the pretty new resetAuthorizationStatus(for:) method in order to test multiple test cases related the different authorizations (BlueTooth, reminders and location primarily) during UI Tests. But, after using the function, the iOS…

cesarmarch
- 617
- 4
- 13
2
votes
1 answer
"Failed to get matching snapshots: Timed out while evaluating UI query." in XCUITest
I'm writing the UI tests for an application that contains huge cells(~ 1000) in its tableview. Trying to access the cell elements will show the below error:
Failed to get matching snapshots: Timed out while evaluating UI query.
Scenarios:
If I…

Confused
- 3,846
- 7
- 45
- 72
2
votes
1 answer
Can we use Notification Center in xcuitest to listen to internal events?
In my test code I am registering a method to listen for a particular event. My intention is when this method is called, I can continue test execution between screen transitions. Couple of approaches I am trying to solve this with.
Approach 1:…

avi rao
- 31
- 6