// // OnboardingUITests.swift // SeveredUITests // import XCTest final class OnboardingUITests: XCTestCase { override func setUpWithError() throws { continueAfterFailure = false } func testOnboardingWalksThroughPermissionToHome() throws { let app = XCUIApplication.launchSevered(onboardingCompleted: false) // Welcome step. app.staticTexts["Severed"].waitToAppear() app.buttons["onboardingContinueButton"].waitToAppear().tap() // Permission step: granting (mocked) lands on the Apps home screen. app.buttons["allowScreenTimeButton"].waitToAppear().tap() app.buttons["newRuleButton"].waitToAppear() XCTAssertTrue(app.staticTexts["Blocked Apps"].exists) } func testCompletedOnboardingIsSkipped() throws { let app = XCUIApplication.launchSevered(onboardingCompleted: true) app.buttons["newRuleButton"].waitToAppear() XCTAssertFalse(app.buttons["onboardingContinueButton"].exists) } }