-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[UI Tests] - Add logout at launch capability #20891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| App Name | WordPress Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr20891-10992b6 | |
| Version | 22.6 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 10992b6 | |
| App Center Build | WPiOS - One-Offs #6011 |
|
| App Name | Jetpack Alpha |
|
| Configuration | Release-Alpha | |
| Build Number | pr20891-10992b6 | |
| Version | 22.6 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 10992b6 | |
| App Center Build | jetpack-installable-builds #5037 |
|
|
||
| XCTAssert(MySiteScreen.isLoaded()) | ||
| .verifyMySiteScreenLoaded() | ||
| .removeSelfHostedSite() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logOutDefaultWordPressComAccount works for WordPress accounts; needed to add this additional step for self-hosted sites for this work.
| // Unified email login/out | ||
| func testWPcomLoginLogout() throws { | ||
| let prologueScreen = try PrologueScreen().selectContinue() | ||
| try PrologueScreen().selectContinue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is not really necessary for this change but i decided to take advantage to standardize this since there was 1 test in this file that had to be updated to work with this new solution
| */ | ||
| func testEmailMagicLinkLogin() throws { | ||
| let welcomeScreen = try WelcomeScreen().selectLogin() | ||
| try WelcomeScreen().selectLogin() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the above test
| let prologueScreen = try PrologueScreen() | ||
|
|
||
| try prologueScreen | ||
| try PrologueScreen() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as the above test
tiagomar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice move using launchArguments to log, @jostnes!
The changes look good and the logs are clean again! 🎉


Description
Currently, there are a lot of "Failed to launch" errors being logged in Buildkite logs during UI test runs. This was a side effect of deleting the app after each test run.
In this PR, I've removed
removeApp()fromtearDown()and replaced it with a new launch argument-logout-at-launchthat will be called at the start of each test. This will reset the state to log out at the start of every test run.This change also comes with bonus speed improvements as the app is no longer removed after each test run (previously, the removal happened on the UI level). Below are screenshots to better visualize the before and after of the change:
Before change
(using the current latest trunk build for this comparison)
From

.xresults:From Buildkite (build):

iPhone total duration: 16m 24s
iPad total duration: 21m 18s
After change
From

.xresults:From Buildkite (build):

iPhone total duration: 13m 16s (⬇️ 3m 8s)
iPad total duration: 18m 17s (⬇️ 3m 1s)
Testing
Errors like
[22:34:12]: ▸ 2023-06-15 22:34:12.514 xcodebuild[1865:17594] iOSSimulator: 5C8F2C2C-3188-492D-B8B5-AF71DED82192: Failed to launch app with identifier: com.automattic.jetpack and options:should no longer be logged in Buildkite logs and the test results file. CI should be 🟢