Skip to content

Commit 183d1aa

Browse files
committed
Verify Plan selection is opened after confirming Domain selection
1 parent 77bd11a commit 183d1aa

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

API-Mocks/WordPressMocks/src/main/assets/mocks/mappings/wpcom/me/rest_v11_me_shopping_cart_post.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"request": {
3-
"urlPattern": "/rest/v1.1/me/shopping-cart/*",
3+
"urlPattern": "/rest/v1.1/me/shopping-cart/.*",
44
"method": "POST"
55
},
66
"response": {

WordPress/UITests/Tests/DashboardTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import UITestsFoundation
22
import XCTest
33

44
class DashboardTests: XCTestCase {
5-
65
override func setUpWithError() throws {
76
setUpTestSuite()
87

@@ -26,6 +25,7 @@ class DashboardTests: XCTestCase {
2625
.tapFreeToPaidPlansCard()
2726
.verifyDomainsSuggestionsScreenLoaded()
2827
.selectDomain()
29-
.confirmDomainSelection()
28+
.goToPlanSelection()
29+
.verifyPlanSelectionScreenLoaded()
3030
}
3131
}

WordPress/UITestsFoundation/Screens/DomainsSuggestionsScreen.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public class DomainsSuggestionsScreen: ScreenObject {
3737
}
3838

3939
@discardableResult
40-
public func confirmDomainSelection() throws -> Self {
40+
public func goToPlanSelection() throws -> PlanSelectionScreen {
4141
app.buttons["Select domain"].tap()
42-
return self
42+
return try PlanSelectionScreen()
4343
}
4444
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import ScreenObject
2+
import XCTest
3+
4+
public class PlanSelectionScreen: ScreenObject {
5+
private let webViewGetter: (XCUIApplication) -> XCUIElement = {
6+
$0.webViews.firstMatch
7+
}
8+
9+
public init(app: XCUIApplication = XCUIApplication()) throws {
10+
try super.init(
11+
expectedElementGetters: [ webViewGetter ],
12+
app: app,
13+
waitTimeout: 7
14+
)
15+
}
16+
17+
public static func isLoaded() -> Bool {
18+
(try? PlanSelectionScreen().isLoaded) ?? false
19+
}
20+
21+
@discardableResult
22+
public func verifyPlanSelectionScreenLoaded() -> Self {
23+
XCTAssertTrue(PlanSelectionScreen.isLoaded(), "\"Plan Selection\" screen isn't loaded.")
24+
return self
25+
}
26+
}

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
011F52C92A16551A00B04114 /* FreeToPaidPlansCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52C72A16551A00B04114 /* FreeToPaidPlansCoordinator.swift */; };
159159
011F52D32A1B84FF00B04114 /* PlansTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52D22A1B84FF00B04114 /* PlansTracker.swift */; };
160160
011F52D42A1B84FF00B04114 /* PlansTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52D22A1B84FF00B04114 /* PlansTracker.swift */; };
161+
011F52D82A1BECA200B04114 /* PlanSelectionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52D72A1BECA200B04114 /* PlanSelectionScreen.swift */; };
161162
01281E9A2A0456CB00464F8F /* DomainsSuggestionsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01281E992A0456CB00464F8F /* DomainsSuggestionsScreen.swift */; };
162163
01281E9C2A051EEA00464F8F /* MenuNavigationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01281E9B2A051EEA00464F8F /* MenuNavigationTests.swift */; };
163164
01281E9D2A051EEA00464F8F /* MenuNavigationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01281E9B2A051EEA00464F8F /* MenuNavigationTests.swift */; };
@@ -5798,6 +5799,7 @@
57985799
011F52C52A15413800B04114 /* FreeToPaidPlansDashboardCardHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FreeToPaidPlansDashboardCardHelperTests.swift; sourceTree = "<group>"; };
57995800
011F52C72A16551A00B04114 /* FreeToPaidPlansCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FreeToPaidPlansCoordinator.swift; sourceTree = "<group>"; };
58005801
011F52D22A1B84FF00B04114 /* PlansTracker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlansTracker.swift; sourceTree = "<group>"; };
5802+
011F52D72A1BECA200B04114 /* PlanSelectionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlanSelectionScreen.swift; sourceTree = "<group>"; };
58015803
01281E992A0456CB00464F8F /* DomainsSuggestionsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainsSuggestionsScreen.swift; sourceTree = "<group>"; };
58025804
01281E9B2A051EEA00464F8F /* MenuNavigationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuNavigationTests.swift; sourceTree = "<group>"; };
58035805
0141929B2983F0A300CAEDB0 /* SupportConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportConfiguration.swift; sourceTree = "<group>"; };
@@ -11538,6 +11540,7 @@
1153811540
EAD08D0D29D45E23001A72F9 /* CommentsScreen.swift */,
1153911541
D82E087729EEB7AF0098F500 /* DomainsScreen.swift */,
1154011542
01281E992A0456CB00464F8F /* DomainsSuggestionsScreen.swift */,
11543+
011F52D72A1BECA200B04114 /* PlanSelectionScreen.swift */,
1154111544
);
1154211545
path = Screens;
1154311546
sourceTree = "<group>";
@@ -22721,6 +22724,7 @@
2272122724
3F107B1929B6F7E0009B3658 /* XCTestCase+Utils.swift in Sources */,
2272222725
3F2F855326FAF227000FCDA5 /* EditorPostSettings.swift in Sources */,
2272322726
3F2F856026FAF235000FCDA5 /* NotificationsScreen.swift in Sources */,
22727+
011F52D82A1BECA200B04114 /* PlanSelectionScreen.swift in Sources */,
2272422728
3F2F854026FAE9DC000FCDA5 /* BlockEditorScreen.swift in Sources */,
2272522729
3FB5C2B327059AC8007D0ECE /* XCUIElement+Scroll.swift in Sources */,
2272622730
3F2F854726FAED51000FCDA5 /* MediaPickerAlbumListScreen.swift in Sources */,

0 commit comments

Comments
 (0)