Skip to content

Instantly share code, notes, and snippets.

@boek
Last active October 12, 2017 19:33
Show Gist options
  • Save boek/435e9927c29c4e5c380ef87559e222dd to your computer and use it in GitHub Desktop.
Save boek/435e9927c29c4e5c380ef87559e222dd to your computer and use it in GitHub Desktop.
func test08PasteAndGo() {
let app = XCUIApplication()
// Inject a string into clipboard
let clipboardString = "Hello world"
UIPasteboard.general.string = clipboardString
// Enter 'mozilla' on the search field
let searchOrEnterAddressTextField = app.textFields["URLBar.urlText"]
searchOrEnterAddressTextField.typeText("mozilla.org\n")
// Check the correct site is reached
waitForValueContains(element: searchOrEnterAddressTextField, value: "https://www.mozilla.org/")
// Tap URL field, check for paste & go menu
searchOrEnterAddressTextField.tap()
searchOrEnterAddressTextField.press(forDuration: 1.5)
expectation(for: NSPredicate(format: "count > 0"), evaluatedWith: app.menuItems, handler: nil)
waitForExpectations(timeout: 10, handler: nil)
app.menuItems.element(boundBy: 3).tap()
snapshot("08PasteAndGo")
}
@5y
Copy link

5y commented Oct 12, 2017

image

@5y
Copy link

5y commented Oct 12, 2017

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment