xcode-ui-testing

run all test classes in xcode ui test

蓝咒 提交于 2020-08-11 22:25:59
问题 i am completely new to xcode ui application test. i have the source of the ios app. But i have to test the app using xcode ui test. currently i am adding new test classes to my ui test by creating new file and adding test cases by recording. I can run my test class individually. But i want to execute all my test classes at a time. How i can do this. I am completely new in this domain. Any kind of help will be appreciated. U can also give me a ui test project link or any link which can help me

UI testing fails with error “Failed to get snapshot within 15.0s”

冷暖自知 提交于 2020-05-08 17:23:32
问题 I am having a table view with a huge amount of cells. I tried to tap a particular cell from this table view. But the test ending with this error: Failed to get snapshot within 15.0s I assume that, the system will take snapshot of the whole table view before accessing its element. Because of the huge number of cells, the snapshot taken time was not enough (15 secs is may be the system default time). I manually set the sleep time / wait time (I put 60 secs). Still I can not access the cells

iOS UITest: How to test custom accessibility actions?

做~自己de王妃 提交于 2020-03-21 11:51:05
问题 I want to support VoiceOver. I have an UIButton inside of an UITableViewCell . According to a best practice I have disabled the button for accessibility ( .isAccessibilityElement = false ) and implemented a custom accessibility action for the cell ( accessibilityCustomActions, NSAccessibilityCustomAction ). This way VoiceOver would not find and read the button as an own element. To make the feature behind the button accessible, I have added a custom accessibility action to the cell. With the

UI testing failure - did not receive view did disappear notifications within 2.0s error

断了今生、忘了曾经 提交于 2020-01-15 05:09:10
问题 I am writing my test suite UI automation with xcode 8. However I keep occurring into this problem while trying to dismiss alerts. I am currently using the addUIInterruptionMonitor in order to dismiss my alerts, however when I call the interruption monitor to fire using app.tap() I get the error UI testing failure - did not receive view did disappear notifications within 2.0s error Why is this happening and how can I prevent this from happening? Attached is my start up code for the app

Scheme language setting ignored in iOS unit and ui tests

做~自己de王妃 提交于 2020-01-12 13:03:03
问题 My final goal is to issue xcodebuild test from command line picking different schemes for different languages. Currently I have two schemes, the only difference between them is the application language. In one scheme it is English, in the other is Spanish. If I use xCode to run the application it works nice, it is launched with the language specified in the scheme I have picked, both EN or ES are okay. If I run the tests from xCode, language setting is ignored. Whichever scheme I pick, it

Scheme language setting ignored in iOS unit and ui tests

房东的猫 提交于 2020-01-12 13:02:52
问题 My final goal is to issue xcodebuild test from command line picking different schemes for different languages. Currently I have two schemes, the only difference between them is the application language. In one scheme it is English, in the other is Spanish. If I use xCode to run the application it works nice, it is launched with the language specified in the scheme I have picked, both EN or ES are okay. If I run the tests from xCode, language setting is ignored. Whichever scheme I pick, it

Xcode UI Tests are failing because of XCApplicationStateRunningActive on physical device

≯℡__Kan透↙ 提交于 2020-01-12 03:20:07
问题 In my app I'm adding some UI tests. With one test method everything works perfectly, but when I added second method, the test is failing because of the following error: I feel like [[[XCUIApplication alloc] init] launch]; doesn't terminate the app as it suppose to. EDIT 1: I also noticed, if I press home button on my physical device after test finishes, I can see 2 instances of the app still running on the background. And if I try to start the tests again I get the message in Xcode that it

Is there a way to find if the XCUIElement has focus or not?

我们两清 提交于 2020-01-10 13:03:27
问题 One of my screen has multiple text fields, I can land to this screen from different other screens. In each case I am making one or another text field as first responder. I am not able to write test to determine whether the desired textField has focus or not. When I print the textfield in console - Output: { TextField 0x131171d40: traits: 146031247360, Focused , {{6.0, 108.3}, {402.0, 35.0}}, value: ​ } But I could not find any focus/isFocus property on XCUIElement. Is there a way to achieve

Swift XCUI string assertion failing

£可爱£侵袭症+ 提交于 2020-01-06 06:09:32
问题 I am using xcode 8.3.3 and writing a XCUI test. I have the following: let address = XCUIApplication().buttons["URL"].value as! String Looking in the debugger, I can see the value is: If I set expectedURL = "\u{e2}auth.int....net" then it returns: If I set expectedURL = "auth.int....net" then it returns: How can I make the test assertion find the two strings to be equal? Tried the following, but it doesn't replace the "\u{e2}": let address = value.components(separatedBy: ",").first!

iOS UI Unit Testing (XCode7)

筅森魡賤 提交于 2020-01-05 14:20:15
问题 I'm a bit confused with the new UI Unit Testing scheme that apple released in their XCode7 Beta. I think it's an awesome idea, but I have a couple questions. this is one testing method I have... func testMetricsProperties() { // Used some of the metrics for testing for reference let app = XCUIApplication() app.scrollViews.descendantsMatchingType(.Unknown).containingType(.StaticText, identifier:"rim").childrenMatchingType(.Button).element.tap() app.textFields["_XCUI:Secure"].typeText("") app