1
votes

Following is my piece of code . After the launch of application I click on the submit button which shows me an alert.

After I click ok on the UIAlertViewController I move to the home screen , and then I want to swipe left on the home screen.

Any idea how this can be done.

Any help will be appreciated

  func testExample() {

            let app = XCUIApplication()
            app.buttons["Submit"].tap()
            app.alerts["Please enable bluetooth"].buttons["OK"].tap()
            XCUIDevice.sharedDevice().pressButton(XCUIDeviceButton.Home)

        }
1

1 Answers

0
votes

As of Xcode 8.0 you cannot interact with the UI outside of your application from the UI Test target. I filed a bug report http://www.openradar.me/radar?id=6180999608139776