Scroll until element is visible iOS UI Automation with Xcode 7

You should extend the XCUIElement’s method list. The first method (scrollToElement:) will be called on the tableView, the second extension method helps you decide if the element is on the main window. extension XCUIElement { func scrollToElement(element: XCUIElement) { while !element.visible() { swipeUp() } } func visible() -> Bool { guard self.exists && !CGRectIsEmpty(self.frame) else … Read more

‘NSInternalInconsistencyException’ when running UITesting with Xcode 7

I had a similar issue and my mistake was trying to use UI testing code in a regular test target. Once I made a new target, starting with “iOS UI Testing Bundle” and copied the code there the error went away. Here’s the thread that pointed me in the right direction: https://twitter.com/punksomething/status/609505357132500993 “Yeah, I was … Read more

How to select a picker view item in an iOS UI test in Xcode?

As noted in the question’s update, Xcode 7 Beta 6 added support for interacting with pickers. The newly added method -adjustToPickerWheelValue: should be used to select items on a UIPickerView. let app = XCUIApplication() app.launch() app.pickerWheels.element.adjustToPickerWheelValue(“Yellow”) Here’s a GitHub repo with a working example. And some more information in a blog post I wrote.

How to detect if iOS app is running in UI Testing mode

I’ve been researching this myself and came across this question. I ended up going with @LironYahdav’s first workaround: In your UI test: – (void)setUp { [super setUp]; XCUIApplication *app = [[XCUIApplication alloc] init]; app.launchEnvironment = @{@”isUITest”: @YES}; [app launch]; } In your app: NSDictionary *environment = [[NSProcessInfo processInfo] environment]; if (environment[@”isUITest”]) { // Running in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)