Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KuznetsovNikita committed Nov 25, 2024
1 parent c8a85d1 commit 4aa2bf1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ test('Add existing multi wallet', async ({ page }) => {
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_24_3);
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.locator('#create-password').fill('123456');
await page.locator('#create-password-confirm').fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByText('Preferences').click();
Expand All @@ -38,13 +33,8 @@ test('Child wallet', async ({ page }) => {
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_24_4);
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.getByRole('textbox').nth(1).click();
await page.getByRole('textbox').nth(1).fill('123456');
await page.locator('#create-password').fill('123456');
await page.locator('#create-password-confirm').fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('link', { name: 'Settings' }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ test('Hide/ add wallets', async ({ page }) => {
await page.getByLabel('1:', { exact: true }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_24_3);
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.locator('#create-password').fill('123456');
await page.locator('#create-password-confirm').fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.getByRole('button', { name: 'Save' }).click();
await page.getByRole('link', { name: 'Settings' }).click();
Expand Down
9 changes: 2 additions & 7 deletions tests/playwright/tests/Dashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ test('Dashboard + elements', async ({ page }) => {
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_ANANAS);
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.getByRole('textbox').nth(1).click();
await page.getByRole('textbox').nth(1).fill('123456');
await page.locator('#create-password').fill('123456');
await page.locator('#create-password-confirm').fill('123456');
await page.getByRole('button', { name: 'Continue' }).click();
await page.locator('#react-portal-modal-container').getByRole('textbox').fill('Ananas');
await page.getByRole('button', { name: 'Save' }).click();
Expand Down
19 changes: 13 additions & 6 deletions tests/playwright/tests/Ton Connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ test.describe('ton connect', () => {
// navigate back to wallet
await connectUrl(page, clipboardContent);

await expect(
page.locator('#react-portal-modal-container').getByText('UQAG…gyIO')
).toBeVisible();
const modal = page.locator('#react-portal-modal-container').getByText('UQAG…gyIO');
await expect(modal).toBeVisible();

Check failure on line 64 in tests/playwright/tests/Ton Connect.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › Ton Connect.spec.ts:40:9 › ton connect › elements

2) [chromium] › Ton Connect.spec.ts:40:9 › ton connect › elements ──────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: locator('#react-portal-modal-container').getByText('UQAG…gyIO') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for locator('#react-portal-modal-container').getByText('UQAG…gyIO') 62 | 63 | const modal = page.locator('#react-portal-modal-container').getByText('UQAG…gyIO'); > 64 | await expect(modal).toBeVisible(); | ^ 65 | 66 | await expect(page.locator('form')).toContainText('UQAG…gyIO'); 67 | await page.getByRole('button', { name: 'Connect wallet' }).click(); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/Ton Connect.spec.ts:64:29

Check failure on line 64 in tests/playwright/tests/Ton Connect.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › Ton Connect.spec.ts:40:9 › ton connect › elements

2) [chromium] › Ton Connect.spec.ts:40:9 › ton connect › elements ──────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: locator('#react-portal-modal-container').getByText('UQAG…gyIO') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for locator('#react-portal-modal-container').getByText('UQAG…gyIO') 62 | 63 | const modal = page.locator('#react-portal-modal-container').getByText('UQAG…gyIO'); > 64 | await expect(modal).toBeVisible(); | ^ 65 | 66 | await expect(page.locator('form')).toContainText('UQAG…gyIO'); 67 | await page.getByRole('button', { name: 'Connect wallet' }).click(); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/Ton Connect.spec.ts:64:29

Check failure on line 64 in tests/playwright/tests/Ton Connect.spec.ts

View workflow job for this annotation

GitHub Actions / web-tests / playwright-tests

[chromium] › Ton Connect.spec.ts:40:9 › ton connect › elements

2) [chromium] › Ton Connect.spec.ts:40:9 › ton connect › elements ──────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: Timed out 5000ms waiting for expect(locator).toBeVisible() Locator: locator('#react-portal-modal-container').getByText('UQAG…gyIO') Expected: visible Received: <element(s) not found> Call log: - expect.toBeVisible with timeout 5000ms - waiting for locator('#react-portal-modal-container').getByText('UQAG…gyIO') 62 | 63 | const modal = page.locator('#react-portal-modal-container').getByText('UQAG…gyIO'); > 64 | await expect(modal).toBeVisible(); | ^ 65 | 66 | await expect(page.locator('form')).toContainText('UQAG…gyIO'); 67 | await page.getByRole('button', { name: 'Connect wallet' }).click(); at /home/runner/work/tonkeeper-web/tonkeeper-web/tests/playwright/tests/Ton Connect.spec.ts:64:29

await expect(page.locator('form')).toContainText('UQAG…gyIO');
await page.getByRole('button', { name: 'Connect wallet' }).click();
await page.getByRole('link', { name: 'Settings' }).click();
Expand Down Expand Up @@ -98,7 +98,12 @@ test.describe('ton connect', () => {
// navigate back to wallet
await connectUrl(page, clipboardContent);

const modal = page.locator('#react-portal-modal-container').getByText('UQAG…gyIO');
await expect(modal).toBeVisible();

await page.getByRole('button', { name: 'Connect wallet' }).click();

await expect(modal).not.toBeVisible();
});

test('Getgems', async ({ page, context }) => {
Expand Down Expand Up @@ -126,13 +131,15 @@ test.describe('ton connect', () => {
// navigate back to wallet
await connectUrl(page, clipboardContent);

await expect(
page.locator('#react-portal-modal-container').getByText('UQAG…gyIO')
).toBeVisible();
const modal = page.locator('#react-portal-modal-container').getByText('UQAG…gyIO');
await expect(modal).toBeVisible();

await page.getByRole('button', { name: 'Connect wallet' }).click();
await page.locator('#react-portal-modal-container').getByRole('textbox').fill('123456');
await page.getByRole('button', { name: 'Confirm' }).click();

await expect(modal).not.toBeVisible();

await page.getByRole('link', { name: 'Settings' }).click();
await page.getByRole('link', { name: 'Connected Apps' }).click();
await expect(page.getByText('getgems.io')).toBeVisible();
Expand Down

0 comments on commit 4aa2bf1

Please sign in to comment.