diff --git a/wallets/react-wallet-v2/README.md b/wallets/react-wallet-v2/README.md index 5eb6128..e519031 100644 --- a/wallets/react-wallet-v2/README.md +++ b/wallets/react-wallet-v2/README.md @@ -48,3 +48,54 @@ Your `.env.local` now contains the following environment variables: ## Preview of wallet and dapp examples in action https://user-images.githubusercontent.com/3154053/156764521-3492c232-7a93-47ba-88bd-2cee3f8366d4.mp4 + +## DOM Tags +This section is a key of the DOM elements used for internal E2E testing +Accessible with `data-testid` + +### Navbar +| Key | Description | +| ----------- | ----------- | +| `accounts` | Accounts page | +| `sessions` | Sessions page | +| `wc-connect` | WC Connect page | +| `pairings` | Pairings page | +| `settings` | Settings Page | + +### WC Connect Page +url: `/walletconnect` +| Key | Description | +| ----------- | ----------- | +| `uri-input` | Uri textbox | +| `uri-connect-button` | Uri connect button | + +### Sessions Page +url: `/session` +| Key | Description | +| ----------- | ----------- | +| `session-${topic}` | Session cards can be accessed by topic | + +### Session Details Page +url: `/session?topic=` +| Key | Description | +| ----------- | ----------- | +| `session-card-${chain}` | Session chain info card | +| `session-delete-button` | Session delete button | +| `session-ping-button` | Session ping button | +| `session-emit-button` | Session emit button | +| `session-update-button` | Session update button | + +### Pairing Page +url: `/pairings` +| Key | Description | +| ----------- | ----------- | +| `pairing-${topic}` | Pairing cards can be accessed by topic | +| `pairing-delete-${topic}` | Delete pairing by topic | + +### Accounts Page +url: `/` +| Key | Description | +| ----------- | ----------- | +| `chain-card-${chain id}` | Chain card by chain id | +| `chain-switch-button-${chain id}` | Chain switch button | +| `chain-switch-button-${chain id}` | Chain copy button | \ No newline at end of file diff --git a/wallets/react-wallet-v2/src/components/AccountCard.tsx b/wallets/react-wallet-v2/src/components/AccountCard.tsx index 51e082a..4fa48e9 100644 --- a/wallets/react-wallet-v2/src/components/AccountCard.tsx +++ b/wallets/react-wallet-v2/src/components/AccountCard.tsx @@ -48,6 +48,7 @@ export default function AccountCard({ name, logo, rgb, address, chainId }: Props diff --git a/wallets/react-wallet-v2/src/pages/index.tsx b/wallets/react-wallet-v2/src/pages/index.tsx index 7ed986a..8f23f47 100644 --- a/wallets/react-wallet-v2/src/pages/index.tsx +++ b/wallets/react-wallet-v2/src/pages/index.tsx @@ -30,31 +30,31 @@ export default function HomePage() { return ( - + Mainnets {Object.entries(EIP155_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(COSMOS_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(SOLANA_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(POLKADOT_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(MULTIVERSX_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(TRON_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(TEZOS_MAINNET_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {testNets ? ( @@ -63,25 +63,25 @@ export default function HomePage() { Testnets {Object.entries(EIP155_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(SOLANA_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(POLKADOT_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(NEAR_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(MULTIVERSX_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(TRON_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} {Object.entries(TEZOS_TEST_CHAINS).map(([caip10, {name, logo, rgb}]) => ( - + ))} ) : null} diff --git a/wallets/react-wallet-v2/src/pages/pairings.tsx b/wallets/react-wallet-v2/src/pages/pairings.tsx index 8992198..0012008 100644 --- a/wallets/react-wallet-v2/src/pages/pairings.tsx +++ b/wallets/react-wallet-v2/src/pages/pairings.tsx @@ -27,7 +27,9 @@ export default function PairingsPage() { logo={peerMetadata?.icons[0]} url={peerMetadata?.url} name={peerMetadata?.name} + topic={pairing.topic} onDelete={() => onDelete(pairing.topic)} + data-testid={'pairing-' + pairing.topic} /> ) }) diff --git a/wallets/react-wallet-v2/src/pages/session.tsx b/wallets/react-wallet-v2/src/pages/session.tsx index 0ce4f79..9b952d0 100644 --- a/wallets/react-wallet-v2/src/pages/session.tsx +++ b/wallets/react-wallet-v2/src/pages/session.tsx @@ -128,7 +128,7 @@ export default function SessionPage() { return ( {`Review ${chain} permissions`} - + {/* {renderAccountSelection(chain)} */} @@ -146,25 +146,25 @@ export default function SessionPage() { - - - - diff --git a/wallets/react-wallet-v2/src/pages/sessions.tsx b/wallets/react-wallet-v2/src/pages/sessions.tsx index 567f963..0efa302 100644 --- a/wallets/react-wallet-v2/src/pages/sessions.tsx +++ b/wallets/react-wallet-v2/src/pages/sessions.tsx @@ -30,6 +30,7 @@ export default function SessionsPage() { name={name} logo={icons[0]} url={url} + data-testid={'session-' + session.topic} /> ) }) diff --git a/wallets/react-wallet-v2/src/pages/walletconnect.tsx b/wallets/react-wallet-v2/src/pages/walletconnect.tsx index ed287a0..a8ab815 100644 --- a/wallets/react-wallet-v2/src/pages/walletconnect.tsx +++ b/wallets/react-wallet-v2/src/pages/walletconnect.tsx @@ -38,6 +38,7 @@ export default function WalletConnectPage() { placeholder="e.g. wc:a281567bb3e4..." onChange={e => setUri(e.target.value)} value={uri} + data-testid="uri-input" contentRight={