Various reliability tweaks for the UI and integration tests.

This commit is contained in:
Stefan Ceriu
2024-04-01 12:27:54 +03:00
parent 9b8c35a709
commit cc4787b99f
2 changed files with 7 additions and 1 deletions

View File

@@ -66,9 +66,12 @@ extension XCUIApplication {
currentTestCase.expectation(for: doesNotExistPredicate, evaluatedWith: usernameTextField)
currentTestCase.waitForExpectations(timeout: 300.0)
// This might come in a different order, wait for both.
// Handle the password saving dialog
let savePasswordButton = buttons["Save Password"]
if savePasswordButton.waitForExistence(timeout: 10.0) {
// Tapping the sheet button while animating upwards fails. Wait for it to settle
sleep(1)
savePasswordButton.tap()
}

View File

@@ -40,6 +40,9 @@ class AppLockSetupUITests: XCTestCase {
func testCreateFlow() async throws {
app = Application.launch(.appLockSetupFlow)
// Wait for the keyboard to push the sheet up before snapshotting
try await Task.sleep(for: .seconds(0.5))
// Create PIN screen.
try await app.assertScreenshot(.appLockSetupFlow, step: Step.createPIN)