xcode-ui-testing

UI test fails when it types text into a text view when run by an Xcode bot

匆匆过客 提交于 2019-12-03 01:44:49
I have the following XCTest UI test that types text into a text view. let textView = app.textViews.elementBoundByIndex(0) textView.tap() textView.typeText("Hello world") When run as an Xcode bot it shows the following error for the typeText call. Assertion: UI Testing Failure - failed: Timed out waiting for key event to complete Interestingly, when I run it manually from the Xcode on the same computer the test passes. This test also passed in Xcode bot before upgrade to Xcode 7.1 / iOS 9.1. What can be the source of the problem? Here is an isolated demo with the UI test: https://github.com

XCTestCase: Wait for app to idle

假装没事ソ 提交于 2019-12-03 00:46:24
My UI-test fails because the test waits endless until the app idles. I can not see that there is anything happening in the background, like a loading spinner. It just occurs on one tab. All others tabs are tapable but the test fails on Screen 3. I I click on another tab after the test is caught on Screen 3 the test resumes and finishes successfully. Any ideas? - (void)testExample { XCUIElementQuery* tabBarsQuery = self.app.tabBars; [tabBarsQuery.buttons[@"Screen2"] tap]; [tabBarsQuery.buttons[@"Screen3"] tap]; [tabBarsQuery.buttons[@"Screen1"] tap]; [tabBarsQuery.buttons[@"Screen4"] tap]; }

Xcode UI Testing passwordless authentication

二次信任 提交于 2019-12-02 19:07:49
问题 How should I test my iPhone app's passwordless authentication? To sign up or log in, UI Testing in Xcode needs the random code that gets emailed to me. 回答1: I think you should run UI tests on stage/QA env and as result you can have some backdoor on stage env for UI tests, for example accept code 1111 for all users etc 回答2: Add your email account to the Mail app. Make sure that Push notifications are enabled. Set the notifications style for Mail to the Alerts style. In your UI Tests, add the

Is it possible to “toggle software keyboard” via the code in UI test?

≯℡__Kan透↙ 提交于 2019-12-02 18:20:14
I have UI tests which testing login functionality (and uses it to test other stuff), but sometimes when focus is changed from one field to another - the keyboard hides, and although the cursor is blinking in the field, I getting error on field.typeText - no focused fields to fill . Somehow I realized, that clicking on a Hardware -> Keyboard -> toggle software keyboard makes keyboard to persist on the screen, so test is works well. But I need to make it working on any testing device, on any developer machine, so I want to set this option programmatically without annoying "if test fails, go to …

Scroll until element is visible iOS UI Automation with xcode7

佐手、 提交于 2019-12-02 15:32:58
So with the new xcode update apple has revamped the way we do UI testing. In instruments we used java script function "isVisible" to determine if our targeted element is visible. I'm trying to replicate this in objective c but i can't seem to find the equivalent of this. I have a table view, a prototype cell with two labels on it. This prototype cell is reused 50 times lets say. I'm trying to scroll until the last cell is visible, i did this by doing this: if (![[[[[[XCUIApplication alloc] init].tables childrenMatchingType:XCUIElementTypeCell] matchingIdentifier:@"cell"] elementBoundByIndex:49

Xcode UI Testing passwordless authentication

我的梦境 提交于 2019-12-02 08:00:41
How should I test my iPhone app's passwordless authentication ? To sign up or log in, UI Testing in Xcode needs the random code that gets emailed to me. I think you should run UI tests on stage/QA env and as result you can have some backdoor on stage env for UI tests, for example accept code 1111 for all users etc Add your email account to the Mail app. Make sure that Push notifications are enabled. Set the notifications style for Mail to the Alerts style. In your UI Tests, add the UI interruption monitor to listen for the alert from Mail, which contains the random two-factor authentication

Possible to prevent XCode from envoking debugger after calling `XCUIApplication().terminate()`

允我心安 提交于 2019-12-01 18:03:13
I'm using UITest for testing an objective C app, using swift for the tests. XCode 7.3, sim 9.3 Every test case invokes XCUIApplication.launch(), which kills any running application by sending SIGKILL. Xcode treats this like a crash - invoking the debugger on main.m . To proceed with the test suite I just click the continue button in the debugger. After hitting continue, my log says: Message from debugger: Terminated due to signal 9 This situation is frustrating because it happens after 1/4 of my test cases. Causing me to lose focus on the document I'm editing and causing my test suite to hang

XCode 7 UI Testing: Dismissal of system-generated UIAlertController does not work

坚强是说给别人听的谎言 提交于 2019-12-01 10:11:57
I have a UI test which involves the dismissal of a system-generated UIAlertController . This alert asks the user for the permission to access the device's calendar. The objective of the test is the behaviour after a tap on the OK button: 1 let app = XCUIApplication() ... // this code was basically generated by the recording feature of XCode 7 2 app.alerts.elementBoundByIndex(0).collectionViews.buttons["OK"].tap() Now, instead of clicking the OK button, line 2 makes the simulator tap onto the first button which happens to be the Cancel button... Additionally, I found out that the testing

XCode 7 UI Testing: Dismissal of system-generated UIAlertController does not work

六月ゝ 毕业季﹏ 提交于 2019-12-01 08:52:03
问题 I have a UI test which involves the dismissal of a system-generated UIAlertController . This alert asks the user for the permission to access the device's calendar. The objective of the test is the behaviour after a tap on the OK button: 1 let app = XCUIApplication() ... // this code was basically generated by the recording feature of XCode 7 2 app.alerts.elementBoundByIndex(0).collectionViews.buttons["OK"].tap() Now, instead of clicking the OK button, line 2 makes the simulator tap onto the

iOS App failing when running UI Test in XCode 7.1.1

落花浮王杯 提交于 2019-12-01 06:55:50
I'm creating my first UI Test for my iOS app. Every time I run the test I get the error: UI Testing Failure - App accessibility isn't loaded (please see attached image) plus an error message in the debug console: dyld: Library not loaded: @rpath/RestKit.framework/RestKit Referenced from: /Users/Claus/Library/Developer/CoreSimulator/Devices/<code>/data/Containers/Bundle/Application/<code>/MyApp.app/MyApp Reason: image not found I would like to point out that the RestKit (installed using CocoaPods) library doesn't give any problem when I build and run my app on the simulator or real device. I