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

Conversation

tatsiosh
Copy link
Contributor

@tatsiosh tatsiosh commented Dec 9, 2024

No description provided.

Copy link

github-actions bot commented Dec 9, 2024

Successful TWA deployment 🚀🚀🚀

Well done!
Link to test environment:
https://t.me/tonkeeperdevbot

Copy link

github-actions bot commented Dec 9, 2024

Successful WEB deployment 🚀🚀🚀

Well done!
Link to test environment:
https://dec3a85d.tonkeeper-web.pages.dev

Copy link

github-actions bot commented Dec 9, 2024

Playwright test results

failed  5 failed
passed  56 passed
flaky  4 flaky

Details

stats  65 tests across 35 suites
duration  5 minutes, 2 seconds
commit  157f2aa

Failed tests

chromium › AddBitGet.spec.ts › BITGET
chromium › BuyTon.spec.ts › Buy TON on main screen
chromium › Multisig.spec.ts › Create new multisig
chromium › Multisig.spec.ts › Send request
chromium › TestnetAccounts/Testnet.spec.ts › Add 2 testnets

Flaky tests

chromium › Add2WalletsAndDeleteInABulk/2 wallets & bulk delete.spec.ts › 2 wallets & bulk delete
chromium › ElementsVisibility/FullFlow.spec.ts › Full flow elements
chromium › ElementsVisibility/NavigationSidebarElements.spec.ts › History tab
chromium › ElementsVisibility/NavigationSidebarElements.spec.ts › Swap

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();
await expect(page.getByText('UQC2…1-Ly · 0 TON')).toBeVisible();
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.getByText('Mercuryo')).toBeVisible();
await expect(page.getByText('Instant one-click purchase up')).toBeVisible();
await expect(page.locator('.sc-evBeLY').first()).toBeVisible();
await expect(page.locator('div').filter({ hasText: /^NeocryptoInstantly buy with a credit card$/ }).nth(2)).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

The exact items on this list depend of the country,
For test better to check is there something in this list?
and make an exception if list is empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I`ll need help here

await expect(page.locator('#react-portal-modal-container')).toContainText('Tonkeeper Pro\'s subscription comes with an extended wallet feature, offering a toolset for crypto management.');
await expect(page.locator('div').filter({ hasText: /^trust wallet - 12 words mnemonic🤖UQBC…_BrRW5$/ }).nth(2)).toBeVisible();
await expect(page.getByText('Yearly Pro Package')).toBeVisible();
await expect(page.getByText('8.00 TON')).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Price could be changed, for my perspective better to not check the amount

Better to check that, list of plan's is not empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To fix the test (changing the price of the package) is a very quick and easy indeed. I wanna check max possible fields. we can add additional check that, list of plan's is not empty as well

@KuznetsovNikita KuznetsovNikita force-pushed the tests/add_tests_to_playwright branch from eed6c04 to 157f2aa Compare December 10, 2024 13:11
await page.getByRole('button', { name: 'Testnet Account Import wallet' }).click();
await page.getByLabel('1:', { exact: true }).fill(process.env.TON_MNEMONIC_ANANAS);
await page.getByRole('button', { name: 'Continue' }).click();
await expect(page.getByText('0QBW…lsqP · 0 TON')).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

There the same, amount of ton cloud be changed, better to check only address

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed

await page.getByRole('link', { name: 'Swap' }).click();
await expect(page.getByText('Swap').nth(1)).toBeVisible();
await expect(page.locator('#root')).toContainText('Swap');
await expect(page.locator('.sc-cDYBfd > button').first()).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This selector is not stable, let's create an id or test-id for this element

await page.getByRole('link', { name: 'Multisig Wallets' }).click();
await expect(page.getByRole('button', { name: 'New Multisig Wallet' })).toBeVisible();
await expect(page.locator('#root')).toContainText('New Multisig Wallet');
await expect(page.locator('.sc-kLKjoy > button').first()).toBeVisible();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This selector is not stable, let's create an id or test-id for this element

await expect(page.getByText('👩‍💼Multisig UQBL…v_kAUQBL…')).toBeVisible();

await page.locator('.sc-kLKjoy > .sc-bXDltw').first().click();
await expect(page.locator('#root')).toContainText('👩‍💼Multisig UQBL…v_kAMultisig');
Copy link
Collaborator

@KuznetsovNikita KuznetsovNikita Dec 10, 2024

Choose a reason for hiding this comment

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

Three a lot's of Multisigs, butter to clarify selection

Expected string: "👩‍💼Multisig UQBL…v_kAMultisig" 

Received string: "Multisig UQBv…0IRaUQBv…0IRaMultisig👨‍🍳DashboardDiscover🍍Account 1UQBA…OP8VW5UQDH…TkZ5W5 betaUQD2…GzCiv4R2👨‍🍳Multisig UQBv…0IRaMultisigUQDj…pOuvv3R2UQBW…lnEFv3R1Add WalletPreferencesGet Pro$ 0.57SendReceiveBuyTokensHistoryCollectiblesDomainsSwapRequestsSettingsTokensTON0.09$ 5.79 −10.35%$ 0.57"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn`t get it

Copy link

Successful swap widget deployment 🚀🚀🚀

Well done!
Link to test environment:
https://8e84f663.tonkeeper-swap-widget.pages.dev

Copy link

Playwright test results

failed  11 failed
passed  52 passed
flaky  2 flaky

Details

stats  65 tests across 35 suites
duration  6 minutes, 31 seconds
commit  86a311f

Failed tests

chromium › AddBitGet.spec.ts › BITGET
chromium › Backup.spec.ts › Backup
chromium › BuyTon.spec.ts › Buy TON on main screen
chromium › ElementsVisibility/NavigationSidebarElements.spec.ts › Swap
chromium › ElementsVisibility/NavigationSidebarElements.spec.ts › Multisig
chromium › Multisig.spec.ts › Create new multisig
chromium › Multisig.spec.ts › Send request
chromium › NFT screen.spec.ts › Discover tab
chromium › Subscription/BuyPro.spec.ts › Buy PRO
chromium › TestnetAccounts/Testnet.spec.ts › Add 2 testnets
chromium › TestnetAccounts/TestnetElements.spec.ts › Testnet elements

Flaky tests

chromium › Add2WalletsAndDeleteInABulk/2 wallets & bulk delete.spec.ts › 2 wallets & bulk delete
chromium › PinToken.spec.ts › Pin 2 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants