-
Notifications
You must be signed in to change notification settings - Fork 106
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
base: main
Are you sure you want to change the base?
Changes from 13 commits
246a8eb
3918802
22acdf1
1bf32cc
a5f0c98
a94d7d4
14d6eb3
e28d15c
2d5e0aa
c036d47
5349d75
4f62f0c
157f2aa
86a311f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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(); | ||
}); |
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 GitHub Actions / web-tests / playwright-tests[chromium] › AddBitGet.spec.ts:5:5 › BITGET
Check failure on line 12 in tests/playwright/tests/AddBitGet.spec.ts GitHub Actions / web-tests / playwright-tests[chromium] › AddBitGet.spec.ts:5:5 › BITGET
|
||
await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible(); | ||
Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts GitHub Actions / web-tests / playwright-tests[chromium] › AddBitGet.spec.ts:5:5 › BITGET
Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts GitHub Actions / web-tests / playwright-tests[chromium] › AddBitGet.spec.ts:5:5 › BITGET
Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts GitHub Actions / web-tests / playwright-tests[chromium] › AddBitGet.spec.ts:5:5 › BITGET
Check failure on line 13 in tests/playwright/tests/AddBitGet.spec.ts GitHub Actions / web-tests / playwright-tests[chromium] › AddBitGet.spec.ts:5:5 › BITGET
|
||
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(); | ||
}); |
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(); | ||
}); |
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(); | ||
}); |
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(); | ||
}); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.