-
-
Notifications
You must be signed in to change notification settings - Fork 316
refactor(e2e-suite): onboarding t1b1 create wallet #22221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
readonly coinButton = (networkSymbol: NetworkSymbol): Locator => | ||
this.page.getByTestId(`@settings/wallet/network/${networkSymbol}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate of locator in page object CoinsTab
packages/suite-desktop-core/e2e/support/pageObjects/settings/coinsTab.ts:9. Let's use that one π
|
||
@step() | ||
async verifyCoinButtonActive( | ||
networkSymbol: NetworkSymbol, | ||
expectedState: boolean, | ||
): Promise<void> { | ||
const expectedAttributeValue = expectedState ? 'true' : 'false'; | ||
|
||
await expect(this.coinButton(networkSymbol)).toHaveAttribute( | ||
'data-active', | ||
expectedAttributeValue, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aahh, I am sorry. This is already existing in our code base
in customMatchers
packages/suite-desktop-core/e2e/support/testExtends/customMatchers.ts:107 and 120
await settingsPage.verifyCoinButtonActive('btc', true); | ||
await settingsPage.verifyCoinButtonActive('eth', false); | ||
await settingsPage.coinButton('eth').click(); | ||
await settingsPage.verifyCoinButtonActive('eth', true); | ||
await onboardingPage.continueCoinsButton.click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after the change of netowrks is there a discovery triggered or not?
If yes we can reuse method changeNetworks for this whole change π
packages/suite-desktop-core/e2e/support/pageObjects/settings/settingsPage.ts:224
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvement of test value, there few existing methods and matchers that you can use here instead of creating new ones π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Extends the T1B1 onboarding end-to-end test to cover the full wallet creation flow including PIN setup, coin activation, and transition to the dashboard. Adds supporting page object helpers for coin activation state checks, PIN entry iteration, and a dashboard readiness locator.
- Adds full onboarding path: backup -> PIN -> asset activation -> finish
- Refactors PIN entry to handle multi-digit input sequentially
- Introduces helpers for verifying/activating coins and detecting wallet readiness
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/suite-desktop-core/e2e/tests/onboarding/t1b1/t1b1-create-wallet.test.ts | Extends test to complete full onboarding (PIN, coin activation, finish). |
packages/suite-desktop-core/e2e/support/pageObjects/trezorInput.ts | Refactors PIN entry to iterate digits sequentially. |
packages/suite-desktop-core/e2e/support/pageObjects/settings/settingsPage.ts | Adds coin button locator and method to assert activation state. |
packages/suite-desktop-core/e2e/support/pageObjects/dashboardPage.ts | Adds locator to assert wallet readiness after onboarding. |
// try to prevent race condition, that happens with t1b1 with node bridge | ||
await this.page.waitForTimeout(500); | ||
for (const number of pinEntryNumber) { | ||
const state = await TrezorUserEnvLinkProxy.getDebugState(); | ||
const index = state.matrix.indexOf(number) + 1; | ||
await this.pinInput(index).click(); | ||
} |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside the loop a fresh debug state is fetched for every digit and a fixed 500 ms sleep is used up front. This adds unnecessary latency and flakiness. Consider: (1) wait explicitly for the PIN matrix element instead of a fixed timeout, (2) retrieve the debug state once before the loop (matrix should remain stable for a single PIN entry), (3) optionally assert index !== -1 before clicking. Example refactor: const state = await TrezorUserEnvLinkProxy.getDebugState(); for (const digit of pin) { const pos = state.matrix.indexOf(digit); expect(pos).toBeGreaterThan(-1); await this.pinInput(pos + 1).click(); }
Copilot uses AI. Check for mistakes.
34797b3
to
67907f4
Compare
Description
Adding the steps to finish entire use case
ππ₯οΈ Suite web test results: View in Currents
ππ₯οΈ Suite desktop test results: View in Currents