-
Notifications
You must be signed in to change notification settings - Fork 6
feat(maestro): shared WalletConnect Pay E2E test actions #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f345b96
feat(maestro): add shared WalletConnect Pay E2E test actions
ignaciosantise 2febfad
fix: address review feedback on shell safety, env guards, and docs
ignaciosantise d184862
docs(maestro): add local development section to README
ignaciosantise 11af873
Apply suggestion from @ignaciosantise
ignaciosantise 1e19722
Apply suggestion from @ignaciosantise
ignaciosantise e982429
Apply suggestion from @ignaciosantise
ignaciosantise 51e7595
Apply suggestion from @ignaciosantise
ignaciosantise 06790d0
Apply suggestion from @ignaciosantise
ignaciosantise 0be8ff3
Apply suggestion from @ignaciosantise
ignaciosantise fb95e54
fix(maestro): stabilize shared flows for Android
ignaciosantise 157dbb7
fix(maestro): increase KYC webview timeout to 30s
ignaciosantise 9f430c3
fix(maestro): wait for submit button before tapping in paste-URL flow
ignaciosantise 3b43662
fix(maestro): replace hardcoded cancelled payment URL with dynamic cr…
ignaciosantise File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
maestro/pay-tests/.maestro/flows/pay_confirm_and_verify.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| appId: ${APP_ID} | ||
| --- | ||
| # Shared flow: Tap Pay, verify loading, wait for success, tap "Got it!" | ||
|
|
||
| # On review screen, tap Pay button | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-button-pay" | ||
| timeout: 10000 | ||
| - tapOn: | ||
| id: "pay-button-pay" | ||
|
|
||
| # Wait for success screen (generous timeout for on-chain confirmation) | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-success-icon" | ||
| timeout: 30000 | ||
|
|
||
| # Tap "Got it!" button | ||
| - tapOn: | ||
| id: "pay-button-result-action-success" |
30 changes: 30 additions & 0 deletions
30
maestro/pay-tests/.maestro/flows/pay_open_and_paste_url.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| appId: ${APP_ID} | ||
| --- | ||
| # Shared flow: Launch wallet, open scanner, paste payment URL, wait for merchant info | ||
| # Requires: ${output.gateway_url} to be set by a prior runScript step | ||
|
|
||
| # Launch wallet app | ||
| - launchApp: | ||
| appId: ${APP_ID} | ||
| permissions: | ||
| all: allow | ||
|
|
||
| # Tap scan button to open scanner options modal | ||
| - tapOn: | ||
| id: "button-scan" | ||
|
|
||
| # Type the payment URL into the test input field | ||
| - tapOn: | ||
| id: "input-paste-url" | ||
|
|
||
| # Dismiss iOS keyboard language prompt if it appears | ||
| - runFlow: | ||
| when: | ||
| visible: "Continue" | ||
| commands: | ||
| - tapOn: "Continue" | ||
|
|
||
| - inputText: ${output.gateway_url} | ||
| - pressKey: Enter | ||
| - tapOn: | ||
| id: "button-submit-url" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| appId: ${APP_ID} | ||
| --- | ||
| # Shared flow: Open payment URL via deep link | ||
| # Requires: ${output.gateway_url} to be set by a prior runScript step | ||
|
|
||
| # Open the payment URL as a deep link | ||
| - openLink: ${output.gateway_url} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| appId: ${APP_ID} | ||
| name: WalletConnect Pay - Cancel from KYC Webview | ||
| tags: | ||
| - pay | ||
| --- | ||
| # Create payment via API (multi-option, KYC merchant) | ||
| - runScript: | ||
| file: scripts/create-payment.js | ||
| env: | ||
| WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_MULTI_KYC} | ||
| WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_MULTI_KYC} | ||
|
|
||
| - startRecording: "WalletConnect Pay Cancel from KYC" | ||
|
|
||
| # Open wallet, paste payment URL | ||
| - runFlow: | ||
| file: flows/pay_open_and_paste_url.yaml | ||
|
|
||
| # Wait for payment options to load | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-merchant-info" | ||
| timeout: 15000 | ||
|
|
||
| # Verify first option is pre-selected | ||
| - assertVisible: | ||
| id: "pay-option-0-selected" | ||
|
|
||
| # Tap Continue to go to collectData webview | ||
| - tapOn: | ||
| id: "pay-button-continue" | ||
|
|
||
| # Wait for KYC webview to load | ||
| - extendedWaitUntil: | ||
| visible: "Add your personal details" | ||
| timeout: 10000 | ||
|
|
||
| # Cancel the payment server-side while in KYC webview | ||
| - runScript: | ||
| file: scripts/cancel-payment.js | ||
| env: | ||
| WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_MULTI_KYC} | ||
| WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_MULTI_KYC} | ||
| PAYMENT_ID: ${output.payment_id} | ||
|
|
||
| # Complete KYC form (data is autocompleted, just tap Add) | ||
| - tapOn: "Add" | ||
|
|
||
| # Retry tap on "Add" if "Confirm your details" doesn't appear (webview can be slow) | ||
| - runFlow: | ||
| when: | ||
| notVisible: "Confirm your details" | ||
| commands: | ||
| - tapOn: "Add" | ||
|
|
||
| # Confirm your details popup | ||
| - extendedWaitUntil: | ||
| visible: "Confirm your details" | ||
| timeout: 10000 | ||
|
|
||
| # Tap the checkbox / label for terms agreement | ||
| - tapOn: | ||
| text: "I agree to the <termsLink>Terms and Conditions</termsLink> and <privacyLink>Privacy Policy</privacyLink>" | ||
| retryTapIfNoChange: true | ||
| - tapOn: "Confirm" | ||
|
|
||
| # Wait for result screen | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-container" | ||
| timeout: 30000 | ||
|
|
||
| # Verify cancelled icon | ||
| - assertVisible: | ||
| id: "pay-result-cancelled-icon" | ||
|
|
||
| # Verify action button | ||
| - assertVisible: | ||
| id: "pay-button-result-action-cancelled" | ||
|
|
||
| # Dismiss | ||
| - tapOn: | ||
| id: "pay-button-result-action-cancelled" | ||
|
|
||
| - stopRecording |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| appId: ${APP_ID} | ||
| name: WalletConnect Pay - Cancel from Review Screen | ||
| tags: | ||
| - pay | ||
| --- | ||
| # Create payment via API (single-option, no-KYC merchant) | ||
| - runScript: | ||
| file: scripts/create-payment.js | ||
| env: | ||
| WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC} | ||
| WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC} | ||
|
|
||
| - startRecording: "WalletConnect Pay Cancel from Review" | ||
|
|
||
| # Open wallet, paste payment URL | ||
| - runFlow: | ||
| file: flows/pay_open_and_paste_url.yaml | ||
|
|
||
| # Wait for payment options to load | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-merchant-info" | ||
| timeout: 15000 | ||
|
|
||
| # Single option auto-selects — verify review screen | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-button-pay" | ||
| timeout: 10000 | ||
|
|
||
| # Cancel the payment server-side while on review screen | ||
| - runScript: | ||
| file: scripts/cancel-payment.js | ||
| env: | ||
| WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC} | ||
| WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC} | ||
| PAYMENT_ID: ${output.payment_id} | ||
|
|
||
| # Tap Pay — payment was cancelled, should show cancelled result | ||
| - tapOn: | ||
| id: "pay-button-pay" | ||
|
|
||
| # Wait for result screen | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-container" | ||
| timeout: 30000 | ||
|
|
||
| # Verify cancelled icon | ||
| - assertVisible: | ||
| id: "pay-result-cancelled-icon" | ||
|
|
||
| # Verify action button | ||
| - assertVisible: | ||
| id: "pay-button-result-action-cancelled" | ||
|
|
||
| # Dismiss | ||
| - tapOn: | ||
| id: "pay-button-result-action-cancelled" | ||
|
|
||
| - stopRecording |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| appId: ${APP_ID} | ||
| name: WalletConnect Pay - Cancelled Payment | ||
| tags: | ||
| - pay | ||
| --- | ||
| # Use a hardcoded cancelled payment URL (no API call needed) | ||
| - evalScript: ${output.gateway_url = 'https://pay.walletconnect.com/?pid=pay_24a2ecc101KNHMZ1B8GJMR16VXAZ2EXXMN'} | ||
|
|
||
| - startRecording: "WalletConnect Pay Cancelled Payment" | ||
|
|
||
| # Open wallet, paste payment URL | ||
| - runFlow: | ||
| file: flows/pay_open_and_paste_url.yaml | ||
|
|
||
| # Payment is cancelled — app shows error result screen directly | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-container" | ||
| timeout: 15000 | ||
|
|
||
| # Verify cancelled icon is shown | ||
| - assertVisible: | ||
| id: "pay-result-cancelled-icon" | ||
|
|
||
| # Verify result action button is visible | ||
| - assertVisible: | ||
| id: "pay-button-result-action-cancelled" | ||
|
|
||
| # Dismiss the error dialog | ||
| - tapOn: | ||
| id: "pay-button-result-action-cancelled" | ||
|
|
||
| - stopRecording | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| appId: ${APP_ID} | ||
| name: WalletConnect Pay - Double Scan Same Payment | ||
| tags: | ||
| - pay | ||
| --- | ||
| # Create payment via API (single-option, no-KYC merchant) | ||
| - runScript: | ||
| file: scripts/create-payment.js | ||
| env: | ||
| WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC} | ||
| WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC} | ||
|
|
||
| - startRecording: "WalletConnect Pay Double Scan" | ||
|
|
||
| # === First scan: complete the payment normally === | ||
|
|
||
| # Open wallet, paste payment URL | ||
| - runFlow: | ||
| file: flows/pay_open_and_paste_url.yaml | ||
|
|
||
| # Wait for payment options to load | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-merchant-info" | ||
| timeout: 15000 | ||
|
|
||
| # Single option auto-selects — verify pay button | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-button-pay" | ||
| timeout: 10000 | ||
| - copyTextFrom: | ||
| id: "pay-button-pay" | ||
| - assertTrue: | ||
| condition: "${maestro.copiedText == 'Pay $0.01'}" | ||
|
|
||
| # Tap Pay, verify success, tap "Got it!" | ||
| - runFlow: | ||
| file: flows/pay_confirm_and_verify.yaml | ||
|
|
||
| # === Second scan: re-open the same gateway URL === | ||
|
|
||
| # Tap scan button to open scanner | ||
| - tapOn: | ||
| id: "button-scan" | ||
|
|
||
| # Type the same payment URL | ||
| - tapOn: | ||
| id: "input-paste-url" | ||
|
|
||
| # Dismiss iOS keyboard language prompt if it appears | ||
| - runFlow: | ||
| when: | ||
| visible: "Continue" | ||
| commands: | ||
| - tapOn: "Continue" | ||
|
|
||
| - inputText: ${output.gateway_url} | ||
| - pressKey: Enter | ||
| - tapOn: | ||
| id: "button-submit-url" | ||
|
|
||
| # Wait for error result screen (payment already completed) | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-container" | ||
| timeout: 20000 | ||
|
|
||
| # Verify generic error icon is shown (not success) | ||
| - assertVisible: | ||
| id: "pay-result-error-icon" | ||
|
|
||
| # Verify result action button is visible | ||
| - assertVisible: | ||
| id: "pay-button-result-action-generic" | ||
|
|
||
| # Dismiss the error dialog | ||
| - tapOn: | ||
| id: "pay-button-result-action-generic" | ||
|
|
||
| - stopRecording |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| appId: ${APP_ID} | ||
| name: WalletConnect Pay - Expired Link | ||
| tags: | ||
| - pay | ||
| --- | ||
| # Use a hardcoded expired payment URL (no API call needed) | ||
| - evalScript: ${output.gateway_url = 'https://pay.walletconnect.com/?pid=pay_b8a2ecc101KNHRNWXD2VF8SGZDS7WK19ZA'} | ||
|
|
||
| - startRecording: "WalletConnect Pay Expired Link" | ||
|
|
||
| # Open wallet, paste payment URL | ||
| - runFlow: | ||
| file: flows/pay_open_and_paste_url.yaml | ||
|
|
||
| # Payment is expired — app shows error result screen directly | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-container" | ||
| timeout: 15000 | ||
|
|
||
| # Verify expired icon is shown | ||
| - assertVisible: | ||
| id: "pay-result-expired-icon" | ||
|
|
||
| # Verify result action button is visible | ||
| - assertVisible: | ||
| id: "pay-button-result-action-expired" | ||
|
|
||
| # Dismiss the error dialog | ||
| - tapOn: | ||
| id: "pay-button-result-action-expired" | ||
|
|
||
| - stopRecording |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| appId: ${APP_ID} | ||
| name: WalletConnect Pay - Insufficient Funds | ||
| tags: | ||
| - pay | ||
| --- | ||
| # Create payment with amount exceeding wallet balance ($9.99) | ||
| - runScript: | ||
| file: scripts/create-payment.js | ||
| env: | ||
| WPAY_CUSTOMER_KEY: ${WPAY_CUSTOMER_KEY_SINGLE_NOKYC} | ||
| WPAY_MERCHANT_ID: ${WPAY_MERCHANT_ID_SINGLE_NOKYC} | ||
| WPAY_AMOUNT: "999" | ||
|
|
||
| - startRecording: "WalletConnect Pay Insufficient Funds" | ||
|
|
||
| # Open wallet, paste payment URL | ||
| - runFlow: | ||
| file: flows/pay_open_and_paste_url.yaml | ||
|
|
||
| # No options available — app jumps directly to error result screen | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "pay-result-container" | ||
| timeout: 15000 | ||
|
|
||
| # Verify insufficient funds icon is shown | ||
| - assertVisible: | ||
| id: "pay-result-insufficient-funds-icon" | ||
|
|
||
| # Verify result action button is visible | ||
| - assertVisible: | ||
| id: "pay-button-result-action-insufficient_funds" | ||
|
|
||
| # Dismiss the error dialog | ||
| - tapOn: | ||
| id: "pay-button-result-action-insufficient_funds" | ||
|
|
||
| - stopRecording |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.