App/UITests/StepNavigationTests.swift
26 lines · 803 bytes
5 symbols in this file
1import XCTest
2
3final class StepNavigationTests: XCTestCase {
4 override func setUp() {
5 continueAfterFailure = false
6 }
7
8 func testCupOpensAtStepOne() {
9 let app = XCUIApplication(); app.launch()
10 app.buttons["Cup"].tap()
11 XCTAssertEqual(app.staticTexts["step.index"].label, "1")
12 }
13
14 func testStepNeverAdvancesWithoutTheUserCompletingTheFold() {
15 let app = XCUIApplication(); app.launch()
16 app.buttons["Cup"].tap()
17 sleep(3)
18 XCTAssertEqual(app.staticTexts["step.index"].label, "1")
19 }
20
21 func testTheDiagramIsCaptionedWithTheStepsInstruction() {
22 let app = XCUIApplication(); app.launch()
23 app.buttons["Cup"].tap()
24 XCTAssertTrue(app.staticTexts["diagram.caption"].label.hasPrefix("Valley fold"))
25 }
26}