diff --git a/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts b/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts index b95e9c79c99c..2ee79bb4ba50 100644 --- a/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts +++ b/packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts @@ -42,7 +42,6 @@ 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, @@ -81,7 +80,6 @@ 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 48e647c328cb..389650855f53 100644 --- a/packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts +++ b/packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts @@ -52,14 +52,10 @@ export class TrezorInput { @step() async enterPinOnBlindMatrix(pinEntryNumber: string) { await test.step('Find number on blind matrix and click it', async () => { - // try to prevent race condition, that happens with t1b1 with node bridge - await this.page.waitForTimeout(500); - + await this.page.waitForTimeout(500); // try to prevent race condition, that happens with t1b1 with node bridge const state = await TrezorUserEnvLinkProxy.getDebugState(); - for (const number of pinEntryNumber) { - const index = state.matrix.indexOf(number) + 1; - await this.pinInput(index).click(); - } + const index = state.matrix.indexOf(pinEntryNumber) + 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 ec0f173745e6..af16f024787f 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,16 +26,7 @@ test.describe( priority: TestPriority.Critical, }), }, - async ({ - page, - analyticsSection, - onboardingPage, - settingsPage, - dashboardPage, - devicePrompt, - trezorInput, - trezorUserEnvLink, - }) => { + async ({ analyticsSection, onboardingPage, devicePrompt, trezorUserEnvLink, page }) => { await test.step('Pass through analytics and firmware steps', async () => { await analyticsSection.passThroughAnalytics(); await onboardingPage.firmware.continueThroughFirmware(); @@ -50,6 +41,10 @@ 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(); }); @@ -59,7 +54,6 @@ test.describe( await onboardingPage.backup.madeNoDigitalCopyCheckbox.click(); await onboardingPage.backup.willHideSeedCheckbox.click(); await devicePrompt.confirmOnDevicePromptIsHidden(); - await onboardingPage.backup.startButton.click(); await devicePrompt.confirmOnDevicePromptIsShown(); @@ -72,29 +66,33 @@ test.describe( await onboardingPage.backup.closeButton.click(); }); - await test.step('Lets set PIN', async () => { - const pin = '12345'; + 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 () => { 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('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('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('Finish wallet creation', async () => { - await expect(onboardingPage.finalTitle).toBeVisible(); - await onboardingPage.onboardingContinueButton.click(); - await expect(dashboardPage.walletReady).toBeVisible(); + await test.step('Pin matrix appears again', async () => { + await expect(onboardingPage.pin.pinButton(1)).toBeVisible(); }); }, );