Skip to content

Commit 4b55aca

Browse files
committed
test: update ae tests
1 parent 2fba5ba commit 4b55aca

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

tests/e2e/playwright/tests/SH_wallet_web.spec.ts

+17-14
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ test.describe('SH Wallet checks', () => {
272272
const page2Promise = page.waitForEvent('popup');
273273
await page.locator('//div[@class="account-row"]').click();
274274
const page2 = await page2Promise;
275-
let aeScanBalance: string = await page2.locator('//tr[@class="account-details-panel__row"]//div[@class="price-label"]').first()
275+
let aeScanBalance: string = await page2.locator('//div[@class="price-label"]//div//span').first()
276276
.textContent() as string;
277277
// Convert the balance string from aeScan
278278
// to the same format as it is in the Wallet account details page
@@ -313,7 +313,7 @@ test.describe('SH Wallet checks', () => {
313313
await page.locator('//div[@class="account-row"]').click();
314314
const page2 = await page2Promise;
315315
await page.waitForTimeout(5000);
316-
let aeScanBalance: string = await page2.locator('//tr[@class="account-details-panel__row"]//div[@class="price-label"]').first()
316+
let aeScanBalance: string = await page2.locator('//div[@class="price-label"]//div//span').first()
317317
.textContent() as string;
318318
// Convert the balance string from aeScan
319319
// to the same format as it is in the Wallet account details page
@@ -678,25 +678,27 @@ test.describe('SH Wallet checks', () => {
678678
// Open send and make transaction
679679
await page.getByRole('button', { name: 'Send assets to others' }).click();
680680
await page.locator('//textarea[@data-cy="textarea"]').fill(secAeAccAddress);
681+
await page.keyboard.press('Enter');
681682
await page.locator('//input[@name="amount"]').fill(txnValue.toString());
682683
// Read txn fee value
683684
await page.waitForTimeout(3000);
684685
const txnFeeValueStr = await page.locator('//span[@data-cy="review-fee"]//span[@class="amount"]').textContent() as string;
685686
const txnFeeValue = parseFloat(txnFeeValueStr);
686687
await page.locator('//button[@data-cy="next-step-button"]').click();
687688
await page.waitForTimeout(500);
688-
await eyes.check('Review transaction', Target.window().fully());
689689

690690
// Go back check values for editing
691691
await page.getByRole('button', { name: 'Edit' }).click();
692-
await expect(page.locator('//textarea[@data-cy="textarea"]')).toHaveValue(secAeAccAddress);
692+
await expect(page.locator('//label[@data-cy="input-wrapper"]//div[@class="address-truncated-chunks"]')).toContainText('ak_2Ek···Up9');
693693
await expect(page.locator('//input[@name="amount"]')).toHaveValue(txnValue.toString());
694694
await page.waitForTimeout(5000);
695695
await page.locator('//button[@data-cy="next-step-button"]').click();
696696

697697
// Open Review transaction screen. Check address and ae amounts
698698
await expect(page.locator('#app-wrapper')).toContainText(aeAccAddress);
699+
await page.getByRole('button', { name: 'Show 1 recipients ' }).click();
699700
await expect(page.locator('#app-wrapper')).toContainText(secAeAccAddress);
701+
await eyes.check('Review transaction', Target.window().fully());
700702
await expect(page.getByTestId('review-amount')).toContainText(`${txnValue.toString()} AE`);
701703
await page.waitForTimeout(500);
702704
await expect(page.locator('//div[@class="transfer-review-base transfer-review"]//span[@data-cy="review-fee"]//span[@class="amount"]')).toContainText(txnFeeValueStr);
@@ -900,7 +902,7 @@ test.describe('SH Wallet checks', () => {
900902
await page.getByRole('button', { name: 'Show multisig vaults' }).click();
901903
await revokePendingProposal(page, expect);
902904
// Check Show multisig screen
903-
await expect(page.locator('//span[text()="ak_2Mw"]')).toBeVisible({ timeout: 12000 });
905+
await expect(page.locator('//span[text()="ak_2Hj"]')).toBeVisible({ timeout: 12000 });
904906
await expect.soft(page.getByText('Total in multisig vaults')).toBeVisible();
905907
await expect(page.getByRole('button', { name: 'Receive to multisig vault' })).toBeVisible();
906908
await expect(page.getByRole('button', { name: 'Propose Tx to other signers' })).toBeVisible();
@@ -940,7 +942,6 @@ test.describe('SH Wallet checks', () => {
940942
await revokePendingProposal(page, expect);
941943
await page.locator('//a[@data-cy="account-card-base"]//div[text()="Multisig vault"]').nth(0).click();
942944
// Check receive screen
943-
await expect(page.locator('//span[text()="ak_2Mw"]')).toBeVisible({ timeout: 10000 });
944945
await page.locator('//div[@class="horizontal-scroll buttons"]//button[@data-cy="receive"]').click();
945946
await expect(page.getByRole('heading')).toContainText('Receive funds to multisig vault');
946947
// Enter some number into amount field so the link under QR code will be
@@ -976,7 +977,7 @@ test.describe('SH Wallet checks', () => {
976977
// Check if a transaction proposal is awaiting
977978
await revokePendingProposal(page, expect);
978979
// Check propose txn screen
979-
await expect(page.locator('//span[text()="ak_2Mw"]')).toBeVisible({ timeout: 15000 });
980+
await expect(page.locator('//span[text()="ak_2Hj"]')).toBeVisible({ timeout: 15000 });
980981
await page.locator('//a[@data-cy="account-card-base"]//div[text()="Multisig vault"]').nth(0).click();
981982
await page.locator('//div[@class="horizontal-scroll buttons"]//span[text()="Propose Tx"]').click();
982983
await expect(page.getByRole('heading')).toContainText('Multisig transaction proposal', { timeout: 8000 });
@@ -998,8 +999,10 @@ test.describe('SH Wallet checks', () => {
998999
.toContainText('This field is required');
9991000
// Incorrect address string
10001001
await page.locator('//textarea[@data-cy="textarea"]').fill('12345678');
1002+
await page.keyboard.press('Enter');
10011003
await expect(page.locator('//div[@data-cy="address"]//label[@data-cy="input-field-message"]'))
10021004
.toContainText('Invalid address or .chain name');
1005+
await page.getByTestId('clear-address-button').nth(1).click();
10031006
// Send amount over max available
10041007
await page.locator('//input[@name="amount"]').fill('12345678');
10051008
await page.locator('//textarea[@data-cy="textarea"]').click();
@@ -1045,7 +1048,7 @@ test.describe('SH Wallet checks', () => {
10451048
// Multisig Tx proposal details after sending
10461049
await expect(page.getByTestId('loader')).not.toBeVisible({ timeout: 25000 });
10471050
await expect(page.locator('//div[@class="consensus"]//div[@class="info-box success"]')).toContainText('Transaction has been successfully sent.', { timeout: 20000 });
1048-
await page.waitForTimeout(500);
1051+
await page.waitForTimeout(800);
10491052
await expect(page.locator('//div[@class="payload-text"]')).toContainText('Hello. This is a test!');
10501053
await eyes.check('Multisig Tx proposal details', Target.region(page.locator('//div[@class="multisig-proposal-details"]/parent::ion-content')).fully());
10511054
});
@@ -1059,7 +1062,7 @@ test.describe('SH Wallet checks', () => {
10591062
// Check if a transaction proposal is awaiting
10601063
await revokePendingProposal(page, expect);
10611064
// Select current multisig account
1062-
await expect(page.locator('//span[text()="ak_2Mw"]')).toBeVisible({ timeout: 10000 });
1065+
await expect(page.locator('//span[text()="ak_2Hj"]')).toBeVisible({ timeout: 10000 });
10631066
await page.locator('//a[@data-cy="account-card-base"]//div[text()="Multisig vault"]').nth(0).click();
10641067
// Check propose txn screen
10651068
await page.locator('//div[@class="horizontal-scroll buttons"]//span[text()="Propose Tx"]').click();
@@ -1095,7 +1098,7 @@ test.describe('SH Wallet checks', () => {
10951098
// Check if a transaction proposal is awaiting
10961099
await revokePendingProposal(page, expect);
10971100
// Select current multisig account
1098-
await expect(page.locator('//span[text()="ak_2Mw"]')).toBeVisible({ timeout: 12000 });
1101+
await expect(page.locator('//span[text()="ak_2Hj"]')).toBeVisible({ timeout: 12000 });
10991102
await page.locator('//a[@data-cy="account-card-base"]//div[text()="Multisig vault"]').nth(0).click();
11001103
// Check propose txn screen
11011104
await page.locator('//div[@class="horizontal-scroll buttons"]//span[text()="Propose Tx"]').click();
@@ -1148,10 +1151,10 @@ test.describe('SH Wallet checks', () => {
11481151
await page.waitForTimeout(5000);
11491152
await page.locator('//div[@class="claim"]//div[@class="label-text"]').focus();
11501153
await page.locator('//div[@class="claim"]//button').nth(1).click();
1151-
await page.locator('//button[@data-cy="accept"]').click();
1152-
await page.locator('//button[@data-cy="accept"]').click({ timeout: 20000 });
1154+
// await page.locator('//button[@data-cy="accept"]').click();
1155+
// await page.locator('//button[@data-cy="accept"]').click({ timeout: 20000 });
11531156
// Chosen chain name should appear in the Names list with status pending
1154-
await expect(page.getByText(newChainName)).toBeVisible({ timeout: 25000 });
1157+
await expect(page.getByText(newChainName)).toBeVisible({ timeout: 35000 });
11551158
await expect(page.locator('//div[@class="pending"]')).toBeVisible();
11561159
// Currently the pending status take very long
11571160
// await expect.soft(page.locator('//span[text()="Name update successful!"]'))
@@ -1164,7 +1167,7 @@ test.describe('SH Wallet checks', () => {
11641167

11651168
await switchToTestnet(page, expect);
11661169
await page.getByTestId('account-card-base').first().click();
1167-
await page.locator('//div[@data-cy="list"]//a').isVisible();
1170+
await page.locator('//div[@data-cy="list"]//a').first().isVisible();
11681171
await page.waitForTimeout(2000);
11691172
await page.locator('//div[@data-cy="list"]//a').last().focus();
11701173
await expect(page.locator('//div[@class="back-to-top-btn-container"]//button')).toBeVisible();

0 commit comments

Comments
 (0)