diff --git a/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts b/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts index 2ee79bb4ba50..b95e9c79c99c 100644 --- a/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts +++ b/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts @@ -42,6 +42,7 @@ export class DashboardPage { readonly openUnusedWalletButton2: Locator; readonly buyButton = (networkSymbol: NetworkSymbol): Locator => this.page.getByTestId(`@dashboard/asset/${networkSymbol}/buy-button`); + readonly walletReady: Locator; constructor( private readonly page: Page, @@ -80,6 +81,7 @@ export class DashboardPage { this.openUnusedWalletButton2 = this.page.getByTestId( '@passphrase-confirmation/step2-button', ); + this.walletReady = this.page.getByTestId('@dashboard/wallet-ready'); } @step() diff --git a/packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts b/packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts index 389650855f53..48e647c328cb 100644 --- a/packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts +++ b/packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts @@ -52,10 +52,14 @@ export class TrezorInput { @step() async enterPinOnBlindMatrix(pinEntryNumber: string) { await test.step('Find number on blind matrix and click it', async () => { - await this.page.waitForTimeout(500); // try to prevent race condition, that happens with t1b1 with node bridge + // try to prevent race condition, that happens with t1b1 with node bridge + await this.page.waitForTimeout(500); + const state = await TrezorUserEnvLinkProxy.getDebugState(); - const index = state.matrix.indexOf(pinEntryNumber) + 1; - await this.pinInput(index).click(); + for (const number of pinEntryNumber) { + const index = state.matrix.indexOf(number) + 1; + await this.pinInput(index).click(); + } await this.pinSubmitButton.click(); }); } diff --git a/packages/suite-desktop-core/e2e/tests/onboarding/t1b1/t1b1-create-wallet.test.ts b/packages/suite-desktop-core/e2e/tests/onboarding/t1b1/t1b1-create-wallet.test.ts index af16f024787f..ec0f173745e6 100644 --- a/packages/suite-desktop-core/e2e/tests/onboarding/t1b1/t1b1-create-wallet.test.ts +++ b/packages/suite-desktop-core/e2e/tests/onboarding/t1b1/t1b1-create-wallet.test.ts @@ -26,7 +26,16 @@ test.describe( priority: TestPriority.Critical, }), }, - async ({ analyticsSection, onboardingPage, devicePrompt, trezorUserEnvLink, page }) => { + async ({ + page, + analyticsSection, + onboardingPage, + settingsPage, + dashboardPage, + devicePrompt, + trezorInput, + trezorUserEnvLink, + }) => { await test.step('Pass through analytics and firmware steps', async () => { await analyticsSection.passThroughAnalytics(); await onboardingPage.firmware.continueThroughFirmware(); @@ -41,10 +50,6 @@ test.describe( await trezorUserEnvLink.pressYes(); }); - await test.step('Skip backup, It is possible to leave onboarding now', async () => { - await expect(onboardingPage.backup.skipBackupButton).toBeVisible(); - }); - await test.step('Start backup process', async () => { await onboardingPage.createBackupButton.click(); }); @@ -54,6 +59,7 @@ test.describe( await onboardingPage.backup.madeNoDigitalCopyCheckbox.click(); await onboardingPage.backup.willHideSeedCheckbox.click(); await devicePrompt.confirmOnDevicePromptIsHidden(); + await onboardingPage.backup.startButton.click(); await devicePrompt.confirmOnDevicePromptIsShown(); @@ -66,33 +72,29 @@ test.describe( await onboardingPage.backup.closeButton.click(); }); - await test.step('Proceed to PIN setup, Now we are in PIN step, skip button is available', async () => { - await expect(onboardingPage.pin.skipButton).toBeVisible(); - }); - await test.step('Lets set PIN', async () => { + const pin = '12345'; + await onboardingPage.pin.setPinButton.click(); await devicePrompt.confirmOnDevicePromptIsShown(); await trezorUserEnvLink.pressYes(); + // enter the PIN + await trezorInput.enterPinOnBlindMatrix(pin); + // re-enter the PIN + await trezorInput.enterPinOnBlindMatrix(pin); }); - await test.step('Simulate PIN mismatch', async () => { - await onboardingPage.pin.pinButton(1).click(); - await onboardingPage.pin.submitButton.click(); - await onboardingPage.pin.pinButton(1).click(); - await onboardingPage.pin.pinButton(1).click(); - await onboardingPage.pin.submitButton.click(); - await expect(onboardingPage.pin.pinMismatch).toBeVisible(); - await onboardingPage.pin.tryAgainButton.click(); - }); - - await test.step('Retry PIN setup', async () => { - await devicePrompt.confirmOnDevicePromptIsShown(); - await trezorUserEnvLink.pressYes(); + await test.step('Activate assets & continue setup', async () => { + await expect(settingsPage.coins.networkButton('btc')).toBeEnabledCoin(); + await expect(settingsPage.coins.networkButton('eth')).toBeDisabledCoin(); + await settingsPage.coins.enableNetwork('eth'); + await onboardingPage.continueCoinsButton.click(); }); - await test.step('Pin matrix appears again', async () => { - await expect(onboardingPage.pin.pinButton(1)).toBeVisible(); + await test.step('Finish wallet creation', async () => { + await expect(onboardingPage.finalTitle).toBeVisible(); + await onboardingPage.onboardingContinueButton.click(); + await expect(dashboardPage.walletReady).toBeVisible(); }); }, );