mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
160 lines
4.5 KiB
YAML
160 lines
4.5 KiB
YAML
appId: ${APP_ID}
|
|
tags:
|
|
- util
|
|
---
|
|
- runScript:
|
|
file: ../../../utils/scripts/defaults.js
|
|
# ===========================================
|
|
# Limit Order Transaction (Pending State)
|
|
# ===========================================
|
|
# Tests the limit order transaction detail view for pending transactions
|
|
# Reuses shared test components from tx-history tests where applicable
|
|
|
|
- assertVisible: 'Confirm transaction'
|
|
|
|
# Verify swap order container is visible
|
|
|
|
# ===========================================
|
|
# Swap Header - Sell and Receive Sections
|
|
# ===========================================
|
|
|
|
# Verify sell container and amount
|
|
- assertVisible:
|
|
id: 'swap-header-sell-container'
|
|
- assertVisible: 'Sell'
|
|
- assertVisible:
|
|
id: 'swap-header-sell-amount'
|
|
text: '.*\d+.*[A-Z]{2,}.*'
|
|
|
|
# Verify receive container and amount
|
|
- assertVisible:
|
|
id: 'swap-header-receive-container'
|
|
- assertVisible: 'For at least'
|
|
- assertVisible:
|
|
id: 'swap-header-receive-amount'
|
|
text: '.*\d+.*[A-Z]{2,}.*'
|
|
|
|
# ===========================================
|
|
# Limit Order Details Section
|
|
# ===========================================
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
|
|
# Price row - for pending orders it should be "Limit price"
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: '.*Limit price.*'
|
|
|
|
# Verify price format (1 TOKEN = AMOUNT TOKEN)
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: '.*1 [A-Z]{2,} = .*\d+.*[A-Z]{2,}.*'
|
|
|
|
# Order ID row (scoped to details section)
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: 'Order ID'
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: '0x[0-9a-fA-F]{4}.*'
|
|
|
|
# Network row (scoped to details section)
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: 'Network'
|
|
|
|
# Status row (scoped to details section)
|
|
# For pending transactions, status should be "Execution needed" or similar
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: 'Status'
|
|
- assertVisible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: '.*(Execution needed|Pending).*'
|
|
|
|
# Widget fee row (scoped to details section)
|
|
- extendedWaitUntil:
|
|
visible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: 'Widget fee'
|
|
optional: true
|
|
timeout: ${output.defaults.extendedWaitUntilTimeout}
|
|
|
|
# Expiry row (scoped to details section)
|
|
- extendedWaitUntil:
|
|
visible:
|
|
id: 'swap-order-table'
|
|
containsDescendants:
|
|
- text: 'Expiry'
|
|
optional: true
|
|
timeout: ${output.defaults.extendedWaitUntilTimeout}
|
|
|
|
# ===========================================
|
|
# Transaction Details Button
|
|
# ===========================================
|
|
- runFlow:
|
|
file: ../../assertions/verify-tx-details.yml
|
|
|
|
# ===========================================
|
|
# Actions Section
|
|
# ===========================================
|
|
# Verify Actions section is visible (limit orders have actions)
|
|
- assertVisible:
|
|
text: 'Actions'
|
|
|
|
# Tap on Actions to view the actions list
|
|
- tapOn:
|
|
text: 'Actions'
|
|
|
|
# Test the actions list using shared component
|
|
- runFlow:
|
|
file: ../../assertions/verify-actions-list.yml
|
|
|
|
# Go back from Actions screen to Confirm transaction
|
|
- tapOn:
|
|
id: 'go-back'
|
|
|
|
# Verify we're back on Confirm transaction screen
|
|
- assertVisible: 'Confirm transaction'
|
|
|
|
# ===========================================
|
|
# SafeShield Transaction Checks
|
|
# ===========================================
|
|
- runFlow:
|
|
file: ../../assertions/verify-tx-checks.yml
|
|
env:
|
|
WIDGET_HEADER_PATTERN: '.*(Review details|Issues found|Checks passed).*'
|
|
BALANCE_CHANGE_PATTERN: 'No balance change detected'
|
|
RUN_SIMULATION: 'true'
|
|
EXPECTED_SIMULATION_RESULT: 'success'
|
|
|
|
# ===========================================
|
|
# Confirmations
|
|
# ===========================================
|
|
# Test tapping on confirmations to open the bottom sheet and verify signed badge
|
|
# For pending transactions, we use the confirmations from the confirm transaction screen
|
|
- scroll
|
|
- runFlow:
|
|
file: ../../assertions/verify-tx-confirmations.yml
|
|
env:
|
|
CONFIRMATIONS_PATTERN: '.*1/2.*'
|
|
|
|
# ===========================================
|
|
# Review and Execute Screen
|
|
# ===========================================
|
|
# Test navigating to Review and execute screen and verifying all elements
|
|
# Limit orders should succeed
|
|
- runFlow:
|
|
file: ../../assertions/verify-review-and-execute.yml
|
|
env:
|
|
EXPECTED_SIGNER_PATTERN: '.*6fED.*'
|
|
IS_FULLY_SIGNED: 'false'
|