Skip to content

Commit 76e4192

Browse files
Discover variable products in POS flows
1 parent a7b37db commit 76e4192

3 files changed

Lines changed: 63 additions & 75 deletions

File tree

.maestro/flows/pos_cash_payment.yaml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -54,40 +54,8 @@ tags:
5454
text: "Clear cart"
5555
label: "Own an empty POS cart"
5656

57-
- tapOn:
58-
id: "woo_pos_search_input"
59-
label: "Open product search"
60-
- extendedWaitUntil:
61-
visible: ".*Search products and variations.*"
62-
timeout: 10000
63-
- tapOn:
64-
id: "woo_pos_search_input"
65-
label: "Focus product search"
6657
- runFlow:
67-
file: ../subflows/paste_into_focused_field.yaml
68-
env:
69-
TEXT_TO_PASTE: ${WOO_VARIABLE_PRODUCT_NAME}
70-
- hideKeyboard
71-
72-
- extendedWaitUntil:
73-
visible: "${WOO_VARIABLE_PRODUCT_NAME}"
74-
timeout: 20000
75-
76-
- tapOn:
77-
id: "woo_pos_product_item"
78-
index: 0
79-
label: "Open variable product variations"
80-
- extendedWaitUntil:
81-
notVisible: ".*Search products and variations.*"
82-
timeout: 10000
83-
- extendedWaitUntil:
84-
visible:
85-
id: "woo_pos_product_item"
86-
timeout: 20000
87-
- tapOn:
88-
id: "woo_pos_product_item"
89-
index: 0
90-
label: "Add first variation to owned cart"
58+
file: ../subflows/pos_add_discovered_variable_product.yaml
9159

9260
- copyTextFrom:
9361
id: "woo_pos_cart_items_count"

.maestro/flows/pos_search_and_coupons.yaml

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616
# Verifies (on tablet):
1717
# - POS screen loads with Products + Coupons tabs visible
18-
# - Search resolves the configured variable product and a variation
18+
# - Search resolves a variable product discovered from the live catalog
1919
# - A real coupon is added to the cart
2020
# - Switching back to Products reloads the product grid
2121
appId: com.woocommerce.android.dev
@@ -61,48 +61,8 @@ tags:
6161
- assertVisible:
6262
id: "woo_pos_search_input"
6363

64-
- tapOn:
65-
id: "woo_pos_search_input"
66-
label: "Open product search"
67-
68-
- extendedWaitUntil:
69-
visible: ".*Search products and variations.*"
70-
timeout: 10000
71-
72-
- tapOn:
73-
id: "woo_pos_search_input"
74-
label: "Focus product search"
7564
- runFlow:
76-
file: ../subflows/paste_into_focused_field.yaml
77-
env:
78-
TEXT_TO_PASTE: ${WOO_VARIABLE_PRODUCT_NAME}
79-
- hideKeyboard
80-
81-
- extendedWaitUntil:
82-
visible: "${WOO_VARIABLE_PRODUCT_NAME}"
83-
timeout: 20000
84-
label: "Wait for configured variable product"
85-
86-
- tapOn:
87-
id: "woo_pos_product_item"
88-
index: 0
89-
label: "Open variable product variations"
90-
91-
- extendedWaitUntil:
92-
notVisible: ".*Search products and variations.*"
93-
timeout: 10000
94-
label: "Require variation selection screen"
95-
96-
- extendedWaitUntil:
97-
visible:
98-
id: "woo_pos_product_item"
99-
timeout: 20000
100-
label: "Wait for POS variations"
101-
102-
- tapOn:
103-
id: "woo_pos_product_item"
104-
index: 0
105-
label: "Add first variation to cart"
65+
file: ../subflows/pos_add_discovered_variable_product.yaml
10666

10767
- runFlow:
10868
when:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Discovers a variable product from the loaded POS catalog, searches for its
2+
# app-provided name, opens its variations, and adds the first variation.
3+
appId: com.woocommerce.android.dev
4+
---
5+
- scrollUntilVisible:
6+
element: "Variable Product .*"
7+
direction: DOWN
8+
timeout: 30000
9+
label: "Find a Variable product in the POS catalog"
10+
11+
- copyTextFrom:
12+
text: "Variable Product .*"
13+
14+
- evalScript: ${output.posVariableProductName = maestro.copiedText.replace('Variable Product ', '')}
15+
- assertTrue:
16+
condition: ${output.posVariableProductName.length > 0}
17+
label: "Capture the discovered Variable product name"
18+
19+
- tapOn:
20+
id: "woo_pos_search_input"
21+
label: "Open product search"
22+
23+
- extendedWaitUntil:
24+
visible: ".*Search products and variations.*"
25+
timeout: 10000
26+
27+
- tapOn:
28+
id: "woo_pos_search_input"
29+
label: "Focus product search"
30+
- runFlow:
31+
file: paste_into_focused_field.yaml
32+
env:
33+
TEXT_TO_PASTE: ${output.posVariableProductName}
34+
- hideKeyboard
35+
36+
- extendedWaitUntil:
37+
visible: "Variable Product .*"
38+
timeout: 20000
39+
label: "Search resolves a Variable product"
40+
41+
- tapOn:
42+
id: "woo_pos_product_item"
43+
index: 0
44+
label: "Open discovered Variable product variations"
45+
46+
- extendedWaitUntil:
47+
notVisible: ".*Search products and variations.*"
48+
timeout: 10000
49+
label: "Require variation selection screen"
50+
51+
- extendedWaitUntil:
52+
visible:
53+
id: "woo_pos_product_item"
54+
timeout: 20000
55+
label: "Wait for POS variations"
56+
57+
- tapOn:
58+
id: "woo_pos_product_item"
59+
index: 0
60+
label: "Add first variation to cart"

0 commit comments

Comments
 (0)