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

refactor: Use generic helper function to initiate signatures #26584

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

pnarayanaswamy
Copy link
Contributor

@pnarayanaswamy pnarayanaswamy commented Aug 21, 2024

Description

Refactor signature tests to use a helper function in order to load the test state.
Also fixes the flaky SIWE tests by adding an extra scroll to bottom

Open in GitHub Codespaces

Related issues

Fixes:
#24468
#26445

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 August 21, 2024 13:46
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 added the team-confirmations Push issues to confirmations team label Aug 21, 2024
Copy link

@pnarayanaswamy pnarayanaswamy changed the title refactor: Use generic function to initiate signatures refactor: Use generic helper function to initiate signatures Aug 22, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [3b784e4]
Page Load Metrics (75 ± 8 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint66131103189
domContentLoaded4110871199
load4810875178
domInteractive95926115
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.01%. Comparing base (187da88) to head (3b784e4).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #26584   +/-   ##
========================================
  Coverage    70.01%   70.01%           
========================================
  Files         1410     1410           
  Lines        49130    49130           
  Branches     13739    13739           
========================================
  Hits         34398    34398           
  Misses       14732    14732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -99,3 +113,13 @@ export async function assertPastedAddress(driver: Driver) {
const formFieldEl = await driver.findElement('#eip747ContractAddress');
assert.equal(await formFieldEl.getAttribute('value'), WALLET_ADDRESS);
}

export async function openDappAndTriggerSignature(
Copy link
Member

Choose a reason for hiding this comment

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

This is great and absolutely the best mentality!

But this is another example where the page object model (once adopted) would make this architecture even cleaner and more consistent.

await TestDApp.clickSignTypedData3Button();
await SignatureConfirmation.clickApprove();

Copy link
Contributor

Choose a reason for hiding this comment

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

another idea is we could make this method even more generic. Possibly we could create test dapp helpers.

e.g. calling it from the code

openDappAndClick(driver, Signature.SignTypedData)

or

openDappAndClick(driver, Dapp.Signature.SignTypedData)

@digiwand
Copy link
Contributor

looks like the PR isn't connected to the issue tickets. I think we'd either need to:

  1. prepend "Fixes: " without the new lines with the issue tickets
  2. manually add the tickets in the GitHub "Development" section

@pnarayanaswamy pnarayanaswamy merged commit ed44d49 into develop Aug 22, 2024
84 checks passed
@pnarayanaswamy pnarayanaswamy deleted the refactor-signature branch August 22, 2024 13:52
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 22, 2024
@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.4.0 Issue or pull request that will be included in release 12.4.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants