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: Migrating snaps test to POM #30312

Merged
merged 70 commits into from
Mar 14, 2025
Merged

test: Migrating snaps test to POM #30312

merged 70 commits into from
Mar 14, 2025

Conversation

hjetpoluru
Copy link
Contributor

@hjetpoluru hjetpoluru commented Feb 14, 2025

Description

PR is migration of the snaps test to POM

  • Migrating client status test to POM
  • Migrating snap transaction insight test to POM
  • Migrating snap installed test to POM
  • Migrating life cycle test to POM
  • Migrating name lookup to POM
  • Migrating wasm test to POM
  • Migrating update snap test to POM
  • Migrating get file test to POM

Open in GitHub Codespaces

Related issues

Fixes:
#29894

Manual testing steps

Chrome browser execution commands below
yarn build:test:flask
yarn test:e2e:single test/e2e/snaps/test-snap-clientstatus.spec.ts --browser=chrome
yarn test:e2e:single test/e2e/snaps/test-snap-txinsights.spec.ts --browser=chrome
yarn test:e2e:single test/e2e/snaps/test-snap-installed.spec.ts --browser=chrome
yarn test:e2e:single test/e2e/snaps/test-snap-lifecycle.spec.ts --browser=chrome
yarn test:e2e:single test/e2e/snaps/test-snap-namelookup.spec.ts --browser=chrome
Firefox browser execution commands below
yarn build:test:flask:mv2
ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-clientstatus.spec.ts --browser=firefox
ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-txinsights.spec.ts --browser=firefox
ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-installed.spec.ts --browser=firefox
ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-lifecycle.spec.ts --browser=firefox
ENABLE_MV3=false yarn test:e2e:single test/e2e/snaps/test-snap-namelookup.spec.ts --browser=firefox

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.

@hjetpoluru hjetpoluru added INVALID-PR-TEMPLATE PR's body doesn't match template area-qa Relating to QA work (Quality Assurance) labels Feb 14, 2025
@hjetpoluru hjetpoluru self-assigned this Feb 14, 2025
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 metamaskbot added the team-qa QA team label Feb 14, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [e8b5b7a]
Page Load Metrics (1658 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint34720551583334160
domContentLoaded14322008163517283
load14462059165817685
domInteractive24164423215
backgroundConnect105825168
firstReactRender1396402713
getState46215189
initialActions01000
loadScripts10151535119115173
setupStore674172110
uiStartup164928711936292140
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [837a61f]
Page Load Metrics (1831 ± 190 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint58125781712389187
domContentLoaded140730031806387186
load141230181831396190
domInteractive24193584622
backgroundConnect8119262512
firstReactRender1475382211
getState463202110
initialActions01000
loadScripts97424551321350168
setupStore76020189
uiStartup165334912108477229
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [0456648]
Page Load Metrics (1854 ± 104 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint150522961852216104
domContentLoaded14942236182220398
load150422981854218104
domInteractive258943189
backgroundConnect1077362412
firstReactRender1673392311
getState56218189
initialActions00000
loadScripts10891709133117986
setupStore772212010
uiStartup173325652138218105
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [044aa8d]
Page Load Metrics (1662 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14242330166118086
domContentLoaded14172292163817283
load14252322166217685
domInteractive24683094
backgroundConnect973322110
firstReactRender1496362613
getState45917199
initialActions01000
loadScripts10001630117512761
setupStore75513136
uiStartup16502650191620699
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru marked this pull request as ready for review February 19, 2025 20:07
@hjetpoluru hjetpoluru requested a review from a team as a code owner February 19, 2025 20:07
@metamaskbot
Copy link
Collaborator

Builds ready [03a6ca3]
Page Load Metrics (1727 ± 85 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint30921901524503241
domContentLoaded14232116170217182
load14332191172717785
domInteractive15177433718
backgroundConnect897292813
firstReactRender1488402512
getState46019199
initialActions00000
loadScripts10101538124513967
setupStore86019189
uiStartup169625292002210101
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru requested a review from a team as a code owner February 19, 2025 22:30
@metamaskbot
Copy link
Collaborator

Builds ready [ca1bbbc]
Page Load Metrics (1494 ± 33 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1408168314937034
domContentLoaded1372162014676431
load1412167614946833
domInteractive237029105
backgroundConnect105734168
firstReactRender146822157
getState413821
initialActions01000
loadScripts987124310836129
setupStore7481094
uiStartup1600188716917235

@metamaskbot
Copy link
Collaborator

Builds ready [be21a99]
Page Load Metrics (3132 ± 575 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint552586127611093525
domContentLoaded177854822479824396
load1921681131321198575
domInteractive30233725325
backgroundConnect1471934659510245
firstReactRender543811327536
getState451078261240115
initialActions01000
loadScripts133236271760497239
setupStore1337013011455
uiStartup257511823621330341457
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru requested a review from Mrtenz March 14, 2025 01:22
@metamaskbot
Copy link
Collaborator

Builds ready [fdd607e]
Page Load Metrics (5696 ± 3578 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint55630106548375463623
domContentLoaded156130059533975493625
load163430110569674523578
domInteractive251233190278134
backgroundConnect391086350256123
firstReactRender18152774019
getState1642217010952
initialActions00000
loadScripts116729635465576103654
setupStore9214836431
uiStartup185730242710270893404
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

This seems much better. I mostly left some nits.

Comment on lines 4 to 11
const inputLocator: { [key: string]: string } = {
entropyMessageInput: '#entropyMessage',
messageBip44Input: '#bip44Message',
messageEd25519Bip32Input: '#bip32Message-ed25519Bip32',
messageEd25519Input: '#bip32Message-ed25519',
messageSecp256k1Input: '#bip32Message-secp256k1',
wasmInput: '#wasmInput',
};
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
const inputLocator: { [key: string]: string } = {
entropyMessageInput: '#entropyMessage',
messageBip44Input: '#bip44Message',
messageEd25519Bip32Input: '#bip32Message-ed25519Bip32',
messageEd25519Input: '#bip32Message-ed25519',
messageSecp256k1Input: '#bip32Message-secp256k1',
wasmInput: '#wasmInput',
};
const inputLocator = {
entropyMessageInput: '#entropyMessage',
messageBip44Input: '#bip44Message',
messageEd25519Bip32Input: '#bip32Message-ed25519Bip32',
messageEd25519Input: '#bip32Message-ed25519',
messageSecp256k1Input: '#bip32Message-secp256k1',
wasmInput: '#wasmInput',
} satisfies Record<string, string>;

This helps with intellisense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok sure I will try changes and execute them locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @Mrtenz for help and I have addressed in the commit dc915ef

console.log('Wait and click get public key button');
await this.driver.waitForSelector(this.publicKeyBip44Button);
await this.driver.clickElement(this.publicKeyBip44Button);
async fillMessageTestSnapsPage(inputElement: string, message: string) {
Copy link
Member

Choose a reason for hiding this comment

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

The TestSnapsPage in this and other methods feels redundant. When you're calling this, it would typically look like

testSnaps.fillMessageTestSnapsPage(...);

I think omitting the TestSnapsPage is clear enough:

testSnaps.fillMessage(...);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok agreed I will make the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes totally sense and addressed in the commit dc915ef

Also, I updated the other ones too.

async selectEntropySource(id: string, name: string) {
console.log('Select entropy source');
const selector = await this.driver.findElement(`#${id}-entropy-selector`);
async scrollAndSelectEntropySource(dropDownName: string, name: string) {
Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine in this case to expect callers to provide the actual locator, instead of using the switch statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I will make the changes

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 agreed now it looks much clear after the update in the commit dc915ef

@hjetpoluru hjetpoluru requested a review from Mrtenz March 14, 2025 14:53
@hjetpoluru hjetpoluru enabled auto-merge March 14, 2025 15:52
@hjetpoluru hjetpoluru added this pull request to the merge queue Mar 14, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [3a28043]
Page Load Metrics (2858 ± 675 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1782790426571276613
domContentLoaded1647699623451116536
load1811840628581406675
domInteractive27297677436
backgroundConnect941434483367176
firstReactRender223341117737
getState3384920219794
initialActions01000
loadScripts122152091712824395
setupStore1559012214067
uiStartup251011606478625301215
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Merged via the queue into main with commit 09fba6c Mar 14, 2025
77 checks passed
@hjetpoluru hjetpoluru deleted the snaps-migration-pom branch March 14, 2025 16:34
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2025
@metamaskbot metamaskbot added the release-12.16.0 Issue or pull request that will be included in release 12.16.0 label Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-qa Relating to QA work (Quality Assurance) INVALID-PR-TEMPLATE PR's body doesn't match template release-12.16.0 Issue or pull request that will be included in release 12.16.0 team-qa QA team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants