Skip to content

Conversation

zako05
Copy link
Contributor

@zako05 zako05 commented Oct 6, 2025

Description

Adding the steps to finish entire use case

  • set up PIN
  • activate asset / coin
  • finish wallet creation

πŸ”πŸ–₯️ Suite web test results: View in Currents

πŸ”πŸ–₯️ Suite desktop test results: View in Currents

@zako05 zako05 self-assigned this Oct 6, 2025
Comment on lines +86 to +87
readonly coinButton = (networkSymbol: NetworkSymbol): Locator =>
this.page.getByTestId(`@settings/wallet/network/${networkSymbol}`);
Copy link
Contributor

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 πŸ‘

Comment on lines +260 to +272

@step()
async verifyCoinButtonActive(
networkSymbol: NetworkSymbol,
expectedState: boolean,
): Promise<void> {
const expectedAttributeValue = expectedState ? 'true' : 'false';

await expect(this.coinButton(networkSymbol)).toHaveAttribute(
'data-active',
expectedAttributeValue,
);
}
Copy link
Contributor

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

Comment on lines +89 to +93
await settingsPage.verifyCoinButtonActive('btc', true);
await settingsPage.verifyCoinButtonActive('eth', false);
await settingsPage.coinButton('eth').click();
await settingsPage.verifyCoinButtonActive('eth', true);
await onboardingPage.continueCoinsButton.click();
Copy link
Contributor

@Vere-Grey Vere-Grey Oct 6, 2025

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

Copy link
Contributor

@Vere-Grey Vere-Grey left a 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 πŸ‘

@Vere-Grey Vere-Grey requested a review from Copilot October 6, 2025 17:00
Copy link

@Copilot Copilot AI left a 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.

Comment on lines +55 to +61
// 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();
}
Copy link

Copilot AI Oct 6, 2025

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.

@Vere-Grey Vere-Grey force-pushed the test/refactor-onboarding-t1b1-create-wallet branch from 34797b3 to 67907f4 Compare October 6, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants