Skip to content

Commit 9b9f7e8

Browse files
Target seeded fixtures by run-id query instead of first-row taps in destructive flows
1 parent 04d5cbd commit 9b9f7e8

6 files changed

Lines changed: 131 additions & 149 deletions

.maestro/flows/orders_cash_payment.yaml

Lines changed: 28 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
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.
1817
appId: com.woocommerce.android.dev
1918
name: "Orders - Collect cash payment"
2019
tags:
@@ -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:

.maestro/flows/orders_details_and_actions.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,34 @@ tags:
3030
- runFlow:
3131
file: ../subflows/navigate_to_orders.yaml
3232

33-
# Open the first order
33+
# Open one of this run's seeded orders — never an arbitrary first row.
34+
# This flow persists a note on the order it opens, and on the shared
35+
# store index-0 can be a manual tester's real order. Searching the
36+
# suite run id scopes the list to automation-owned fixtures only.
37+
- tapOn:
38+
id: "menu_search"
39+
label: "Open order search"
40+
41+
- extendedWaitUntil:
42+
visible:
43+
id: "search_src_text"
44+
timeout: 10000
45+
46+
- tapOn:
47+
id: "search_src_text"
48+
- inputText: ${SUITE_RUN_ID}
49+
- pressKey: Enter
50+
51+
- extendedWaitUntil:
52+
visible:
53+
id: "orderNum"
54+
timeout: 20000
55+
label: "Wait for seeded orders in results"
56+
3457
- tapOn:
3558
id: "orderNum"
3659
index: 0
37-
label: "Tap first order in list"
60+
label: "Open first seeded order"
3861

3962
# Wait for order detail
4063
- extendedWaitUntil:

.maestro/flows/orders_mark_complete.yaml

Lines changed: 28 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# P2 ref: Orders > Mark complete
44
#
55
# Verifies:
6-
# - Filter the orders list by "Processing" status
7-
# - Open a processing order
6+
# - Search locates this run's seeded processing order
87
# - Navigate to the Fulfill screen via "Mark order complete"
98
# - Complete the fulfillment
109
# - "🎉 Order completed!" snackbar appears
1110
# - Undo the status change so the staging store stays clean
1211
#
13-
# Filtering to "Processing" guarantees the target order has the Mark
14-
# Complete button visible — it's hidden on already-completed orders.
12+
# The seeded processing fixture guarantees the target order has the
13+
# Mark Complete button visible — it's hidden on already-completed
14+
# orders — and that a missed Undo only ever affects automation data.
1515
appId: com.woocommerce.android.dev
1616
name: "Orders - Mark order complete"
1717
tags:
@@ -26,65 +26,37 @@ tags:
2626
- runFlow:
2727
file: ../subflows/navigate_to_orders.yaml
2828

29-
# ── Filter by Processing status ───────────────────────────────────────
30-
# Clear any previously-applied filter first. Prior flows in the suite
31-
# (e.g. orders_refund with a Completed filter) can leave a status
32-
# selected; re-selecting "Processing" on top of that would stack the
33-
# statuses and surface orders that don't have the Mark Complete
34-
# button.
29+
# ── Find this run's seeded processing order ──────────────────────────
30+
# Fixtures are located by query, never by list position — on the shared
31+
# store the first processing order can be a manual tester's real order,
32+
# and the Undo below is best-effort (the snackbar auto-dismisses).
33+
# Searching the suite run id only surfaces automation-owned orders
34+
# (seeded billing name is the run id); the "Processing" row is a seeded
35+
# paid fixture that exposes the Mark Complete action.
3536
- tapOn:
36-
id: "btn_order_filter"
37-
label: "Open filters"
38-
39-
- runFlow:
40-
when:
41-
visible: ".*Clear.*"
42-
commands:
43-
- tapOn:
44-
text: ".*Clear.*"
45-
label: "Clear existing filters"
37+
id: "menu_search"
38+
label: "Open order search"
4639

4740
- extendedWaitUntil:
48-
visible: "Order Status"
41+
visible:
42+
id: "search_src_text"
4943
timeout: 10000
5044

5145
- tapOn:
52-
text: "Order Status"
53-
label: "Open status filter"
46+
id: "search_src_text"
47+
- inputText: ${SUITE_RUN_ID}
48+
- pressKey: Enter
5449

55-
# Status labels include counts, e.g. "Processing (50)".
5650
- extendedWaitUntil:
5751
visible: ".*Processing.*"
58-
timeout: 10000
52+
timeout: 20000
53+
label: "Wait for a seeded processing order in results"
5954

60-
- tapOn:
61-
text: ".*Processing.*"
62-
label: "Select Processing status"
55+
- takeScreenshot: orders_search_processing
6356

6457
- tapOn:
65-
id: "showOrdersButton"
66-
label: "Apply filter"
67-
68-
- extendedWaitUntil:
69-
visible:
70-
id: "ordersList"
71-
timeout: 15000
72-
73-
# Pull-to-refresh so the status filter reflects the latest server
74-
# state — stale caches can leave a just-completed order at index 0.
75-
- swipe:
76-
from:
77-
id: "ordersList"
78-
direction: DOWN
79-
duration: 800
80-
81-
- takeScreenshot: orders_filtered_processing
82-
83-
# ── Open the first processing order ──────────────────────────────────
84-
- tapOn:
85-
id: "orderNum"
86-
index: 0
87-
label: "Open first processing order"
58+
text: ".*Processing.*"
59+
label: "Open this run's processing order"
8860

8961
- extendedWaitUntil:
9062
visible:
@@ -161,22 +133,14 @@ tags:
161133

162134
- takeScreenshot: order_marked_complete_reverted
163135

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-
136+
# ── Exit search if still active so downstream flows start clean ──────
169137
- runFlow:
170138
when:
171-
visible: ".*Clear.*"
139+
visible:
140+
id: "search_src_text"
172141
commands:
173-
- tapOn:
174-
text: ".*Clear.*"
175-
label: "Clear filters"
176-
177-
- tapOn:
178-
id: "showOrdersButton"
179-
label: "Apply cleared filter"
142+
- back
143+
- back
180144

181145
- extendedWaitUntil:
182146
visible:

.maestro/flows/orders_refund.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,12 @@ tags:
9797
# here instead of a leftover "SmokeTest*" customer from a previous
9898
# suite run — those prior orders will have already been fully
9999
# refunded and show 0 refundable items on the Issue Refund screen.
100-
# Fall back to the first completed order when the suite-tagged
101-
# customer isn't visible (e.g. this flow is run standalone).
100+
# Fall back to this run's seeded refundable fixture (its billing name
101+
# is the run id) when the suite-tagged customer isn't visible (e.g.
102+
# this flow is run standalone). Never fall back to an arbitrary first
103+
# row — on the shared store that could issue a refund against a manual
104+
# tester's real order; if neither automation order is visible, failing
105+
# here is the correct outcome.
102106
- runFlow:
103107
when:
104108
visible: ".*SmokeTest-${SUITE_RUN_ID}.*"
@@ -113,9 +117,9 @@ tags:
113117
notVisible: ".*SmokeTest-${SUITE_RUN_ID}.*"
114118
commands:
115119
- tapOn:
116-
id: "orderNum"
117-
index: 0
118-
label: "Open first completed order (fallback)"
120+
text: ".*${SUITE_RUN_ID}.*"
121+
retryTapIfNoChange: true
122+
label: "Open this run's seeded refundable order (fallback)"
119123

120124
- extendedWaitUntil:
121125
visible:

.maestro/flows/products_create.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ tags:
9999
- takeScreenshot: product_create_empty_form
100100

101101
# ─────────────────────────────────────────────────────────────────────
102-
# 2. Name — fixed string so search at the end is deterministic even
103-
# after previous runs have accumulated duplicates.
102+
# 2. Name — stamped with the suite run id so (a) the end-of-flow search
103+
# matches exactly this run's product, never a leftover duplicate,
104+
# and (b) the stale-orphan sweep can find and delete it if the run
105+
# crashes before any cleanup.
104106
# ─────────────────────────────────────────────────────────────────────
105107
- tapOn:
106108
id: "editText"
107109
label: "Tap product name field"
108110

109-
- inputText: "Maestro Smoke Product"
111+
- inputText: "Maestro Smoke Product ${SUITE_RUN_ID}"
110112

111113
- hideKeyboard
112114

@@ -333,19 +335,20 @@ tags:
333335
- tapOn:
334336
id: "search_src_text"
335337

336-
- inputText: "Maestro Smoke"
338+
- inputText: ${SUITE_RUN_ID}
337339

338340
- hideKeyboard
339341

340342
# The search is debounced, and the staging backend can take a couple
341343
# of seconds to return results for a just-published product. Generous
342-
# timeout to accommodate that round-trip.
344+
# timeout to accommodate that round-trip. Matching on the run id makes
345+
# this assert immune to leftovers from previous runs.
343346
- extendedWaitUntil:
344-
visible: "Maestro Smoke Product"
347+
visible: ".*Maestro Smoke Product ${SUITE_RUN_ID}.*"
345348
timeout: 30000
346349
label: "Wait for the new product in search results"
347350

348-
- assertVisible: "Maestro Smoke Product"
351+
- assertVisible: ".*Maestro Smoke Product ${SUITE_RUN_ID}.*"
349352

350353
- takeScreenshot: product_create_found_in_list
351354

0 commit comments

Comments
 (0)