Skip to content
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

Regression playwright autotests #328

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
6 changes: 6 additions & 0 deletions .github/workflows/web-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
required: true
FAKE_MNEMONIC:
required: true
OKX_MNEMONIC_12:
required: true
BITGET_MNEMONIC_24:
required: true

env:
node-version: lts/*
Expand Down Expand Up @@ -72,6 +76,8 @@ jobs:
TON_MNEMONIC_12: ${{ secrets.TON_MNEMONIC_12 }}
TON_MNEMONIC_12_2: ${{ secrets.TON_MNEMONIC_12_2 }}
FAKE_MNEMONIC: ${{ secrets.FAKE_MNEMONIC }}
OKX_MNEMONIC_12: ${{ secrets.OKX_MNEMONIC_12 }}
BITGET_MNEMONIC_24: ${{ secrets.BITGET_MNEMONIC_24 }}
run: npx playwright test --project='chromium'

- name: Comment Playwright report
Expand Down
79 changes: 79 additions & 0 deletions tests/playwright/tests/12WordMnemonic/OKX.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { test, expect } from '@playwright/test';

//Add OKX wallet 12 words mnemonic + w5 version
test.setTimeout(4 * 60 * 1000);


test('OKX wallet', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'Existing Wallet Import wallet' }).click();
await page.getByRole('button', { name: '12 words' }).click();
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.OKX_MNEMONIC_12);
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByText('v4R2')).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
await page
.locator('div')
.filter({ hasText: /^Password$/ })
.getByRole('textbox')
.fill('123456');
await page.getByRole('textbox').nth(1).click();
await page.getByRole('textbox').nth(1).fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByLabel('Wallet name').fill('OKX wallet');
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByText('UQAU…s4Eh')).toBeVisible();
await expect(page.locator('#root')).toContainText('UQAU…s4Eh');
await expect(page.getByText('OKX wallet').first()).toBeVisible();
await expect(page.locator('#root')).toContainText('OKX wallet');
await page.getByRole('button', { name: 'OKX wallet' }).getByRole('button').click();
await page.getByRole('button', { name: 'Add' }).nth(2).click();
await page.getByRole('button', { name: 'Open' }).nth(1).click();
await page.getByRole('link', { name: 'Settings' }).click();
await page.getByText('Delete Account').click();
await page.locator('div').filter({ hasText: /^I have a backup copy of recovery phrase$/ }).locator('div').click();
await page.getByRole('button', { name: 'Delete wallet data' }).click();
});


//Ensure that v4 is default for OKX wallet + Add versions w5 and v3 via Active address in settings

test('v4 default for OKX ', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'Existing Wallet Import wallet' }).click();
await page.getByRole('button', { name: '12 words' }).click();
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.OKX_MNEMONIC_12);
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByText('v4R2')).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
await page
.locator('div')
.filter({ hasText: /^Password$/ })
.getByRole('textbox')
.fill('123456');
await page.getByRole('textbox').nth(1).click();
await page.getByRole('textbox').nth(1).fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByLabel('Wallet name').fill('OKX wallet');
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('link', { name: 'Settings' }).click();
await expect(page.locator('#root')).toContainText('Active address');
await expect(page.getByRole('link', { name: 'Active address v4R2' })).toBeVisible();
await page.getByRole('link', { name: 'Active address v4R2' }).click();
await page.getByRole('button', { name: 'Add' }).nth(2).click();
await expect(page.getByRole('button', { name: 'Open' }).nth(1)).toBeVisible();
await expect(page.getByRole('button', { name: 'Hide' }).nth(1)).toBeVisible();
await expect(page.getByRole('button', { name: 'Add' }).nth(1)).toBeVisible();
await page.getByRole('button', { name: 'Add' }).nth(1).click();
await expect(page.getByRole('button', { name: 'Hide' }).first()).toBeVisible();
await expect(page.getByText('UQB0…2Q5K · 0 TON')).toBeVisible();
await page.locator('div').filter({ hasText: /^Active address$/ }).getByRole('button').click();
await page.getByText('Delete Account').click();
await page.locator('div').filter({ hasText: /^I have a backup copy of recovery phrase$/ }).locator('div').click();
await page.getByRole('button', { name: 'Delete wallet data' }).click();
await expect(page.getByRole('button', { name: 'Get started' })).toBeVisible();
});
32 changes: 32 additions & 0 deletions tests/playwright/tests/AddBitGet.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { test, expect } from '@playwright/test';

//Add BITGET wallet 24 mnemonic + ensure address is correct

test('BITGET', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'Existing Wallet Import wallet' }).click();
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.BITGET_MNEMONIC_24);
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByText('W5', { exact: true })).toBeVisible();

Check failure on line 12 in tests/playwright/tests/AddBitGet.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › AddBitGet.spec.ts:5:5 › BITGET

1) [chromium] › AddBitGet.spec.ts:5:5 › BITGET ─────────────────────────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('W5', { exact: true }) Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('W5', { exact: true }) 10 | await page.getByLabel('1:', { exact: true }).fill(process.env.BITGET_MNEMONIC_24); 11 | await page.getByRole('button', { name: 'Continue' }).click(); > 12 | await expect(page.getByText('W5', { exact: true })).toBeVisible(); | ^ 13 | await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); 14 | await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON'); 15 | await page.getByRole('button', { name: 'Continue' }).click(); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/AddBitGet.spec.ts:12:55

Check failure on line 12 in tests/playwright/tests/AddBitGet.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › AddBitGet.spec.ts:5:5 › BITGET

1) [chromium] › AddBitGet.spec.ts:5:5 › BITGET ─────────────────────────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('W5', { exact: true }) Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('W5', { exact: true }) 10 | await page.getByLabel('1:', { exact: true }).fill(process.env.BITGET_MNEMONIC_24); 11 | await page.getByRole('button', { name: 'Continue' }).click(); > 12 | await expect(page.getByText('W5', { exact: true })).toBeVisible(); | ^ 13 | await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); 14 | await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON'); 15 | await page.getByRole('button', { name: 'Continue' }).click(); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/AddBitGet.spec.ts:12:55
await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible();

Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › AddBitGet.spec.ts:5:5 › BITGET

1) [chromium] › AddBitGet.spec.ts:5:5 › BITGET ─────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('UQC2…1-Ly · 0 TON') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('UQC2…1-Ly · 0 TON') 11 | await page.getByRole('button', { name: 'Continue' }).click(); 12 | await expect(page.getByText('W5', { exact: true })).toBeVisible(); > 13 | await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); | ^ 14 | await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON'); 15 | await page.getByRole('button', { name: 'Continue' }).click(); 16 | await page.getByLabel('Password', { exact: true }).fill('123456'); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/AddBitGet.spec.ts:13:53

Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › AddBitGet.spec.ts:5:5 › BITGET

1) [chromium] › AddBitGet.spec.ts:5:5 › BITGET ─────────────────────────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('UQC2…1-Ly · 0 TON') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('UQC2…1-Ly · 0 TON') 11 | await page.getByRole('button', { name: 'Continue' }).click(); 12 | await expect(page.getByText('W5', { exact: true })).toBeVisible(); > 13 | await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); | ^ 14 | await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON'); 15 | await page.getByRole('button', { name: 'Continue' }).click(); 16 | await page.getByLabel('Password', { exact: true }).fill('123456'); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/AddBitGet.spec.ts:13:53

Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › AddBitGet.spec.ts:5:5 › BITGET

1) [chromium] › AddBitGet.spec.ts:5:5 › BITGET ─────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('UQC2…1-Ly · 0 TON') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('UQC2…1-Ly · 0 TON') 11 | await page.getByRole('button', { name: 'Continue' }).click(); 12 | await expect(page.getByText('W5', { exact: true })).toBeVisible(); > 13 | await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); | ^ 14 | await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON'); 15 | await page.getByRole('button', { name: 'Continue' }).click(); 16 | await page.getByLabel('Password', { exact: true }).fill('123456'); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/AddBitGet.spec.ts:13:53

Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › AddBitGet.spec.ts:5:5 › BITGET

1) [chromium] › AddBitGet.spec.ts:5:5 › BITGET ─────────────────────────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: getByText('UQC2…1-Ly · 0 TON') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByText('UQC2…1-Ly · 0 TON') 11 | await page.getByRole('button', { name: 'Continue' }).click(); 12 | await expect(page.getByText('W5', { exact: true })).toBeVisible(); > 13 | await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); | ^ 14 | await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON'); 15 | await page.getByRole('button', { name: 'Continue' }).click(); 16 | await page.getByLabel('Password', { exact: true }).fill('123456'); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/AddBitGet.spec.ts:13:53
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wallet have a ton amount
Should we just check wallet address and don't check an amount on ton?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. Because this wallet is in-use one, as soon as TON amount changes - test will fail. Anyway the main point of checking is to ensure that addresses on all stages of the flow are the same.

await expect(page.locator('#react-portal-modal-container')).toContainText('UQC2…1-Ly · 0 TON');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByLabel('Password', { exact: true }).fill('123456');
await page.getByLabel('Re-enter password').click();
await page.getByLabel('Re-enter password').fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByLabel('Wallet name').fill('BITGET');
await page.getByText('🧜', { exact: true }).click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByText('BITGET').first()).toBeVisible();
await expect(page.locator('#root')).toContainText('BITGET');
await expect(page.getByText('UQC2…1-Ly')).toBeVisible();
await expect(page.locator('#root')).toContainText('UQC2…1-Ly');
await expect(page.getByRole('button', { name: 'BITGET' })).toBeVisible();
await page.getByRole('link', { name: 'Settings' }).click();
await page.getByText('Delete Account').click();
await page.locator('div').filter({ hasText: /^I have a backup copy of recovery phrase$/ }).locator('div').click();
await page.getByRole('button', { name: 'Delete wallet data' }).click();
});
44 changes: 44 additions & 0 deletions tests/playwright/tests/AddNewMulti.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { test, expect } from '@playwright/test';

//Add New Multi-Wallet Account (except seed phrase)
test('New multi wallet', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'New Multi-Wallet Account Beta' }).click();
await expect(page.getByRole('heading', { name: 'Your wallet has just been' })).toBeVisible();
await page.locator('div').filter({ hasText: /^Back$/ }).nth(1).click();
await page.getByRole('button').nth(2).click();
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'New Multi-Wallet Account Beta' }).click();
await expect(page.getByRole('heading', { name: 'Grab a pen and a piece of' })).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
//go step back
await page.getByRole('button').nth(1).click();
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByRole('heading', { name: 'Your recovery phrase' })).toBeVisible();
await expect(page.getByText('Write down these 24 words in')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('Write down these 24 words in the order given below and store them in a secret, safe place.');
await expect(page.getByText('1.', { exact: true })).toBeVisible();
await expect(page.getByText('13.')).toBeVisible();
await expect(page.getByText('24.')).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByRole('heading', { name: 'So, let’s check' })).toBeVisible();
await expect(page.getByText('To check whether you’ve')).toBeVisible();
//go step back
await expect(page.getByRole('button').nth(1)).toBeVisible();
await page.getByRole('button').nth(1).click();
await expect(page.getByRole('heading', { name: 'Your recovery phrase' })).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button').nth(2).click();
await expect(page.getByText('Are you sure you want to')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('Are you sure you want to leave?');
await expect(page.getByText('You have unsaved changes. If')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('You have unsaved changes. If you close this window, your progress will be lost. Do you want to continue?');
await expect(page.getByRole('button', { name: 'Continue Editing' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Discard Changes' })).toBeVisible();
await page.getByRole('button', { name: 'Continue Editing' }).click();
await expect(page.getByText('To check whether you’ve')).toBeVisible();
await page.getByRole('button').nth(2).click();
await page.getByRole('button', { name: 'Discard Changes' }).click();
await expect(page.getByText('Welcome to TonkeeperWorld-')).toBeVisible();
});
50 changes: 50 additions & 0 deletions tests/playwright/tests/AddNewWallet.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { test, expect } from '@playwright/test';

//generate new wallet flow(except seed phrase)
test('new wallet', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'New Wallet Create new wallet' }).click();
await expect(page.getByRole('heading', { name: 'Generating wallet...' })).toBeVisible();
await page.getByRole('button').nth(2).click();
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'New Wallet Create new wallet' }).click();
await expect(page.getByRole('heading', { name: 'Your wallet has just been' })).toBeVisible();
await expect(page.getByRole('button').nth(2)).toBeVisible();
await expect(page.getByRole('button').nth(1)).toBeVisible();
await expect(page.getByRole('heading', { name: 'Grab a pen and a piece of' })).toBeVisible();
await expect(page.locator('h2')).toContainText('Grab a pen and a piece of paper');
await expect(page.getByText('We strongly recommend you')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('Grab a pen and a piece of paperWe strongly recommend you write down the recovery phrase because it’s the only way to have access to and recover your wallet in case of losing your device. Do not send it to yourself via email or take a screenshot. It’s safer when kept offline.');
await expect(page.getByRole('button', { name: 'Continue' })).toBeVisible();
//go step back
await page.getByRole('button').nth(1).click();
await page.getByRole('button', { name: 'New Wallet Create new wallet' }).click();
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByRole('heading', { name: 'Your recovery phrase' })).toBeVisible();
await expect(page.getByText('Write down these 24 words in')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('Write down these 24 words in the order given below and store them in a secret, safe place.');
await expect(page.getByText('1.', { exact: true })).toBeVisible();
await expect(page.getByText('13.')).toBeVisible();
await expect(page.getByText('24.')).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByRole('heading', { name: 'So, let’s check' })).toBeVisible();
await expect(page.getByText('To check whether you’ve')).toBeVisible();
//go step back
await expect(page.getByRole('button').nth(1)).toBeVisible();
await page.getByRole('button').nth(1).click();
await expect(page.getByRole('heading', { name: 'Your recovery phrase' })).toBeVisible();
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button').nth(2).click();
await expect(page.getByText('Are you sure you want to')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('Are you sure you want to leave?');
await expect(page.getByText('You have unsaved changes. If')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('You have unsaved changes. If you close this window, your progress will be lost. Do you want to continue?');
await expect(page.getByRole('button', { name: 'Continue Editing' })).toBeVisible();
await expect(page.getByRole('button', { name: 'Discard Changes' })).toBeVisible();
await page.getByRole('button', { name: 'Continue Editing' }).click();
await expect(page.getByText('To check whether you’ve')).toBeVisible();
await page.getByRole('button').nth(2).click();
await page.getByRole('button', { name: 'Discard Changes' }).click();
await expect(page.getByText('Welcome to TonkeeperWorld-')).toBeVisible();
});
99 changes: 99 additions & 0 deletions tests/playwright/tests/AddVersion.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { test, expect } from '@playwright/test';

//Can add versions using gear in a regular wallet

test.setTimeout(4 * 60 * 1000);

test('Add /hide version by gear', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'Existing Wallet Import wallet' }).click();
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_24_2);
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Continue' }).click();
await page
.locator('div')
.filter({ hasText: /^Password$/ })
.getByRole('textbox')
.fill('123456');
await page.locator('input[type="password"]').nth(1).click();
await page.locator('input[type="password"]').nth(1).fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByLabel('Wallet name').fill('%Test name%');
await page.getByText('🧠').click();
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByRole('button', { name: '%Test name% UQDJ…SXO9 W5 UQAg…' }).getByRole('button')).toBeVisible();
await page.getByRole('button', { name: '%Test name% UQDJ…SXO9 W5 UQAg…' }).getByRole('button').click();
await expect(page.getByText('Version')).toBeVisible();
await expect(page.locator('#react-portal-modal-container')).toContainText('Version');
await page.getByRole('button', { name: 'Hide' }).nth(2).click();
await page.getByRole('button', { name: 'Add' }).nth(2).click();
await page.getByRole('button', { name: 'Open' }).nth(1).click();
await page.getByText('Preferences').click();
await page.getByText('Sign Out').click();
await page.locator('div').filter({ hasText: /^I have a backup copy of recovery phrase$/ }).locator('div').click();
await page.getByRole('button', { name: 'Delete wallet data' }).click();
});

//Add wallet v3 + By clicking "Open" fall into the wallet v3

test('test', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'Existing Wallet Import wallet' }).click();
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_24_2);
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByLabel('Password', { exact: true }).fill('123456');
await page.getByLabel('Re-enter password').click();
await page.getByLabel('Re-enter password').fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('button', { name: 'Account 1 UQDJ…SXO9 W5 UQAg…' }).getByRole('button').click();
await page.getByRole('button', { name: 'Add' }).nth(1).click();
await page.getByRole('button', { name: 'Open' }).first().click();
await expect(page.locator('#root')).toContainText('UQDP…-Pi6');
await expect(page.getByRole('button', { name: 'Account 1 UQDJ…SXO9 W5 UQAg…' })).toBeVisible();
await page.getByText('Preferences').click();
await page.getByText('Sign Out').click();
await page.locator('div').filter({ hasText: /^I have a backup copy of recovery phrase$/ }).locator('div').click();
await page.getByRole('button', { name: 'Delete wallet data' }).click();
});

//Can add versions via settings tab in a regular wallet

test('Versions via settings', async ({ page }) => {
await page.goto('/');
await page.getByRole('button', { name: 'Get started' }).click();
await page.getByRole('button', { name: 'Existing Wallet Import wallet' }).click();
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_24);
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Continue' }).click();
await page
.locator('div')
.filter({ hasText: /^Password$/ })
.getByRole('textbox')
.fill('W123*4567');
await page.getByRole('textbox').nth(1).click();
await page.getByRole('textbox').nth(1).fill('W123*4567');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('link', { name: 'Settings' }).click();
await page.getByRole('link', { name: 'Active address v4R2' }).click();
await page.getByRole('button', { name: 'Add' }).first().click();
await expect(page.locator('#root')).toContainText('UQCk…yXNw');
await expect(page.locator('#root')).toContainText('v3R2');
await expect(page.locator('#root')).toContainText('UQC0…6y4I · 0 TON');
await page.getByRole('button', { name: 'Add' }).click();
await expect(page.locator('#root')).toContainText('UQBP…Hy5i');
await expect(page.locator('#root')).toContainText('W5');
await page.getByRole('button', { name: 'Hide' }).nth(1).click();
await page.getByRole('button', { name: 'Hide' }).nth(2).click();
await page.getByText('Preferences').click();
await page.locator('div').filter({ hasText: /^Sign Out$/ }).nth(1).click();
await page.locator('div').filter({ hasText: /^I have a backup copy of recovery phrase$/ }).click();
await page.getByRole('button', { name: 'Delete wallet data' }).click();
});
Loading
Loading