Onboarding flow coordinator and FTUE changes (#2578)

Fixes #2595, fixes #2594, fixes #2593, fixes #2592, fixes #2591
This commit is contained in:
Stefan Ceriu
2024-03-21 14:01:23 +02:00
committed by GitHub
parent ad70ea96e8
commit fd0eb78dbe
176 changed files with 1886 additions and 912 deletions

View File

@@ -19,7 +19,14 @@ import XCTest
enum Application {
@discardableResult static func launch() -> XCUIApplication {
let app = XCUIApplication()
var launchEnvironment = [
"IS_RUNNING_INTEGRATION_TESTS": "1"
]
app.launchEnvironment = launchEnvironment
app.launch()
return app
}
}

View File

@@ -65,33 +65,13 @@ extension XCUIApplication {
// Wait for login to finish
currentTestCase.expectation(for: doesNotExistPredicate, evaluatedWith: usernameTextField)
currentTestCase.waitForExpectations(timeout: 300.0)
// Handle analytics prompt screen
if staticTexts[A11yIdentifiers.analyticsPromptScreen.title].waitForExistence(timeout: 10.0) {
// Wait for login and then handle save password sheet
let savePasswordButton = buttons["Save Password"]
if savePasswordButton.waitForExistence(timeout: 10.0) {
savePasswordButton.tap()
}
let enableButton = buttons[A11yIdentifiers.analyticsPromptScreen.enable]
XCTAssertTrue(enableButton.waitForExistence(timeout: 10.0))
enableButton.tap()
}
// This might come in a different order, wait for both.
let savePasswordButton = buttons["Save Password"]
if savePasswordButton.waitForExistence(timeout: 10.0) {
savePasswordButton.tap()
}
// Handle the notifications permission alert https://stackoverflow.com/a/58171074/730924
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let notificationAlertDeclineButton = springboard.buttons.element(boundBy: 0)
if notificationAlertDeclineButton.waitForExistence(timeout: 10.0) {
notificationAlertDeclineButton.tap()
}
// Migration screen may be shown as an overlay.
// if that pops up soon enough, we just let that happen and wait
let message = staticTexts[A11yIdentifiers.migrationScreen.message]