33# P2 ref: Orders > Collect payment using cash on delivery
44#
55# Verifies:
6- # - Filter the orders list by "Processing" status
7- # - Open a processing order
6+ # - Search locates this run's seeded pending-payment order
87# - Tap "Collect Payment" in the payment info section
98# - Pick the "Cash" option on the Select Payment Method screen
109# - Change Due Calculator opens with the order total pre-filled
1110# - Tap "Mark Order as Complete" to record the cash payment
1211# - Returns to the order detail/list with the order marked completed
1312#
14- # Note: unlike mark-complete, the cash-payment flow has no undo — the
15- # order stays Completed with a "Cash on Delivery" gateway recorded.
16- # The staging store has plenty of processing orders, so one-per-run is
17- # acceptable for smoke purposes .
13+ # Note: the cash-payment flow has no undo — the order stays Completed
14+ # with a "Cash on Delivery" gateway recorded. It therefore only ever
15+ # consumes a seeded fixture order (located via ${SUITE_RUN_ID} search),
16+ # never an arbitrary order from the shared store's list .
1817appId : com.woocommerce.android.dev
1918name : " Orders - Collect cash payment"
2019tags :
@@ -29,62 +28,36 @@ tags:
2928- runFlow :
3029 file : ../subflows/navigate_to_orders.yaml
3130
32- # ── Filter by Pending payment status ──────────────────────────────────
33- # "Processing" orders on this store have already been paid (the payment
34- # info shows "Payment complete."), so the Collect Payment button is
35- # hidden. "Pending payment" orders are awaiting payment and expose the
36- # collect-payment action that the cash flow tests. Clear any
37- # previously-applied filters first to avoid cross-test contamination.
31+ # ── Find this run's seeded pending-payment order ──────────────────────
32+ # Fixtures are located by query, never by list position — on the shared
33+ # store the first pending order can be a manual tester's real order, and
34+ # this flow's cash payment has no undo. Searching the suite run id only
35+ # surfaces automation-owned orders (seeded billing name is the run id);
36+ # a "Pending payment" row is a seeded COD fixture that still exposes the
37+ # Collect Payment action. If attempt 1 consumed pending-order-1, the
38+ # retry finds pending-order-2 through the same query.
3839- tapOn :
39- id : " btn_order_filter"
40- label : " Open filters"
41-
42- - runFlow :
43- when :
44- visible : " .*Clear.*"
45- commands :
46- - tapOn :
47- text : " .*Clear.*"
48- label : " Clear existing filters"
40+ id : " menu_search"
41+ label : " Open order search"
4942
5043- extendedWaitUntil :
51- visible : " Order Status"
44+ visible :
45+ id : " search_src_text"
5246 timeout : 10000
5347
5448- tapOn :
55- text : " Order Status"
56- label : " Open status filter"
49+ id : " search_src_text"
50+ - inputText : ${SUITE_RUN_ID}
51+ - pressKey : Enter
5752
5853- extendedWaitUntil :
5954 visible : " .*Pending payment.*"
60- timeout : 10000
55+ timeout : 20000
56+ label : " Wait for a seeded pending-payment order in results"
6157
6258- tapOn :
6359 text : " .*Pending payment.*"
64- label : " Select Pending payment status"
65-
66- - tapOn :
67- id : " showOrdersButton"
68- label : " Apply filter"
69-
70- - extendedWaitUntil :
71- visible :
72- id : " ordersList"
73- timeout : 15000
74-
75- # Pull-to-refresh the list so the status filter reflects the latest
76- # server state (stale cache can leave a just-completed order at index 0).
77- - swipe :
78- from :
79- id : " ordersList"
80- direction : DOWN
81- duration : 800
82-
83- # ── Open the first pending-payment order ──────────────────────────────
84- - tapOn :
85- id : " orderNum"
86- index : 0
87- label : " Open first pending-payment order"
60+ label : " Open this run's pending-payment order"
8861
8962- extendedWaitUntil :
9063 visible :
@@ -161,22 +134,14 @@ tags:
161134
162135- takeScreenshot : orders_after_cash_payment
163136
164- # ── Clear the filter so future runs start from an unfiltered list ────
165- - tapOn :
166- id : " btn_order_filter"
167- label : " Re-open filters to clear"
168-
137+ # ── Exit search if still active so downstream flows start clean ──────
169138- runFlow :
170139 when :
171- visible : " .*Clear.*"
140+ visible :
141+ id : " search_src_text"
172142 commands :
173- - tapOn :
174- text : " .*Clear.*"
175- label : " Clear filters"
176-
177- - tapOn :
178- id : " showOrdersButton"
179- label : " Apply cleared filter"
143+ - back
144+ - back
180145
181146- extendedWaitUntil :
182147 visible :
0 commit comments