File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Classes/ViewRelated/Orders/Order Creation/StatusSection
UITestsFoundation/Screens/Orders Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ struct OrderStatusSection: View {
3535 . fixedSize ( horizontal: true , vertical: true )
3636 . padding ( . trailing, - Layout. linkButtonTrailingPadding) // remove trailing padding to align button title to the side
3737 . accessibilityLabel ( Text ( Localization . editButtonAccessibilityLabel) )
38+ . accessibilityIdentifier ( " order-status-section-edit-button " )
3839 . sheet ( isPresented: $viewModel. shouldShowOrderStatusList) {
3940 OrderStatusList ( siteID: viewModel. siteID, status: viewModel. currentOrderStatus) { newStatus in
4041 viewModel. updateOrderStatus ( newStatus: newStatus)
Original file line number Diff line number Diff line change @@ -7,18 +7,36 @@ public final class NewOrderScreen: ScreenObject {
77 $0. buttons [ " new-order-create-button " ]
88 }
99
10+ private let orderStatusEditButtonGetter : ( XCUIApplication ) -> XCUIElement = {
11+ $0. buttons [ " order-status-section-edit-button " ]
12+ }
13+
1014 private var createButton : XCUIElement { createButtonGetter ( app) }
1115
12- init ( app: XCUIApplication = XCUIApplication ( ) ) throws {
16+ /// Edit button in the Order Status section.
17+ ///
18+ private var orderStatusEditButton : XCUIElement { orderStatusEditButtonGetter ( app) }
19+
20+ public init ( app: XCUIApplication = XCUIApplication ( ) ) throws {
1321 try super. init (
1422 expectedElementGetters: [ createButtonGetter ] ,
1523 app: app
1624 )
1725 }
1826
27+ /// Creates a remote order with all of the entered order data.
28+ /// - Returns: Single Order Detail screen object.
1929 @discardableResult
2030 public func createOrder( ) throws -> SingleOrderScreen {
2131 createButton. tap ( )
2232 return try SingleOrderScreen ( )
2333 }
34+
35+ /// Opens the Order Status screen (to set a new order status).
36+ /// - Returns: Order Status screen object.
37+ @discardableResult
38+ public func openOrderStatusScreen( ) throws -> OrderStatusScreen {
39+ orderStatusEditButton. tap ( )
40+ return try OrderStatusScreen ( )
41+ }
2442}
You can’t perform that action at this time.
0 commit comments