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 vault decryption e2e tests to TS and Page Object Model #28419

Merged
merged 28 commits into from
Nov 15, 2024

Conversation

chloeYue
Copy link
Contributor

@chloeYue chloeYue commented Nov 12, 2024

Description

  • Migrate e2e tests test/e2e/vault-decryption-chrome.spec.js to TS and Page Object Model, this test runs only on develop branch, by migrating to POM, we improve the maintainability.
  • Create page classe functions for vault decryption page, so we can use that in the future when needed
  • Deprecate/remove old functions in helper.js
  • Improved testing logs to make it easier to debug. See testing logs on this branch:

Screenshot 2024-11-13 at 10 11 41

Open in GitHub Codespaces

Related issues

Fixes: #28431

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 self-assigned this Nov 12, 2024
@chloeYue chloeYue requested a review from a team as a code owner November 12, 2024 09:06
@chloeYue chloeYue marked this pull request as draft November 12, 2024 09:06
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 [c1e6432]
Page Load Metrics (1908 ± 95 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31022951743472226
domContentLoaded16172282188218790
load16502297190819895
domInteractive16184543416
backgroundConnect9101312512
firstReactRender593281286531
getState56416168
initialActions01000
loadScripts11611758139417283
setupStore675172110
uiStartup185729952181274132
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@chloeYue chloeYue changed the title test: Migrate vault decrption tests test: [POM] Migrate vault decrption e2e tests to use Page Object Model Nov 13, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [b18fee1]
Page Load Metrics (2138 ± 186 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint90134432050452217
domContentLoaded173134302106397191
load174034442138388186
domInteractive20169633316
backgroundConnect888282311
firstReactRender742941164421
getState563262311
initialActions00000
loadScripts124028231571362174
setupStore65615168
uiStartup193636802379405194
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [1fc9eb9]
Page Load Metrics (1672 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15092005169312560
domContentLoaded14951981164510048
load15021985167210550
domInteractive2293522110
backgroundConnect977272010
firstReactRender453071065325
getState4509115
initialActions01000
loadScripts10651574122610048
setupStore57710167
uiStartup16482623188420197
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

DDDDDanica
DDDDDanica previously approved these changes Nov 13, 2024
@DDDDDanica
Copy link
Contributor

LGTM !

seaona
seaona previously approved these changes Nov 14, 2024
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.

Overall looks good 🔥 awesome work @chloeYue 🙌
I just added 2 small comments, in case you want to take them, or feel free to leave them too

@chloeYue chloeYue dismissed stale reviews from seaona and DDDDDanica via 23054d2 November 14, 2024 14:12
@metamaskbot
Copy link
Collaborator

Builds ready [9eeaaba]
Page Load Metrics (2328 ± 538 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint63645251885705338
domContentLoaded1684533822961106531
load1694544223281121538
domInteractive31238865928
backgroundConnect8124332813
firstReactRender513301347737
getState580252411
initialActions01000
loadScripts121640611716889427
setupStore66019199
uiStartup1884640226271306627
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@chloeYue chloeYue added this pull request to the merge queue Nov 15, 2024
Merged via the queue into develop with commit 5990644 Nov 15, 2024
77 checks passed
@chloeYue chloeYue deleted the migrate-vault-decrption-tests branch November 15, 2024 12:56
@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 2024
this.driver = driver;
}

async check_pageIsLoaded(): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice job

@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 15, 2024
// we don't need to use navigate since MM will automatically open a new window in prod build
await driver.waitUntilXWindowHandles(2);

// we cannot use the customized driver functionsas there is no socket for window communications in prod builds
Copy link
Contributor

Choose a reason for hiding this comment

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

there is minor typo now we have approvals we could correct later. Able to understand too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the PR is merged..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah this PR is merged, but i will open another PR soon, i will address comments in the next PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure thanks @chloeYue

Copy link
Contributor Author

@chloeYue chloeYue Nov 15, 2024

Choose a reason for hiding this comment

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

addressed here 902a275 in PR #28424

await driver.waitUntilXWindowHandles(2);

// we cannot use the customized driver functionsas there is no socket for window communications in prod builds
const windowHandles = await driver.driver.getAllWindowHandles();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use the one provided by Selenium?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[POM] Migrate vault decryption e2e tests to TS and Page Object Model
5 participants