Created
February 7, 2017 15:14
-
-
Save HelloCore/1b4d7d26fd709d9099672a7a232730dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testTabButtonNumberButtonIncreased() { | |
let app = XCUIApplication() | |
let numberBtn = app.buttons["numberBtn"] | |
numberBtn.tap() | |
XCTAssertEqual(numberBtn.label, "1", "Score on button should increase") | |
} | |
func testPlayToGameOverFirstTime() { | |
let app = XCUIApplication() | |
let numberBtn = app.buttons["numberBtn"] | |
let fizzBtn = app.buttons["fizzBtn"] | |
let scoreLabel = app.staticTexts["scoreLabel"] | |
numberBtn.tap() | |
numberBtn.tap() | |
fizzBtn.tap() | |
fizzBtn.tap() | |
let isLabelExists = app.alerts["Game Over"].staticTexts["Your score is 3 and high score is 0"].exists | |
XCTAssertEqual(isLabelExists, true, "Label on alert shoule be updated") | |
app.alerts["Game Over"].buttons["Play Again"].tap() | |
XCTAssertEqual(scoreLabel.label, "Score: 0 | High Score: 3", "High score should be recorded") | |
XCTAssertEqual(numberBtn.label, "0", "Score on button should be reset after game over") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment