Skip to content

Commit 51dc054

Browse files
author
No-Jun Park
authored
add check that the shared page is fully displayed (mozilla-mobile#377)
1 parent 01112e4 commit 51dc054

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

focus-ios/XCUITest/OpenInFocusTest.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ class OpenInFocusTest : BaseTestCase {
2121
waitforExistence(element: app.textFields["URLBar.urlText"]) // wait for app.label
2222
let sharedExtName = app.label.contains("Klar") ? "Firefox Klar" : "Firefox Focus" as String
2323

24+
XCUIDevice.shared().press(.home)
25+
let springboard = XCUIApplication(privateWithPath: nil, bundleID: "com.apple.springboard")!
26+
waitforExistence(element: springboard.scrollViews.otherElements.icons[sharedExtName])
27+
2428
let safariApp = XCUIApplication(privateWithPath: nil, bundleID: "com.apple.mobilesafari")!
2529
safariApp.launchArguments = ["-u", "https://www.mozilla.org/en-US/"]
2630
safariApp.launch()
27-
31+
2832
safariApp.buttons["Share"].tap()
2933
safariApp.buttons["More"].tap()
30-
3134
safariApp.tables.cells.containing(.staticText, identifier:sharedExtName).children(matching: .switch).matching(identifier: sharedExtName).element(boundBy: 0).tap()
3235
safariApp.navigationBars["Activities"].buttons["Done"].tap()
3336
safariApp.buttons[sharedExtName].tap()
@@ -36,5 +39,6 @@ class OpenInFocusTest : BaseTestCase {
3639
let addressBarField = focusApp.textFields["URLBar.urlText"]
3740

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

0 commit comments

Comments
 (0)