Skip to content

Commit

Permalink
test: Wait for app to stabilize after login
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Mar 4, 2025
1 parent fc16b5b commit 0b0b718
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions MailUITests/MailUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,16 @@ class MailUITests: XCTestCase {
let composeBodyView = app.webViews.firstMatch
_ = composeBodyView.waitForExistence(timeout: defaultTimeOut)

app.textFields.firstMatch.tap()
app.textFields.firstMatch.typeText(Env.testAccountEmail)
app.textFields.firstMatch.typeText("\n")
let laterButton = app.buttons[MailResourcesStrings.Localizable.buttonLater].firstMatch
if laterButton.waitForExistence(timeout: defaultTimeOut) {
laterButton.tap()
}

let toTextField = app.textFields.firstMatch
_ = toTextField.waitForExistence(timeout: defaultTimeOut)
toTextField.tap()
toTextField.typeText(Env.testAccountEmail)
toTextField.typeText("\n")

let subjectTextField = app.textFields[MailResourcesStrings.Localizable.subjectTitle].firstMatch
subjectTextField.tap()
Expand All @@ -237,7 +244,7 @@ class MailUITests: XCTestCase {
composeBodyView.tap()
composeBodyView.typeText(MailResourcesStrings.Localizable.aiPromptExample1)

wait(delay: 5)
wait(delay: 15)
}

func login() {
Expand All @@ -260,6 +267,8 @@ class MailUITests: XCTestCase {
passwordField.typeText(Env.testAccountPassword)
passwordField.typeText("\n")

wait(delay: 15)

let nowText = MailResourcesStrings.Localizable
.threadListHeaderLastUpdate(Date().formatted(.relative(presentation: .named)))
let refreshText = app.staticTexts[nowText].firstMatch
Expand Down Expand Up @@ -292,5 +301,7 @@ class MailUITests: XCTestCase {
let refreshText = app.staticTexts[nowText].firstMatch
_ = refreshText.waitForExistence(timeout: defaultTimeOut)
}

wait(delay: 15)
}
}

0 comments on commit 0b0b718

Please sign in to comment.