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: migrate signature redesign tests to page object model #28538

Merged
merged 16 commits into from
Nov 28, 2024

Conversation

pnarayanaswamy
Copy link
Contributor

@pnarayanaswamy pnarayanaswamy commented Nov 19, 2024

Description

Migrates the existing signature redesign e2e tests to use page object model.
Adds the relevant pages and updates the tests using the newly created pages.

Open in GitHub Codespaces

Related issues

Fixes: #28540

Manual testing steps

  1. Go to this page...

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.

@pnarayanaswamy pnarayanaswamy requested a review from a team as a code owner November 19, 2024 10:17
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.

@pnarayanaswamy pnarayanaswamy changed the title Migrate signature redesign tests to Page Object Model test: migrate signature redesign tests to page object model Nov 19, 2024
@pnarayanaswamy pnarayanaswamy added the team-confirmations Push issues to confirmations team label Nov 19, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [b7dc11a]
Page Load Metrics (1981 ± 105 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint41026361892398191
domContentLoaded165026161949218105
load165926381981220105
domInteractive16256676230
backgroundConnect988302612
firstReactRender46123722010
getState5213696188
initialActions01000
loadScripts12152007147418589
setupStore6511195
uiStartup189330112276263126
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [ff7afb9]
Page Load Metrics (1930 ± 233 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint23138261697751361
domContentLoaded157937171911472227
load159037931930486233
domInteractive25202584723
backgroundConnect683202210
firstReactRender49198803718
getState40185963015
initialActions00000
loadScripts114430151427403194
setupStore65110105
uiStartup182043612237562270
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

);

// await driver.waitUntilXWindowHandles(2);
// await driver.switchToWindowWithTitle(WINDOW_TITLES.TestDApp);
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented out code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

text: '0x581c3...45947',
};

private nftTitle = { text: 'Withdrawal request' };
Copy link
Contributor

Choose a reason for hiding this comment

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

[suggestion/non-blocker]: rather than private vars here, we could keep them outside of the class as a map structure. This would provide a quick lookup and instantiating a single object

e.g.

const SELECTOR = {
  nft: { text: 'Withdrawal request' },
  nftContractPetName: {
    css: '.name__value',
    text: '0x581c3...45947',
  }
}

export default class PermitConfirmation extends Confirmation {
  // ..

  .. await this.driver.findElement(SELECTOR.nft);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. But maybe best to do it out of the scope of this PR as there are already many pages using the current pattern for now. I'd also like to run it by the extension team.

@metamaskbot
Copy link
Collaborator

Builds ready [81b6437]
Page Load Metrics (1705 ± 74 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14422062170516177
domContentLoaded14282057167416077
load14812062170515574
domInteractive258536168
backgroundConnect75830178
firstReactRender166630199
getState45418168
initialActions00000
loadScripts10301443122611153
setupStore65110105
uiStartup16652232189315977
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [3070f53]
Page Load Metrics (1625 ± 46 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1414178616319345
domContentLoaded1407177816038842
load1415178316259646
domInteractive238441199
backgroundConnect7103242512
firstReactRender1676422512
getState46913189
initialActions01000
loadScripts1024129411787737
setupStore65312136
uiStartup15672006181510953
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pnarayanaswamy pnarayanaswamy added this pull request to the merge queue Nov 28, 2024
Merged via the queue into develop with commit 5430c89 Nov 28, 2024
75 checks passed
@pnarayanaswamy pnarayanaswamy deleted the pom-signatures branch November 28, 2024 07:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2024
@metamaskbot metamaskbot added the release-12.9.0 Issue or pull request that will be included in release 12.9.0 label Nov 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.9.0 Issue or pull request that will be included in release 12.9.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate signature e2e to page object model
4 participants