Skip to content

Commit

Permalink
Merge pull request wordpress-mobile#21054 from wordpress-mobile/reduc…
Browse files Browse the repository at this point in the history
…e-setup-time

[UI Tests] - Removing unnecessary flows to speed up tests
  • Loading branch information
pachlava authored Jul 12, 2023
2 parents 79071b9 + ddec037 commit 9be6a75
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 0 additions & 2 deletions WordPress/UITests/Tests/MainNavigationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class MainNavigationTests: XCTestCase {
email: WPUITestCredentials.testWPcomUserEmail,
password: WPUITestCredentials.testWPcomPassword
)
try TabNavComponent()
.goToMySiteScreen()
.goToMenu()
}

Expand Down
5 changes: 2 additions & 3 deletions WordPress/UITests/Tests/ReaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ class ReaderTests: XCTestCase {
email: WPUITestCredentials.testWPcomUserEmail,
password: WPUITestCredentials.testWPcomPassword
)
try EditorFlow
.goToMySiteScreen()
.tabBar.goToReaderScreen()
try TabNavComponent()
.goToReaderScreen()
}

override func tearDownWithError() throws {
Expand Down
1 change: 0 additions & 1 deletion WordPress/UITests/Tests/StatsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class StatsTests: XCTestCase {
email: WPUITestCredentials.testWPcomUserEmail,
password: WPUITestCredentials.testWPcomPassword
)
try MySiteScreen()
.goToMenu()
.goToStatsScreen()
.switchTo(mode: .insights)
Expand Down
30 changes: 18 additions & 12 deletions WordPress/UITestsFoundation/Screens/Login/LoginEpilogueScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,29 +65,35 @@ public class LoginEpilogueScreen: ScreenObject {
}

private func dismissQuickStartPromptIfNeeded() throws {
try XCTContext.runActivity(named: "Dismiss quick start prompt if needed.") { _ in
guard QuickStartPromptScreen.isLoaded() else { return }

XCTContext.runActivity(named: "Dismiss quick start prompt if needed.") { _ in
Logger.log(message: "Dismising quick start prompt...", event: .i)
_ = try QuickStartPromptScreen().selectNoThanks()
do {
_ = try QuickStartPromptScreen().selectNoThanks()
} catch {
return
}
}
}

private func dismissOnboardingQuestionsPromptIfNeeded() throws {
try XCTContext.runActivity(named: "Dismiss onboarding questions prompt if needed.") { _ in
guard OnboardingQuestionsPromptScreen.isLoaded() else { return }

XCTContext.runActivity(named: "Dismiss onboarding questions prompt if needed.") { _ in
Logger.log(message: "Dismissing onboarding questions prompt...", event: .i)
_ = try OnboardingQuestionsPromptScreen().selectSkip()
do {
_ = try OnboardingQuestionsPromptScreen().selectSkip()
} catch {
return
}
}
}

private func dismissFeatureIntroductionIfNeeded() throws {
try XCTContext.runActivity(named: "Dismiss feature introduction screen if needed.") { _ in
guard FeatureIntroductionScreen.isLoaded() else { return }

XCTContext.runActivity(named: "Dismiss feature introduction screen if needed.") { _ in
Logger.log(message: "Dismissing feature introduction screen...", event: .i)
_ = try FeatureIntroductionScreen().dismiss()
do {
_ = try FeatureIntroductionScreen().dismiss()
} catch {
return
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public class PasswordScreen: ScreenObject {
public func proceedWithValidPassword() throws -> LoginEpilogueScreen {
try tryProceed(password: "pw")

app.dismissSavePasswordPrompt()

return try LoginEpilogueScreen()
}

Expand Down

0 comments on commit 9be6a75

Please sign in to comment.