Skip to content

Commit 5cbbf96

Browse files
committed
Verify Plan selection is opened after confirming Domain selection
1 parent 8dfe93d commit 5cbbf96

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
@@ -156,6 +156,7 @@
156156
011F52C62A15413800B04114 /* FreeToPaidPlansDashboardCardHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52C52A15413800B04114 /* FreeToPaidPlansDashboardCardHelperTests.swift */; };
157157
011F52C82A16551A00B04114 /* FreeToPaidPlansCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52C72A16551A00B04114 /* FreeToPaidPlansCoordinator.swift */; };
158158
011F52C92A16551A00B04114 /* FreeToPaidPlansCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52C72A16551A00B04114 /* FreeToPaidPlansCoordinator.swift */; };
159+
011F52D82A1BECA200B04114 /* PlanSelectionScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011F52D72A1BECA200B04114 /* PlanSelectionScreen.swift */; };
159160
01281E9A2A0456CB00464F8F /* DomainsSuggestionsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01281E992A0456CB00464F8F /* DomainsSuggestionsScreen.swift */; };
160161
01281E9C2A051EEA00464F8F /* MenuNavigationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01281E9B2A051EEA00464F8F /* MenuNavigationTests.swift */; };
161162
01281E9D2A051EEA00464F8F /* MenuNavigationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01281E9B2A051EEA00464F8F /* MenuNavigationTests.swift */; };
@@ -5795,6 +5796,7 @@
57955796
011F52C22A153A3400B04114 /* FreeToPaidPlansDashboardCardHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FreeToPaidPlansDashboardCardHelper.swift; sourceTree = "<group>"; };
57965797
011F52C52A15413800B04114 /* FreeToPaidPlansDashboardCardHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FreeToPaidPlansDashboardCardHelperTests.swift; sourceTree = "<group>"; };
57975798
011F52C72A16551A00B04114 /* FreeToPaidPlansCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FreeToPaidPlansCoordinator.swift; sourceTree = "<group>"; };
5799+
011F52D72A1BECA200B04114 /* PlanSelectionScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlanSelectionScreen.swift; sourceTree = "<group>"; };
57985800
01281E992A0456CB00464F8F /* DomainsSuggestionsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DomainsSuggestionsScreen.swift; sourceTree = "<group>"; };
57995801
01281E9B2A051EEA00464F8F /* MenuNavigationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuNavigationTests.swift; sourceTree = "<group>"; };
58005802
0141929B2983F0A300CAEDB0 /* SupportConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SupportConfiguration.swift; sourceTree = "<group>"; };
@@ -11534,6 +11536,7 @@
1153411536
EAD08D0D29D45E23001A72F9 /* CommentsScreen.swift */,
1153511537
D82E087729EEB7AF0098F500 /* DomainsScreen.swift */,
1153611538
01281E992A0456CB00464F8F /* DomainsSuggestionsScreen.swift */,
11539+
011F52D72A1BECA200B04114 /* PlanSelectionScreen.swift */,
1153711540
);
1153811541
path = Screens;
1153911542
sourceTree = "<group>";
@@ -22705,6 +22708,7 @@
2270522708
3F107B1929B6F7E0009B3658 /* XCTestCase+Utils.swift in Sources */,
2270622709
3F2F855326FAF227000FCDA5 /* EditorPostSettings.swift in Sources */,
2270722710
3F2F856026FAF235000FCDA5 /* NotificationsScreen.swift in Sources */,
22711+
011F52D82A1BECA200B04114 /* PlanSelectionScreen.swift in Sources */,
2270822712
3F2F854026FAE9DC000FCDA5 /* BlockEditorScreen.swift in Sources */,
2270922713
3FB5C2B327059AC8007D0ECE /* XCUIElement+Scroll.swift in Sources */,
2271022714
3F2F854726FAED51000FCDA5 /* MediaPickerAlbumListScreen.swift in Sources */,

0 commit comments

Comments
 (0)