// At the phone's largest text Story's pieces stay whole: a scene's writing // bar keeps each chip on one line (they go onto a second row, as Android's // 2bace61a5c), and a face of the cast stands wide enough for its name's // longest word, never broken between its letters. import XCTest final class StoryLargeTextTests: StoryUITestCase { // RULE: at the largest text the writing bar's chips are whole (wider than tall) and Send stays on screen. @MainActor func testTheWritingBarsChipsStayWholeAtTheLargestText() throws { let app = StoryUI.launch(StoryUI.largestText) try skipUnderTheShellsCard(app) StoryUI.home(app).tap() let send = StoryUI.button(app, "Send") XCTAssertTrue(send.waitForExistence(timeout: 10), "the scene opened") for name in ["Action", "Note"] { let chip = StoryUI.button(app, name) XCTAssertTrue(chip.exists, "\(name) is in the bar") XCTAssertGreaterThan(chip.frame.width, chip.frame.height, "\(name) stands on one line, not a column of letters") } let speaker = app.descendants(matching: .any).matching(NSPredicate(format: "label == %@", "Next line")).firstMatch XCTAssertGreaterThan(speaker.frame.width, speaker.frame.height, "who speaks stands on one line") XCTAssertTrue(send.isHittable && StoryUI.inside(send, app, top: 0, bottom: 0), "Send stands on screen") XCTAssertTrue(StoryUI.button(app, "Dictate").isHittable, "the mic stands on screen") } // RULE: at the largest text a face of the cast is as wide as its name's longest word. @MainActor func testTheCastsNamesAreWholeAtTheLargestText() { let app = StoryUI.launch(StoryUI.largestText) _ = StoryUI.home(app) let bina = app.buttons.matching(NSPredicate(format: "label BEGINSWITH %@", "Bina,")).firstMatch XCTAssertTrue(bina.waitForExistence(timeout: 5), "Bina is in the cast") // Four letters of IBM Plex Mono at the largest caption size are wider than the 70-point face. XCTAssertGreaterThan(bina.frame.width, 80, "Bina's column holds her name on one line") } }