-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,28 +10,26 @@ class LoginTests: XCTestCase { | |
|
|
||
| override func tearDownWithError() throws { | ||
| takeScreenshotOfFailedTest() | ||
| removeApp() | ||
| } | ||
|
|
||
| // Unified email login/out | ||
| func testWPcomLoginLogout() throws { | ||
| let prologueScreen = try PrologueScreen().selectContinue() | ||
| try PrologueScreen().selectContinue() | ||
| .proceedWith(email: WPUITestCredentials.testWPcomUserEmail) | ||
| .proceedWithValidPassword() | ||
| .verifyEpilogueDisplays(username: WPUITestCredentials.testWPcomUsername, siteUrl: WPUITestCredentials.testWPcomSitePrimaryAddress) | ||
| .continueWithSelectedSite() | ||
| .dismissNotificationAlertIfNeeded() | ||
| .tabBar.goToMeScreen() | ||
| .logoutToPrologue() | ||
|
|
||
| XCTAssert(prologueScreen.isLoaded) | ||
| .verifyPrologueScreenLoaded() | ||
| } | ||
|
|
||
| /** | ||
| This test opens safari to trigger the mocked magic link redirect | ||
| */ | ||
| func testEmailMagicLinkLogin() throws { | ||
| let welcomeScreen = try WelcomeScreen().selectLogin() | ||
| try WelcomeScreen().selectLogin() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as the above test |
||
| .selectEmailLogin() | ||
| .proceedWith(email: WPUITestCredentials.testWPcomUserEmail) | ||
| .proceedWithLink() | ||
|
|
@@ -40,26 +38,23 @@ class LoginTests: XCTestCase { | |
| .dismissNotificationAlertIfNeeded() | ||
| .tabBar.goToMeScreen() | ||
| .logout() | ||
|
|
||
| XCTAssert(welcomeScreen.isLoaded) | ||
| .verifyWelcomeScreenLoaded() | ||
| } | ||
|
|
||
| // Unified self hosted login/out | ||
| func testSelfHostedLoginLogout() throws { | ||
| let prologueScreen = try PrologueScreen() | ||
|
|
||
| try prologueScreen | ||
| try PrologueScreen() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as the above test |
||
| .selectSiteAddress() | ||
| .proceedWith(siteUrl: WPUITestCredentials.selfHostedSiteAddress) | ||
| .proceedWithSelfHosted(username: WPUITestCredentials.selfHostedUsername, password: WPUITestCredentials.selfHostedPassword) | ||
| .removeSelfHostedSite() | ||
|
|
||
| XCTAssert(prologueScreen.isLoaded) | ||
| try PrologueScreen() | ||
| .verifyPrologueScreenLoaded() | ||
| } | ||
|
|
||
| // Unified WordPress.com email login failure due to incorrect password | ||
| func testWPcomInvalidPassword() throws { | ||
| _ = try PrologueScreen().selectContinue() | ||
| try PrologueScreen().selectContinue() | ||
| .proceedWith(email: WPUITestCredentials.testWPcomUserEmail) | ||
| .proceedWithInvalidPassword() | ||
| .verifyLoginError() | ||
|
|
@@ -84,7 +79,7 @@ class LoginTests: XCTestCase { | |
|
|
||
| // Login flow returns MySites modal, which needs to be closed. | ||
| .closeModal() | ||
|
|
||
| XCTAssert(MySiteScreen.isLoaded()) | ||
| .verifyMySiteScreenLoaded() | ||
| .removeSelfHostedSite() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
| } | ||
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