import XCTest /// Standard Settings on iPhone: the Support Bucksley rows are all free (feedback, share, free /// technical support, more apps) and nothing in Settings asks for money. @MainActor final class BucksleyPhoneUITests: XCTestCase { override func setUp() { super.setUp() continueAfterFailure = false } func testSupportSectionIsFree() throws { let app = makeApp(screen: "settings") app.launch() XCTAssertTrue(app.buttons["settings.theme.afterhours"].waitForExistence(timeout: 10)) for _ in 0..<6 where !(app.buttons["settings.apps"].exists && app.buttons["settings.apps"].isHittable) { app.swipeUp() } for id in ["settings.technicalSupport", "settings.review", "settings.share", "settings.apps"] { XCTAssertTrue(app.buttons[id].exists, id) } XCTAssertFalse(app.buttons["settings.tip"].exists) let money = NSPredicate(format: "label CONTAINS[c] 'tip' OR label CONTAINS '$' OR label CONTAINS[c] 'coffee' OR label CONTAINS[c] 'paid'") XCTAssertEqual(app.staticTexts.containing(money).count, 0) capture("Support Bucksley section", app) } private func makeApp(screen: String) -> XCUIApplication { let app = XCUIApplication() app.launchEnvironment["BUCKSLEY_SCREEN"] = screen app.launchEnvironment["BUCKSLEY_NO_ICLOUD"] = "1" return app } private func capture(_ title: String, _ app: XCUIApplication) { let attachment = XCTAttachment(screenshot: app.screenshot()) attachment.name = title attachment.lifetime = .keepAlways add(attachment) } }