@@ -27,6 +27,10 @@ public final class NewOrderScreen: ScreenObject {
2727 $0. buttons [ " add-shipping-button " ]
2828 }
2929
30+ private let addFeeButtonGetter : ( XCUIApplication ) -> XCUIElement = {
31+ $0. buttons [ " add-fee-button " ]
32+ }
33+
3034 private var createButton : XCUIElement { createButtonGetter ( app) }
3135
3236 /// Cancel button in the Navigation bar.
@@ -49,6 +53,10 @@ public final class NewOrderScreen: ScreenObject {
4953 ///
5054 private var addShippingButton : XCUIElement { addShippingButtonGetter ( app) }
5155
56+ /// Add Fee button in the Payment section.
57+ ///
58+ private var addFeeButton : XCUIElement { addFeeButtonGetter ( app) }
59+
5260 public init ( app: XCUIApplication = XCUIApplication ( ) ) throws {
5361 try super. init (
5462 expectedElementGetters: [ createButtonGetter ] ,
@@ -90,6 +98,14 @@ public final class NewOrderScreen: ScreenObject {
9098 return try AddShippingScreen ( )
9199 }
92100
101+ /// Opens the Add Fee screen.
102+ /// - Returns: Add Fee screen object.
103+ @discardableResult
104+ public func openAddFeeScreen( ) throws -> AddFeeScreen {
105+ addFeeButton. tap ( )
106+ return try AddFeeScreen ( )
107+ }
108+
93109// MARK: - High-level Order Creation actions
94110
95111 /// Creates a remote order with all of the entered order data.
@@ -135,6 +151,16 @@ public final class NewOrderScreen: ScreenObject {
135151 . confirmShippingDetails ( )
136152 }
137153
154+ /// Adds a fee on the Add Fee screen.
155+ /// - Parameters:
156+ /// - amount: Amount (in the store currency) to add as a fee.
157+ /// - Returns: New Order screen object.
158+ public func addFee( amount: String ) throws -> NewOrderScreen {
159+ return try openAddFeeScreen ( )
160+ . enterFixedFee ( amount: amount)
161+ . confirmFee ( )
162+ }
163+
138164 /// Cancels Order Creation process
139165 /// - Returns: Orders Screen object.
140166 @discardableResult
0 commit comments