Skip to content

Commit

Permalink
add check that the shared page is fully displayed (mozilla-mobile#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
No-Jun Park authored Aug 30, 2017
1 parent 01112e4 commit 51dc054
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions focus-ios/XCUITest/OpenInFocusTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ class OpenInFocusTest : BaseTestCase {
waitforExistence(element: app.textFields["URLBar.urlText"]) // wait for app.label
let sharedExtName = app.label.contains("Klar") ? "Firefox Klar" : "Firefox Focus" as String

XCUIDevice.shared().press(.home)
let springboard = XCUIApplication(privateWithPath: nil, bundleID: "com.apple.springboard")!
waitforExistence(element: springboard.scrollViews.otherElements.icons[sharedExtName])

let safariApp = XCUIApplication(privateWithPath: nil, bundleID: "com.apple.mobilesafari")!
safariApp.launchArguments = ["-u", "https://www.mozilla.org/en-US/"]
safariApp.launch()

safariApp.buttons["Share"].tap()
safariApp.buttons["More"].tap()

safariApp.tables.cells.containing(.staticText, identifier:sharedExtName).children(matching: .switch).matching(identifier: sharedExtName).element(boundBy: 0).tap()
safariApp.navigationBars["Activities"].buttons["Done"].tap()
safariApp.buttons[sharedExtName].tap()
Expand All @@ -36,5 +39,6 @@ class OpenInFocusTest : BaseTestCase {
let addressBarField = focusApp.textFields["URLBar.urlText"]

waitForValueContains(element: addressBarField, value: "https://www.mozilla.org/en-US/")
waitforExistence(element: focusApp.buttons["ERASE"]) // check site is fully loaded
}
}

0 comments on commit 51dc054

Please sign in to comment.