From 0c7ae35a493264409fe55a5602f84dd05e1c6c7e Mon Sep 17 00:00:00 2001 From: ost-ptk Date: Wed, 11 Sep 2024 16:10:42 +0300 Subject: [PATCH] fix onboarding e2e tests --- e2e-tests/constants.ts | 2 +- .../recover-secret-phrase-flow.spec.ts | 24 ++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/e2e-tests/constants.ts b/e2e-tests/constants.ts index 05b7d7c91..51248a82c 100644 --- a/e2e-tests/constants.ts +++ b/e2e-tests/constants.ts @@ -78,7 +78,7 @@ export const RECOVER_FIRST_ACCOUNT_FROM_TWELVE_WORDS = { }; export const RECOVER_SECOND_ACCOUNT_FROM_TWELVE_WORDS = { - accountName: 'Account 1', + accountName: 'Account 2', publicKey: '02022cafccfb61ffc4e4221e4d2c38eec6035d579d04c1396b1c2027dc0729c53589', truncatedPublicKey: '02022...53589' diff --git a/e2e-tests/onboarding-flow/recover-secret-phrase-flow.spec.ts b/e2e-tests/onboarding-flow/recover-secret-phrase-flow.spec.ts index 45d22d064..73d7f8d49 100644 --- a/e2e-tests/onboarding-flow/recover-secret-phrase-flow.spec.ts +++ b/e2e-tests/onboarding-flow/recover-secret-phrase-flow.spec.ts @@ -50,7 +50,9 @@ onboarding.describe('Onboarding UI: recover secret phrase flow', () => { await page.getByText('All accounts').click(); await onboardingExpect( - page.getByText(DEFAULT_FIRST_ACCOUNT.accountName) + page + .getByText(DEFAULT_FIRST_ACCOUNT.accountName, { exact: true }) + .nth(1) ).toBeVisible(); await onboardingExpect( page.getByText(DEFAULT_FIRST_ACCOUNT.truncatedPublicKey).nth(0) @@ -100,10 +102,12 @@ onboarding.describe('Onboarding UI: recover secret phrase flow', () => { await page.getByText('All accounts').click(); await onboardingExpect( - page.getByText(DEFAULT_FIRST_ACCOUNT.accountName) + page + .getByText(DEFAULT_FIRST_ACCOUNT.accountName, { exact: true }) + .nth(1) ).toBeVisible(); await onboardingExpect( - page.getByText(DEFAULT_FIRST_ACCOUNT.truncatedPublicKey).nth(0) + page.getByText(DEFAULT_FIRST_ACCOUNT.truncatedPublicKey).nth(1) ).toBeVisible(); await onboardingExpect( page.getByText(DEFAULT_SECOND_ACCOUNT.accountName) @@ -158,7 +162,11 @@ onboarding.describe('Onboarding UI: recover secret phrase flow', () => { await page.getByText('All accounts').click(); await onboardingExpect( - page.getByText(RECOVER_FIRST_ACCOUNT_FROM_TWELVE_WORDS.accountName) + page + .getByText(RECOVER_FIRST_ACCOUNT_FROM_TWELVE_WORDS.accountName, { + exact: true + }) + .nth(1) ).toBeVisible(); await onboardingExpect( page @@ -213,12 +221,16 @@ onboarding.describe('Onboarding UI: recover secret phrase flow', () => { await page.getByText('All accounts').click(); await onboardingExpect( - page.getByText(RECOVER_FIRST_ACCOUNT_FROM_TWELVE_WORDS.accountName) + page + .getByText(RECOVER_FIRST_ACCOUNT_FROM_TWELVE_WORDS.accountName, { + exact: true + }) + .nth(1) ).toBeVisible(); await onboardingExpect( page .getByText(RECOVER_FIRST_ACCOUNT_FROM_TWELVE_WORDS.truncatedPublicKey) - .nth(0) + .nth(1) ).toBeVisible(); await onboardingExpect( page.getByText(RECOVER_SECOND_ACCOUNT_FROM_TWELVE_WORDS.accountName)