Cotton code
33 lines · 1.7 KB · SwiftRaw
// The shell's card of another device asking to be let in (an invented Walk// Mac, -shell-card-seed YES) stands above Story and pushes it down: the// home's title and More, a scene's Back and its writing bar, and Read's Back// stay clear of it and can be touched, at the default size and the largest.// The card is never tapped.import XCTestfinal class StoryShellCardTests: StoryUITestCase {    @MainActor private func walk(_ extra: [String]) {        let app = StoryUI.launch(ShellCard.seed + extra)        let first = StoryUI.home(app)        ShellCard.fits(app)        ShellCard.clear(app, StoryUI.button(app, "The Long Platform"), "the home's title")        ShellCard.clear(app, StoryUI.button(app, "More"), "the home's More")        XCTAssertTrue(StoryUI.scrollTo(first, in: app), "the first scene can be reached")        first.tap()        let back = StoryUI.button(app, "Back to your scenes")        ShellCard.clear(app, back, "a scene's Back")        ShellCard.clear(app, StoryUI.button(app, "Send"), "the writing bar's Send")        back.tap()        let read = StoryUI.button(app, "Read")        XCTAssertTrue(read.waitForExistence(timeout: 10), "the home's Read")        read.tap()        ShellCard.clear(app, StoryUI.button(app, "Back to your scenes"), "Read's Back")    }    // RULE: with the card standing, the home's title and More, a scene's Back and Send, and Read's Back are clear of it and can be touched.    @MainActor func testTheCardPushesStoryDown() { walk([]) }    // RULE: at the largest text the card stays within half the screen with Refuse whole, and Story's top controls are clear of it.    @MainActor func testTheCardPushesStoryDownAtTheLargestText() { walk(StoryUI.largestText) }}