Skip to content

Commit

Permalink
Update UI Test helper for Swift 3 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
joemasilotti committed Oct 20, 2016
1 parent b8fa401 commit 019ba04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion UITests/UITestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class UITestCase: XCTestCase {
app.terminate()
}

func waitForElementToAppear(element: XCUIElement, file: String = #file, line: UInt = #line) {
func waitForElementToAppear(_ element: XCUIElement, file: String = #file, line: UInt = #line) {
let existsPredicate = NSPredicate(format: "exists == true")
expectation(for: existsPredicate, evaluatedWith: element, handler: nil)

Expand Down
6 changes: 3 additions & 3 deletions UITests/UITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class UITests: UITestCase {
app.buttons["More Info"].tap()

let volleyballLabel = app.staticTexts["Volleyball"]
waitForElementToAppear(element: volleyballLabel)
waitForElementToAppear(volleyballLabel)
XCTAssert(volleyballLabel.exists)
}

Expand All @@ -131,13 +131,13 @@ class UITests: UITestCase {
app.buttons["More Info"].tap()

let disambiguationLink = app.links["Volleyball (disambiguation)"]
waitForElementToAppear(element: disambiguationLink)
waitForElementToAppear(disambiguationLink)
XCTAssert(disambiguationLink.exists)

disambiguationLink.tap()

let volleyballLink = app.links["Volleyball (ball)"]
waitForElementToAppear(element: volleyballLink)
waitForElementToAppear(volleyballLink)
XCTAssert(volleyballLink.exists)
}

Expand Down

0 comments on commit 019ba04

Please sign in to comment.