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: Writing new test about metamask section links #22911

Merged
merged 25 commits into from
Feb 23, 2024

Conversation

hjetpoluru
Copy link
Contributor

@hjetpoluru hjetpoluru commented Feb 13, 2024

Description

This PR adds test coverage for About MetaMask section - Links using TypeScript which is critical flow in the extension.

Related issues

Fixes: #22812

Manual testing steps

Run the tests locally checkout to the branch
yarn
yarn start:test
yarn test:e2e:single test/e2e/tests/settings/about-metamask/ui-validation.spec.ts --browser=firefox --debug --leave-running
yarn test:e2e:single test/e2e/tests/settings/about-metamask/ui-validation.spec.ts --browser=chrome --debug --leave-running

** Notes **

This PR specifically addresses the links found in the About section, which is an essential aspect of the extension. This section provides users with access to support and privacy-related information, making it a critical pathway for user engagement and trust.

Initially, my strategy involved validating the functionality by clicking on the links within this section, which would then open in a new tab in the web browser, directing to the MetaMask and ConsenSys sites. However, I encountered a challenge: we needed to include the links in the privacy-snapshot.json file, along with the corresponding child links (such as YouTube, Twitter, etc.).

Consequently, the decision was made to avoid clicking on the links directly. Instead, we opted to validate the href attributes, and this task was successfully completed as part of the end-to-end (e2e) testing process. I strongly agree with the feedback provided by @seaona and I believe that this validation process should indeed be incorporated into the unit testing due to the effort involved in the validation now.

After dedicating some time to learning, I was able to write the unit tests and also have the e2e tests for comparative purposes. I also intend to document this here for future reference on the approach taken.

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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 team-extension-platform INVALID-PR-TEMPLATE PR's body doesn't match template e2e-test End to end test for the MetaMask extension labels Feb 13, 2024
@hjetpoluru hjetpoluru self-assigned this Feb 13, 2024
@hjetpoluru hjetpoluru requested a review from a team as a code owner February 13, 2024 13:47
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 [3c1f4b2]
Page Load Metrics (995 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1363312074722
domContentLoaded14115453416
load83111839958541
domInteractive14115453416
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru requested a review from danjm February 13, 2024 17:57
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.56%. Comparing base (37227c4) to head (3adcf96).
Report is 2 commits behind head on develop.

❗ Current head 3adcf96 differs from pull request most recent head 538faa0. Consider uploading reports for the commit 538faa0 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #22911      +/-   ##
===========================================
+ Coverage    68.55%   68.56%   +0.01%     
===========================================
  Files         1096     1094       -2     
  Lines        43251    43231      -20     
  Branches     11525    11524       -1     
===========================================
- Hits         29649    29641       -8     
+ Misses       13602    13590      -12     

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

@metamaskbot
Copy link
Collaborator

Builds ready [e37ff3e]
Page Load Metrics (978 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1052541973215
domContentLoaded1477342311
load84010759785426
domInteractive1477342311
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 draft February 15, 2024 03:04
@metamaskbot
Copy link
Collaborator

Builds ready [3d4fdd9]
Page Load Metrics (1917 ± 143 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1083771897134
domContentLoaded126227136
load162031341917299143
domInteractive126227136
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 21, 2024 02:25
@hjetpoluru hjetpoluru requested a review from seaona February 21, 2024 02:25
test/env.js Show resolved Hide resolved
ui/pages/settings/info-tab/info-tab.test.tsx Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [8b3f89a]
Page Load Metrics (2215 ± 181 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint12169124813665
domContentLoaded13108402512
load161428732215376181
domInteractive13108402512
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [baa70cc]
Page Load Metrics (1830 ± 106 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint803421696029
domContentLoaded990362110
load156825241830220106
domInteractive990362110
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [a3f2f7f]
Page Load Metrics (1860 ± 98 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1103091915124
domContentLoaded107533199
load14622224186020598
domInteractive107533199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [e5988dc]
Page Load Metrics (1962 ± 124 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint934662159847
domContentLoaded98729178
load163725761962259124
domInteractive98729178
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

HowardBraham
HowardBraham previously approved these changes Feb 22, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [6077293]
Page Load Metrics (1630 ± 77 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint793481745325
domContentLoaded8107392814
load13791926163016177
domInteractive8107392814
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

DDDDDanica
DDDDDanica previously approved these changes Feb 23, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [3adcf96]
Page Load Metrics (1983 ± 81 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1184272008139
domContentLoaded9111342713
load16942298198316981
domInteractive9111342713
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [178e84c]
Page Load Metrics (1019 ± 404 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint732311293718
domContentLoaded146631178
load5919471019842404
domInteractive146631178
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@hjetpoluru hjetpoluru merged commit 05e267b into develop Feb 23, 2024
65 of 66 checks passed
@hjetpoluru hjetpoluru deleted the e2e/settings-about-metamask-links-test branch February 23, 2024 18:52
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2024
@metamaskbot metamaskbot added the release-11.13.0 Issue or pull request that will be included in release 11.13.0 label Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-11.13.0 Issue or pull request that will be included in release 11.13.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QA] Add e2e test and manual scenario for settings:about metamask page
6 participants