Skip to content

Commit 609630a

Browse files
committed
settings icon moved to menu
1 parent bbe702a commit 609630a

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

WooCommerce/UITestsFoundation/Screens/Menu/MenuScreen.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ public final class MenuScreen: ScreenObject {
2323
app.staticTexts["Reviews"].tap()
2424
return try ReviewsScreen()
2525
}
26+
27+
@discardableResult
28+
public func openSettingsPane() throws -> SettingsScreen {
29+
app.buttons["dashboard-settings-button"].tap()
30+
return try SettingsScreen()
31+
}
2632
}

WooCommerce/UITestsFoundation/Screens/MyStore/MyStoreScreen.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ public final class MyStoreScreen: ScreenObject {
88
// TODO: Remove force `try` once `ScreenObject` migration is completed
99
public let periodStatsTable = try! PeriodStatsTable()
1010

11-
private let settingsButtonGetter: (XCUIApplication) -> XCUIElement = {
12-
$0.buttons["dashboard-settings-button"]
13-
}
14-
15-
private var settingsButton: XCUIElement { settingsButtonGetter(app) }
16-
1711
static var isVisible: Bool {
1812
(try? MyStoreScreen().isLoaded) ?? false
1913
}
2014

2115
public init(app: XCUIApplication = XCUIApplication()) throws {
2216
try super.init(
23-
expectedElementGetters: [settingsButtonGetter],
17+
expectedElementGetters: [ { $0.staticTexts["Your WooCommerce Store"] }],
2418
app: app
2519
)
2620
}
@@ -33,10 +27,4 @@ public final class MyStoreScreen: ScreenObject {
3327
topBannerCloseButton.tap()
3428
return self
3529
}
36-
37-
@discardableResult
38-
public func openSettingsPane() throws -> SettingsScreen {
39-
settingsButton.tap()
40-
return try SettingsScreen()
41-
}
4230
}

WooCommerce/WooCommerceUITests/Tests/LoginTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ final class LoginTests: XCTestCase {
2222
.continueWithSelectedSite()
2323

2424
// Log out
25+
try TabNavComponent()
26+
.goToMenuScreen()
2527
.openSettingsPane()
2628
.verifySelectedStoreDisplays(storeName: TestCredentials.storeName, siteUrl: TestCredentials.siteUrl)
2729
.logOut()
@@ -38,6 +40,8 @@ final class LoginTests: XCTestCase {
3840
.continueWithSelectedSite()
3941

4042
// Log out
43+
try TabNavComponent()
44+
.goToMenuScreen()
4145
.openSettingsPane()
4246
.verifySelectedStoreDisplays(storeName: TestCredentials.storeName, siteUrl: TestCredentials.siteUrl)
4347
.logOut()

0 commit comments

Comments
 (0)