Skip to content
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

test: [POM] Migrate hardware wallet e2e tests to follow Page Object Model #28768

Merged
merged 21 commits into from
Dec 12, 2024

Conversation

chloeYue
Copy link
Contributor

@chloeYue chloeYue commented Nov 27, 2024

Description

  • Create base pages for hardware wallet related pages
  • Migrate hardware wallet e2e tests to Page Object Model
  • Remove dead code (We should not keep unused functions in the codebase because they can lead to several issues, such as increased maintenance overhead, added complexity, potential bugs, and misleading information.)

Open in GitHub Codespaces

Related issues

Fixes: #28808

Manual testing steps

Check code readability, make sure tests pass.

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

@chloeYue chloeYue added the team-extension-platform Extension Platform team label Nov 27, 2024
@chloeYue chloeYue self-assigned this Nov 27, 2024
@chloeYue chloeYue requested a review from a team as a code owner November 27, 2024 13:03
@chloeYue chloeYue marked this pull request as draft November 27, 2024 13:03
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot
Copy link
Collaborator

Builds ready [9182760]
Page Load Metrics (1702 ± 69 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30521011635337162
domContentLoaded15062073167214268
load15462104170214469
domInteractive25109372210
backgroundConnect96030178
firstReactRender17166613919
getState485242914
initialActions01000
loadScripts11191579123612460
setupStore66313168
uiStartup172324862004220106
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [2eb0cfd]
Page Load Metrics (1911 ± 78 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint17642341191615775
domContentLoaded17442194186812761
load17662358191116378
domInteractive25583394
backgroundConnect10261475828
firstReactRender15382073
getState884411458541
initialActions01000
loadScripts13411759145111254
setupStore6421084
uiStartup201331892229290139
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@chloeYue chloeYue changed the title test: DRAFT Hardware wallet migration test: [POM] Migrate hardware wallet e2e tests to follow Page Object Model Dec 5, 2024
*/
async signTypedDataV4() {
async signTypedDataV4(confirmationRedesign: boolean = false) {
Copy link
Contributor Author

@chloeYue chloeYue Dec 5, 2024

Choose a reason for hiding this comment

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

Keep the confirmationRedesign as a parameter as a temporary solution, will do the refacto once the redesign toggle is removed, as planned in MetaMask-planning issue #3030.

@metamaskbot
Copy link
Collaborator

Builds ready [524a8fb]
Page Load Metrics (2034 ± 106 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint53224931952389187
domContentLoaded166424472008212102
load167424982034220106
domInteractive25114422311
backgroundConnect1078242010
firstReactRender1696282211
getState1022931525627
initialActions01000
loadScripts12491881156018589
setupStore78312168
uiStartup191129252393319153
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [89e2f7a]
Page Load Metrics (1625 ± 36 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1502177416307837
domContentLoaded1489173516107134
load1497176716257636
domInteractive236332136
backgroundConnect84516126
firstReactRender148918168
getState732981154321
initialActions00000
loadScripts1154138012686732
setupStore625842
uiStartup16922459186016077
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@chloeYue chloeYue marked this pull request as ready for review December 9, 2024 09:27
@hjetpoluru hjetpoluru self-requested a review December 9, 2024 17:51
hjetpoluru
hjetpoluru previously approved these changes Dec 9, 2024
Copy link
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

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

Nice job @chloeYue, I notice minot observation otherwise everything is looking good.

@hjetpoluru hjetpoluru self-requested a review December 9, 2024 18:06
hjetpoluru
hjetpoluru previously approved these changes Dec 9, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [bc3c4e1]
Page Load Metrics (1862 ± 92 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint74123111795304146
domContentLoaded15782293184419091
load15862314186219392
domInteractive24212504723
backgroundConnect76322168
firstReactRender159122168
getState723911296330
initialActions00000
loadScripts12241919142717785
setupStore719831
uiStartup178026952127246118
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [d31ac54]
Page Load Metrics (1931 ± 63 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint56121981863326156
domContentLoaded16172163190512661
load16212200193113163
domInteractive266140126
backgroundConnect764262110
firstReactRender1790282110
getState1063091465326
initialActions01000
loadScripts12171767149112158
setupStore713921
uiStartup187628552278213102
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@dbrans dbrans self-assigned this Dec 10, 2024
Copy link
Contributor

@dbrans dbrans left a comment

Choose a reason for hiding this comment

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

Nice work, Chloe!

const testDappPage = new TestDappPage(driver);
await testDappPage.openTestDappPage();
await testDappPage.check_pageIsLoaded();
await testDappPage.signTypedDataV4(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think passing an object with the flag name, would make it clearer what this boolean is actually indicating. However given that handling redesign/no-redesign is temporary I think it's fine as it is

Copy link
Contributor Author

@chloeYue chloeYue Dec 12, 2024

Choose a reason for hiding this comment

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

yeah it's a very temporary solution. Let's wait for the removal of the toggle as planned in this ticket, and then we can refactor the redesign together with other parts of the testing code to keep them coherent.

Copy link
Contributor

@seaona seaona left a comment

Choose a reason for hiding this comment

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

LGTM!!

@chloeYue chloeYue added this pull request to the merge queue Dec 12, 2024
Merged via the queue into main with commit c065d93 Dec 12, 2024
75 checks passed
@chloeYue chloeYue deleted the hardware-wallet-migration branch December 12, 2024 15:13
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
@metamaskbot metamaskbot added the release-12.10.0 Issue or pull request that will be included in release 12.10.0 label Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.10.0 Issue or pull request that will be included in release 12.10.0 team-extension-platform Extension Platform team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[POM] Create base classes for hardware wallet e2e tests
5 participants