Skip to content

Commit f952287

Browse files
feat(maestro): shared WalletConnect Pay E2E test actions (#77)
1 parent abf5092 commit f952287

20 files changed

+1209
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
appId: ${APP_ID}
2+
---
3+
# Shared flow: Tap Pay, verify loading, wait for success, tap "Got it!"
4+
5+
# On review screen, tap Pay button
6+
- extendedWaitUntil:
7+
visible:
8+
id: "pay-button-pay"
9+
timeout: 10000
10+
- tapOn:
11+
id: "pay-button-pay"
12+
13+
# Wait for success screen (generous timeout for on-chain confirmation)
14+
- extendedWaitUntil:
15+
visible:
16+
id: "pay-result-success-icon"
17+
timeout: 30000
18+
19+
# Tap "Got it!" button
20+
- tapOn:
21+
id: "pay-button-result-action-success"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
appId: ${APP_ID}
2+
---
3+
# Shared flow: Launch wallet, open scanner, paste payment URL, wait for merchant info
4+
# Requires: ${output.gateway_url} to be set by a prior runScript step
5+
6+
# Launch wallet app
7+
- launchApp:
8+
appId: ${APP_ID}
9+
permissions:
10+
all: allow
11+
12+
# Wait for the app to fully load before interacting
13+
- extendedWaitUntil:
14+
visible:
15+
id: "button-scan"
16+
timeout: 15000
17+
18+
# Tap scan button to open scanner options modal
19+
- tapOn:
20+
id: "button-scan"
21+
22+
# Type the payment URL into the test input field
23+
- tapOn:
24+
id: "input-paste-url"
25+
26+
# Dismiss iOS keyboard language prompt if it appears
27+
- runFlow:
28+
when:
29+
visible: "Continue"
30+
commands:
31+
- tapOn: "Continue"
32+
33+
- inputText: ${output.gateway_url}
34+
35+
- pressKey: Enter
36+
37+
- extendedWaitUntil:
38+
visible:
39+
id: "button-submit-url"
40+
timeout: 10000
41+
42+
- tapOn:
43+
id: "button-submit-url"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
appId: ${APP_ID}
2+
---
3+
# Shared flow: Open payment URL via deep link
4+
# Requires: ${output.gateway_url} to be set by a prior runScript step
5+
6+
# Stop app then open via deeplink so openLink is the launch intent.
7+
- stopApp:
8+
appId: ${APP_ID}
9+
- openLink: ${output.gateway_url}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
appId: ${APP_ID}
2+
name: WalletConnect Pay - Cancel from KYC Webview
3+
tags:
4+
- pay
5+
---
6+
# Create payment via API (multi-option, KYC merchant)
7+
- runScript:
8+
file: scripts/create-payment.js
9+
env:
10+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_MULTI_KYC}
11+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_MULTI_KYC}
12+
13+
- startRecording: "WalletConnect Pay Cancel from KYC"
14+
15+
# Open wallet, paste payment URL
16+
- runFlow:
17+
file: flows/pay_open_and_paste_url.yaml
18+
19+
# Wait for payment options to load
20+
- extendedWaitUntil:
21+
visible:
22+
id: "pay-merchant-info"
23+
timeout: 15000
24+
25+
# Verify first option is pre-selected
26+
- assertVisible:
27+
id: "pay-option-0-selected"
28+
29+
# Tap Continue to go to collectData webview
30+
- tapOn:
31+
id: "pay-button-continue"
32+
33+
# Wait for KYC webview to load
34+
- extendedWaitUntil:
35+
visible: "Add your personal details"
36+
timeout: 30000
37+
38+
# Cancel the payment server-side while in KYC webview
39+
- runScript:
40+
file: scripts/cancel-payment.js
41+
env:
42+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_MULTI_KYC}
43+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_MULTI_KYC}
44+
PAYMENT_ID: ${output.payment_id}
45+
46+
# Complete KYC form (data is autocompleted, just tap Add)
47+
- tapOn: "Add"
48+
49+
# Retry tap on "Add" if "Confirm your details" doesn't appear (webview can be slow)
50+
- runFlow:
51+
when:
52+
notVisible: "Confirm your details"
53+
commands:
54+
- tapOn: "Add"
55+
56+
# Confirm your details popup
57+
- extendedWaitUntil:
58+
visible: "Confirm your details"
59+
timeout: 10000
60+
61+
# Tap the checkbox / label for terms agreement
62+
- tapOn:
63+
text: "I agree to the <termsLink>Terms and Conditions</termsLink> and <privacyLink>Privacy Policy</privacyLink>"
64+
retryTapIfNoChange: true
65+
- tapOn: "Confirm"
66+
67+
# Wait for result screen
68+
- extendedWaitUntil:
69+
visible:
70+
id: "pay-result-container"
71+
timeout: 30000
72+
73+
# Verify cancelled icon
74+
- assertVisible:
75+
id: "pay-result-cancelled-icon"
76+
77+
# Verify action button
78+
- assertVisible:
79+
id: "pay-button-result-action-cancelled"
80+
81+
# Dismiss
82+
- tapOn:
83+
id: "pay-button-result-action-cancelled"
84+
85+
- stopRecording
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
appId: ${APP_ID}
2+
name: WalletConnect Pay - Cancel from Review Screen
3+
tags:
4+
- pay
5+
---
6+
# Create payment via API (single-option, no-KYC merchant)
7+
- runScript:
8+
file: scripts/create-payment.js
9+
env:
10+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC}
11+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC}
12+
13+
- startRecording: "WalletConnect Pay Cancel from Review"
14+
15+
# Open wallet, paste payment URL
16+
- runFlow:
17+
file: flows/pay_open_and_paste_url.yaml
18+
19+
# Wait for payment options to load
20+
- extendedWaitUntil:
21+
visible:
22+
id: "pay-merchant-info"
23+
timeout: 15000
24+
25+
# Single option auto-selects — verify review screen
26+
- extendedWaitUntil:
27+
visible:
28+
id: "pay-button-pay"
29+
timeout: 10000
30+
31+
# Cancel the payment server-side while on review screen
32+
- runScript:
33+
file: scripts/cancel-payment.js
34+
env:
35+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC}
36+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC}
37+
PAYMENT_ID: ${output.payment_id}
38+
39+
# Tap Pay — payment was cancelled, should show cancelled result
40+
- tapOn:
41+
id: "pay-button-pay"
42+
43+
# Wait for result screen
44+
- extendedWaitUntil:
45+
visible:
46+
id: "pay-result-container"
47+
timeout: 30000
48+
49+
# Verify cancelled icon
50+
- assertVisible:
51+
id: "pay-result-cancelled-icon"
52+
53+
# Verify action button
54+
- assertVisible:
55+
id: "pay-button-result-action-cancelled"
56+
57+
# Dismiss
58+
- tapOn:
59+
id: "pay-button-result-action-cancelled"
60+
61+
- stopRecording
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
appId: ${APP_ID}
2+
name: WalletConnect Pay - Cancelled Payment
3+
tags:
4+
- pay
5+
---
6+
# Create a fresh payment, then cancel it immediately via API
7+
- runScript:
8+
file: scripts/create-payment.js
9+
env:
10+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC}
11+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC}
12+
13+
- runScript:
14+
file: scripts/cancel-payment.js
15+
env:
16+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC}
17+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC}
18+
PAYMENT_ID: ${output.payment_id}
19+
20+
- startRecording: "WalletConnect Pay Cancelled Payment"
21+
22+
# Open wallet, paste payment URL
23+
- runFlow:
24+
file: flows/pay_open_and_paste_url.yaml
25+
26+
# Payment is cancelled — app shows error result screen directly
27+
- extendedWaitUntil:
28+
visible:
29+
id: "pay-result-container"
30+
timeout: 15000
31+
32+
# Verify cancelled icon is shown
33+
- assertVisible:
34+
id: "pay-result-cancelled-icon"
35+
36+
# Verify result action button is visible
37+
- assertVisible:
38+
id: "pay-button-result-action-cancelled"
39+
40+
# Dismiss the error dialog
41+
- tapOn:
42+
id: "pay-button-result-action-cancelled"
43+
44+
- stopRecording
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
appId: ${APP_ID}
2+
name: WalletConnect Pay - Double Scan Same Payment
3+
tags:
4+
- pay
5+
---
6+
# Create payment via API (single-option, no-KYC merchant)
7+
- runScript:
8+
file: scripts/create-payment.js
9+
env:
10+
WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC}
11+
WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC}
12+
13+
- startRecording: "WalletConnect Pay Double Scan"
14+
15+
# === First scan: complete the payment normally ===
16+
17+
# Open wallet, paste payment URL
18+
- runFlow:
19+
file: flows/pay_open_and_paste_url.yaml
20+
21+
# Wait for payment options to load
22+
- extendedWaitUntil:
23+
visible:
24+
id: "pay-merchant-info"
25+
timeout: 15000
26+
27+
# Single option auto-selects — verify pay button
28+
- extendedWaitUntil:
29+
visible:
30+
id: "pay-button-pay"
31+
timeout: 10000
32+
- copyTextFrom:
33+
id: "pay-button-pay"
34+
- assertTrue:
35+
condition: "${maestro.copiedText == 'Pay $0.01'}"
36+
37+
# Tap Pay, verify success, tap "Got it!"
38+
- runFlow:
39+
file: flows/pay_confirm_and_verify.yaml
40+
41+
# === Second scan: re-open the same gateway URL ===
42+
43+
# Tap scan button to open scanner
44+
- tapOn:
45+
id: "button-scan"
46+
47+
# Type the same payment URL
48+
- tapOn:
49+
id: "input-paste-url"
50+
51+
# Dismiss iOS keyboard language prompt if it appears
52+
- runFlow:
53+
when:
54+
visible: "Continue"
55+
commands:
56+
- tapOn: "Continue"
57+
58+
- inputText: ${output.gateway_url}
59+
- pressKey: Enter
60+
- tapOn:
61+
id: "button-submit-url"
62+
63+
# Wait for error result screen (payment already completed)
64+
- extendedWaitUntil:
65+
visible:
66+
id: "pay-result-container"
67+
timeout: 20000
68+
69+
# Verify generic error icon is shown (not success)
70+
- assertVisible:
71+
id: "pay-result-error-icon"
72+
73+
# Verify result action button is visible
74+
- assertVisible:
75+
id: "pay-button-result-action-generic"
76+
77+
# Dismiss the error dialog
78+
- tapOn:
79+
id: "pay-button-result-action-generic"
80+
81+
- stopRecording
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
appId: ${APP_ID}
2+
name: WalletConnect Pay - Expired Link
3+
tags:
4+
- pay
5+
---
6+
# Use a hardcoded expired payment URL (no API call needed)
7+
- evalScript: ${output.gateway_url = 'https://pay.walletconnect.com/?pid=pay_b8a2ecc101KNHRNWXD2VF8SGZDS7WK19ZA'}
8+
9+
- startRecording: "WalletConnect Pay Expired Link"
10+
11+
# Open wallet, paste payment URL
12+
- runFlow:
13+
file: flows/pay_open_and_paste_url.yaml
14+
15+
# Payment is expired — app shows error result screen directly
16+
- extendedWaitUntil:
17+
visible:
18+
id: "pay-result-container"
19+
timeout: 15000
20+
21+
# Verify expired icon is shown
22+
- assertVisible:
23+
id: "pay-result-expired-icon"
24+
25+
# Verify result action button is visible
26+
- assertVisible:
27+
id: "pay-button-result-action-expired"
28+
29+
# Dismiss the error dialog
30+
- tapOn:
31+
id: "pay-button-result-action-expired"
32+
33+
- stopRecording

0 commit comments

Comments
 (0)