Repository navigation
Commit d3196e2
authored
test: split mixed settings page objects into one page object per screen (#47790)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Several settings page objects covered more than one screen. For example,
`PrivacySettings` also handled Security and password, the SRP reveal
flow and passkeys, and `PreferencesAndDisplaySettings` also handled
Assets, Language and Account identicon. As a result, those routes had no
page object in the route registry, and the methods were hard to find.
This PR gives each settings screen its own page object:
<img width="715" height="337" alt="image"
src="https://github.com/user-attachments/assets/757ec531-f404-40d0-a572-2fd2001caf1e"
/>
- **Preferences and display:** `LanguageSettings`,
`AccountIdenticonSettings`
- **Security and password:** `SecurityAndPasswordSettings`,
`AutoLockSettings`, `ManageWalletRecoverySettings`,
`RegisterPasskeySettings`, `TurnOffPasskeySettings`, plus
`RevealSrpPage` for `/seed` and `/seed/:keyringId`
- **Privacy:** `ThirdPartyApisSettings`
- **Other tabs:** `AssetsSettings`, `DeveloperToolsSettings`,
`ShieldManagePlanPage`
It also:
- Groups the page objects for tabs with sub-pages into folders
(`preferences-and-display/`, `security-and-password/`, `privacy/`), the
same way `shield/` is organized.
- Moves steps that cross screens into flows: `changeLanguage` and
`openRevealSrp` in `settings.flow.ts`.
- Removes the unused `advanced-settings.ts`.
- Updates the route registry to map these screens. It also maps some
existing page objects that were not registered yet: notification
sections, Shield claim views, rewards, `/confirmation`, snap install,
review permissions, suggested NFT and NFT image.
Route coverage goes to 99 of 146 routes (71%). The specs were updated
only to use the new page objects; what they test is unchanged.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
1. Run `yarn test:e2e:route-coverage` and check that the settings
sub-routes now show a page object.
2. Open the extension and go to Settings > Security and password >
Manage wallet recovery, then pick a Secret Recovery Phrase. Check that
the reveal page still opens.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<img width="604" height="201" alt="image"
src="https://github.com/user-attachments/assets/a5c77ec8-2e7a-4e50-a4b4-99413df34ec4"
/>
<img width="857" height="503" alt="image"
src="https://github.com/user-attachments/assets/43b4494d-e478-47ba-a3c1-68adda47bb22"
/>
### **After**
<img width="576" height="196" alt="image"
src="https://github.com/user-attachments/assets/30e9e808-3e46-4ab7-8656-975e0af41534"
/>
<img width="821" height="663" alt="image"
src="https://github.com/user-attachments/assets/d7d59adc-9e75-4bc2-8c41-ca31afb5c1a6"
/>
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test-only E2E page-object and route-registry refactor with no
production code changes.
>
> **Overview**
> Refactors E2E settings coverage so **each settings screen has its own
page object**, matching Settings V2 layout instead of overloaded helpers
on `PrivacySettings` and `PreferencesAndDisplaySettings`.
>
> **New structure:** folders under `preferences-and-display/`,
`security-and-password/`, and `privacy/`, plus dedicated types such as
`AssetsSettings`, `DeveloperToolsSettings`, `RevealSrpPage`,
`ManageWalletRecoverySettings`, passkey sub-pages,
`ThirdPartyApisSettings`, and `ShieldManagePlanPage`. The monolithic
`privacy-settings.ts`, old preferences file, and unused
`advanced-settings.ts` are removed.
>
> **Flows:** `settings.flow.ts` gains shared steps like
`navigateToSecurityAndPassword`, `openRevealSrp`, and `changeLanguage`;
specs and flows now call the right screen object (e.g. SRP reveal via
`RevealSrpPage` instead of privacy helpers).
>
> **Route registry:** many previously `null` routes now map to page
objects (settings sub-routes, `/seed`, rewards, confirmations, snap
install, etc.). `SettingsPage` drops tab-specific actions that moved to
child objects.
>
> Test behavior is intended to stay the same; only navigation and
page-object boundaries change.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
dbaeedf. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 93f6c52 commit d3196e2
58 files changed
Lines changed: 1548 additions & 1428 deletions
File tree
- test/e2e
- dist
- flask/multi-srp
- page-objects
- flows
- pages
- settings
- preferences-and-display
- privacy
- security-and-password
- shield
- route-registry
- snaps
- tests
- account
- metrics
- multichain
- network
- ppom
- privacy
- seedless-onboarding
- settings
- shield
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 71 | + | |
| 72 | + | |
77 | 73 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
82 | 80 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | | - | |
8 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | | - | |
61 | | - | |
| 64 | + | |
| 65 | + | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
67 | 88 | | |
68 | 89 | | |
69 | 90 | | |
| |||
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
75 | | - | |
76 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
77 | 116 | | |
78 | 117 | | |
79 | 118 | | |
| |||
94 | 133 | | |
95 | 134 | | |
96 | 135 | | |
97 | | - | |
98 | | - | |
| 136 | + | |
99 | 137 | | |
100 | 138 | | |
101 | 139 | | |
| |||
0 commit comments