@@ -31,6 +31,10 @@ public final class NewOrderScreen: ScreenObject {
3131 $0. buttons [ " add-fee-button " ]
3232 }
3333
34+ private let addNoteButtonGetter : ( XCUIApplication ) -> XCUIElement = {
35+ $0. buttons [ " add-customer-note-button " ]
36+ }
37+
3438 private var createButton : XCUIElement { createButtonGetter ( app) }
3539
3640 /// Cancel button in the Navigation bar.
@@ -57,6 +61,10 @@ public final class NewOrderScreen: ScreenObject {
5761 ///
5862 private var addFeeButton : XCUIElement { addFeeButtonGetter ( app) }
5963
64+ /// Add Note button in the Customer Note section.
65+ ///
66+ private var addNoteButton : XCUIElement { addNoteButtonGetter ( app) }
67+
6068 public init ( app: XCUIApplication = XCUIApplication ( ) ) throws {
6169 try super. init (
6270 expectedElementGetters: [ createButtonGetter ] ,
@@ -106,6 +114,14 @@ public final class NewOrderScreen: ScreenObject {
106114 return try AddFeeScreen ( )
107115 }
108116
117+ /// Opens the Customer Note screen.
118+ /// - Returns: Customer Note screen object.
119+ @discardableResult
120+ public func openCustomerNoteScreen( ) throws -> CustomerNoteScreen {
121+ addNoteButton. tap ( )
122+ return try CustomerNoteScreen ( )
123+ }
124+
109125// MARK: - High-level Order Creation actions
110126
111127 /// Creates a remote order with all of the entered order data.
@@ -161,6 +177,15 @@ public final class NewOrderScreen: ScreenObject {
161177 . confirmFee ( )
162178 }
163179
180+ /// Adds a note on the Customer Note screen.
181+ /// - Parameter text: Text to enter as the customer note.
182+ /// - Returns: New Order screen object.
183+ public func addCustomerNote( _ text: String ) throws -> NewOrderScreen {
184+ return try openCustomerNoteScreen ( )
185+ . enterNote ( text)
186+ . confirmNote ( )
187+ }
188+
164189 /// Cancels Order Creation process
165190 /// - Returns: Orders Screen object.
166191 @discardableResult
0 commit comments