Cotton code
26 lines · 1.2 KB · SwiftRaw
// Cotton Data Dev on a simulator, over the invented dev account signed in there only. Nothing here is anyone's real// database. The app only looks: no step here can change a row.import XCTestfinal class DataOpenTests: XCTestCase {    /// The app opens on its first screen (what it is, and Start) or, once started, on Tables with its four places at    /// the foot; Start leads to Tables.    @MainActor func testItOpensOnFirstOpenOrTables() {        let app = XCUIApplication()        app.launch()        let start = app.buttons["data-start"]        let tables = app.buttons["data-tab-tables"]        let deadline = Date().addingTimeInterval(90)        while Date() < deadline, !start.exists, !tables.exists { _ = tables.waitForExistence(timeout: 1) }        XCTAssertTrue(start.exists || tables.exists, "neither the first screen nor Tables stood")        if start.exists, !tables.exists {            start.tap()            XCTAssertTrue(tables.waitForExistence(timeout: 20))        }        for place in ["tables", "lately", "search", "you"] {            XCTAssertTrue(app.buttons["data-tab-\(place)"].exists, "the \(place) tab stands")        }        XCTAssertTrue(tables.isSelected)    }}