xcode-ui-testing

iOS App failing when running UI Test in XCode 7.1.1

牧云@^-^@ 提交于 2019-12-01 05:46:16
问题 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

Is it possible to open a screen directly in XCUITest?

放肆的年华 提交于 2019-12-01 05:11:46
I have 3 screens, lets say, Login Forgot Password Help screen By default the Login screen open when the app starts. The Forgot Password screen is shown when you click on the Forgot Password button, and Help Screen opens when the Help link is clicked. Can I somehow open the the Forgot Password Screen directly without going through the procedure of clicking the button using XCUITest ? I am suggesting something in the same lines as passing an adb intent to open a View directly. As far as I know, you can't go directly to the second screen using XCUITest Framework. Anyway, documentation states: UI

How to import my App module into MyAppUITests file?

China☆狼群 提交于 2019-12-01 02:35:42
This is my simple test case: import XCTest @testable import MyApp //it doesn't work because of this: class TabBarControllerTests: XCTestCase { override func setUp() { super.setUp() let defaults = NSUserDefaults.standardUserDefaults() defaults.setObject([], forKey: DBTabBarOrderedIndexesKey) //key is undefined, because of lack of my app module defaults.synchronize() continueAfterFailure = false XCUIApplication().launch() } func testIsOrderOfTabsSaved() { XCUIApplication().tabBars.buttons["Catering"].tap() //what next? } } Once I tap UITabBarItem I change the value of DBAppSettings.mode , so

xcode: Timestamped Event Matching Error: Failed to find matching element

守給你的承諾、 提交于 2019-12-01 02:03:14
I'm trying to record some XCUITesting functions. I get this error. Timestamped Event Matching Error: Failed to find matching element Is this an Xcode bug and/or issues with the complexity of my UI? I was having the same problem for a long time on a very complex app as well: The key is all in isAccessibilityElement being set to YES. UI testing and accessibility go hand-in-hand. The way I think about it is that the device needs to be able to interact with the element, since ostensibly, the user wouldn't be able to. I did this twice: In cellForRowAtIndexPath - cell.isAccessibilityElement = YES In

How to do automated UI testing for system button on XCode7?

不问归期 提交于 2019-11-30 23:57:41
My Storyboard has only one UI, and it has navigation bar with one UIBarButtonItem with System Item: Add. It also has another info UIButton. When doing UI testing in English everything works good without any problem. But if you switch the language to another one, it is always failed. Here is the testing code snippet: app.navigationBars["My Product"].buttons["Add"].tap() app.buttons["More Info"].tap() According to the error log, Xcode find it in another language. Here it is: Assertion Failure: UI Testing Failure - No matches found for "More Info" Button Query input was Button 0x7fa4ca65a1d0:

Performing UIAccessibilityCustomAction from UITests

徘徊边缘 提交于 2019-11-30 19:20:33
问题 I've got a subclass of UIView, let's say it's class DemoView: UIView { } which contains UILabel and UIButton. I needed to group it and add UIAccessibilityCustomAction so I've overriden the var accessibilityElements: [Any]? and used union to connect both elements. I've also assigned "Users" string to accessibilityLabel . From user perspective this works as it should, VoiceOver reads Users and then user can select custom action which is named Edit . Problem is that I don't know how can I fire

How to test UIImageView elements in iOS XCTest?

时间秒杀一切 提交于 2019-11-30 19:18:10
I'm trying to test my UIs using XCTest UI testing, and having troubles of testing UIImageViewsI have in my app (hit tests, presence etc). In the list of the XCUIElementType there is no such type, and when I look at the children of the superview my UIImageViews are not listed there for some reason eventhough I can see them on screen and in the UI inspector in the Xcode. Has anyone had this kind of problem? Joe Masilotti Assert the presence of an image by its accessibility label. Production Code let image = UIImage(named: "profile") let imageView = UIImageView(image: image) imageView

Swift UITesting error: Invalid escape sequence in literal. \\U201c

你。 提交于 2019-11-30 18:54:49
I am building an automation suite using Xcode 7 with swift. My app loads with the following Alert View: Allow "Light Alarm" to access your location while you use the app? When I record with UI Testing and click this alert I get the following code: app.alerts["Allow \U201cLight Alarm\U201c to access your location while you use the app?"] Note: The quotes has been replaced with \U201c However, when I try and compile I get the following error: "Invalid escape sequence in literal" Anyone know how to get round this? Martin R This seems to be a bug in Xcode when generating code during UI recording.

Make XCUIElement perform 3D touch for Automate UITest?

拟墨画扇 提交于 2019-11-30 18:34:57
I'm creating Automate UITest test case where I'd like to test the scenario when users make 3D Touch interaction with an element, then shows them Peek and Pop view. I can't seem to find any possible ways to simulate 3D Touch on an element and continue. Anyone has any idea about this, or 3D Touch is still unavailable to test? Thanks I was able to execute a force press / 3D Touch on an app icon on an iPhone 7 running iOS 10.3. It was not possible on 10.2. Objective-C First you have to declare the following or import this header typedef void (^CDUnknownBlockType)(void); @interface XCEventGenerator

How to do automated UI testing for system button on XCode7?

♀尐吖头ヾ 提交于 2019-11-30 18:10:35
问题 My Storyboard has only one UI, and it has navigation bar with one UIBarButtonItem with System Item: Add. It also has another info UIButton. When doing UI testing in English everything works good without any problem. But if you switch the language to another one, it is always failed. Here is the testing code snippet: app.navigationBars["My Product"].buttons["Add"].tap() app.buttons["More Info"].tap() According to the error log, Xcode find it in another language. Here it is: Assertion Failure: