-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feat-e2e-convert-to-pw-suite-coinmarket
- Loading branch information
Showing
95 changed files
with
1,733 additions
and
588 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/suite-desktop-core/e2e/support/pageActions/recoverActions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Locator, Page } from '@playwright/test'; | ||
|
||
export class RecoverActions { | ||
readonly selectBasicRecoveryButton: Locator; | ||
|
||
constructor(private page: Page) { | ||
this.selectBasicRecoveryButton = page.getByTestId('@recover/select-type/basic'); | ||
} | ||
|
||
async selectWordCount(number: 12 | 18 | 24) { | ||
await this.page.getByTestId(`@recover/select-count/${number}`).click(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/suite-desktop-core/e2e/support/pageActions/wordInputActions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Locator, Page } from '@playwright/test'; | ||
|
||
import { TrezorUserEnvLink } from '@trezor/trezor-user-env-link'; | ||
|
||
export class WordInputActions { | ||
readonly wordSelectInput: Locator; | ||
|
||
constructor(private page: Page) { | ||
this.wordSelectInput = page.getByTestId('@word-input-select/input'); | ||
} | ||
|
||
async inputWord(word: string) { | ||
await this.wordSelectInput.type(word); | ||
await this.page.getByTestId(`@word-input-select/option/${word}`).click(); | ||
} | ||
|
||
async inputMnemonicT1B1(mnemonic: string[]) { | ||
for (let i = 0; i < 24; i++) { | ||
await this.page.waitForTimeout(400); | ||
const state = await TrezorUserEnvLink.getDebugState(); | ||
const position = state.recovery_word_pos - 1; | ||
await this.inputWord(mnemonic[position]); | ||
} | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
packages/suite-desktop-core/e2e/tests/onboarding/t1b1/t1b1-create-wallet.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { test, expect } from '../../../support/fixtures'; | ||
|
||
test.describe('Onboarding - create wallet', { tag: ['@group=device-management'] }, () => { | ||
test.use({ | ||
emulatorStartConf: { model: 'T1B1', version: '1-latest', wipe: true }, | ||
setupEmulator: false, | ||
}); | ||
|
||
test.beforeEach(async ({ onboardingPage }) => { | ||
await onboardingPage.disableFirmwareHashCheck(); | ||
}); | ||
|
||
test('Success (basic)', async ({ | ||
page, | ||
analyticsPage, | ||
onboardingPage, | ||
devicePrompt, | ||
trezorUserEnvLink, | ||
}) => { | ||
// Pass through analytics and firmware steps | ||
await analyticsPage.passThroughAnalytics(); | ||
await onboardingPage.firmwareContinueButton.click(); | ||
|
||
// Start wallet creation | ||
await page.getByTestId('@onboarding/path-create-button').click(); | ||
|
||
// Confirm on device | ||
await devicePrompt.confirmOnDevicePromptIsShown(); | ||
await trezorUserEnvLink.pressYes(); | ||
|
||
// Skip backup | ||
// It is possible to leave onboarding now | ||
await expect(page.getByTestId('@onboarding/skip-backup')).toBeVisible(); | ||
|
||
// Start backup process | ||
await page.getByTestId('@onboarding/create-backup-button').click(); | ||
|
||
// Check backup completion steps | ||
await page.getByTestId('@backup/check-item/wrote-seed-properly').click(); | ||
await page.getByTestId('@backup/check-item/made-no-digital-copy').click(); | ||
await page.getByTestId('@backup/check-item/will-hide-seed').click(); | ||
await expect(page.getByTestId('@onboarding/confirm-on-device')).not.toBeVisible(); | ||
|
||
await page.getByTestId('@backup/start-button').click(); | ||
await devicePrompt.confirmOnDevicePromptIsShown(); | ||
|
||
for (let i = 0; i < 48; i++) { | ||
await trezorUserEnvLink.pressYes(); | ||
} | ||
|
||
await page.getByTestId('@backup/close-button').click(); | ||
|
||
// Proceed to PIN setup | ||
// Now we are in PIN step, skip button is available | ||
await expect(page.getByTestId('@onboarding/skip-button')).toBeVisible(); | ||
|
||
// Lets set PIN | ||
await page.getByTestId('@onboarding/set-pin-button').click(); | ||
await devicePrompt.confirmOnDevicePromptIsShown(); | ||
await trezorUserEnvLink.pressYes(); | ||
|
||
// Simulate PIN mismatch | ||
await page.getByTestId('@pin/input/1').click(); | ||
await page.getByTestId('@pin/submit-button').click(); | ||
await page.getByTestId('@pin/input/1').click(); | ||
await page.getByTestId('@pin/input/1').click(); | ||
await page.getByTestId('@pin/submit-button').click(); | ||
await expect(page.getByTestId('@pin-mismatch')).toBeVisible(); | ||
await page.getByTestId('@pin-mismatch/try-again-button').click(); | ||
|
||
// Retry PIN setup | ||
await page.getByTestId('@onboarding/confirm-on-device').waitFor({ state: 'visible' }); | ||
await trezorUserEnvLink.pressYes(); | ||
|
||
// Pin matrix appears again | ||
await expect(page.getByTestId('@pin/input/1')).toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.