Skip to content

Conversation

@sea-snake
Copy link
Contributor

@sea-snake sea-snake commented Dec 1, 2025

Refactor recovery phrase e2e and add more test cases.

Changes

  • Create recovery phrase fixture
  • Create identity fixture
  • Export both merged fixtures as a test instance
  • Use this test instance to refactor recovery phrase tests, directly using the fixtures so we can focus on the logic instead of set-up.
  • Reorganize and add recovery phrase tests, making sure all possible flows are tested.
  • Add aria-label to recovery phrase input boxes so tests can find and fill these boxes.

🟡 Some screens were changed

@sea-snake sea-snake requested review from aterga and Copilot December 1, 2025 15:15
Copilot finished reviewing on behalf of sea-snake December 1, 2025 15:17
Copy link
Contributor

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

This PR refactors the recovery phrase end-to-end tests by introducing reusable Playwright fixtures for common test setup, significantly improving test organization and maintainability. The refactoring creates a Page Object Model pattern for recovery phrase operations and identity management, making the tests more focused on business logic rather than setup code.

Key changes:

  • Introduced two new Playwright fixtures (identity and recoveryPhrasePage) using test.extend() to encapsulate common test setup
  • Expanded test coverage from 3 test scenarios to 23 scenarios, covering activation, verification, reset, and cancellation flows with various retry paths
  • Added aria-label to recovery phrase input boxes for improved accessibility and test reliability

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/frontend/tests/e2e-playwright/fixtures/recovery-phrase-page.ts New fixture providing RecoveryPhrasePage and RecoveryPhraseWizard page objects for interacting with recovery phrase flows
src/frontend/tests/e2e-playwright/fixtures/identity.ts New fixture providing identity sign-in/sign-up functionality with persistent authentication across tests
src/frontend/tests/e2e-playwright/fixtures/index.ts Merges identity and recovery phrase fixtures into a single test instance
src/frontend/tests/e2e-playwright/dashboard/recoveryPhrase.spec.ts Refactored tests using new fixtures, expanding from 3 to 23 test scenarios with better organization
src/frontend/src/lib/components/views/RecoveryPhraseInput.svelte Added aria-label attribute to recovery phrase input boxes using position-based labels
Comments suppressed due to low confidence (1)

src/frontend/tests/e2e-playwright/dashboard/recoveryPhrase.spec.ts:217

  • Unused variable oldWords.
      const oldWords = await recoveryPhrasePage.activate(async (wizard) => {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@aterga aterga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very thorough (and much clearer) testing. Thanks!

@aterga
Copy link
Contributor

aterga commented Dec 1, 2025

Is there a test to show that a non-verified phrase can be reset? Maybe I missed it

@sea-snake
Copy link
Contributor Author

Is there a test to show that a non-verified phrase can be reset? Maybe I missed it

Yes can be reset contains two scenarios (when it is activated and when it is not verified) with the same reset tests.

Copy link
Contributor Author

@sea-snake sea-snake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(only way to get out of review mode was to leave this comment...)

@sea-snake sea-snake added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit ae6b095 Dec 2, 2025
75 checks passed
@sea-snake sea-snake deleted the sea-snake/recovery-phrase-e2e-refactor branch December 2, 2025 10:07
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