diff --git a/.buildkite/commands/build-and-ui-test.sh b/.buildkite/commands/build-and-ui-test.sh index 911601541..592b8ed30 100755 --- a/.buildkite/commands/build-and-ui-test.sh +++ b/.buildkite/commands/build-and-ui-test.sh @@ -22,11 +22,11 @@ if [[ $TESTS_EXIT_STATUS -ne 0 ]]; then fi echo "--- 📦 Zipping test results" -cd build/results/ && zip -rq Simplenote.xcresult.zip Simplenote.xcresult && cd - +cd build/results/ && zip -rq SimplenoteUITests.xcresult.zip SimplenoteUITests.xcresult && cd - echo "--- 🚦 Report Tests Status" if [[ $TESTS_EXIT_STATUS -eq 0 ]]; then - echo "Unit Tests seems to have passed (exit code 0). All good 👍" + echo "UI Tests seems to have passed (exit code 0). All good 👍" else echo "The UI Tests, ran during the '🛠️ Build and Test' step above, have failed." echo "For more details about the failed tests, check the Buildkite annotation, the logs under the '🛠️ Build and Test' section and the \`.xcresult\` and test reports in Buildkite artifacts." diff --git a/SimplenoteUITests/EmailLogin.swift b/SimplenoteUITests/EmailLogin.swift index 5dae44b38..6fae2609a 100644 --- a/SimplenoteUITests/EmailLogin.swift +++ b/SimplenoteUITests/EmailLogin.swift @@ -5,7 +5,6 @@ class EmailLogin { class func open() { app.buttons[UID.Button.logIn].waitForIsHittable() app.buttons[UID.Button.logIn].tap() - app.buttons[UID.Button.logInWithEmail].waitForIsHittable() app.buttons[UID.Button.logInWithEmail].tap() } @@ -38,6 +37,7 @@ class EmailLogin { enterPassword(enteredValue: password) app.buttons[UID.Button.logIn].tap() handleSavePasswordPrompt() + waitForSpinnerToDisappear() } class func enterEmail(enteredValue: String) { @@ -60,4 +60,10 @@ class EmailLogin { app.buttons["Not Now"].tap() } } + + class func waitForSpinnerToDisappear() { + let predicate = NSPredicate(format: "exists == false && isHittable == false") + let expectation = XCTNSPredicateExpectation(predicate: predicate, object: app.staticTexts["In progress"]) + XCTWaiter().wait(for: [ expectation ], timeout: 10) + } } diff --git a/SimplenoteUITests/SimplenoteUITestsHistory.swift b/SimplenoteUITests/SimplenoteUITestsHistory.swift index 0266d4498..719f8ffa9 100644 --- a/SimplenoteUITests/SimplenoteUITestsHistory.swift +++ b/SimplenoteUITests/SimplenoteUITestsHistory.swift @@ -5,6 +5,7 @@ class SimplenoteUISmokeTestsHistory: XCTestCase { override class func setUp() { app.launch() + EmailLogin.handleSavePasswordPrompt() getToAllNotes() let _ = attemptLogOut() EmailLogin.open()