-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
feat: migrate protect intrinsics test to e2e #26197
Conversation
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. |
Builds ready [bab6b41]
Page Load Metrics (321 ± 301 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26197 +/- ##
========================================
Coverage 69.96% 69.96%
========================================
Files 1405 1405
Lines 48996 48996
Branches 13697 13697
========================================
Hits 34280 34280
Misses 14716 14716 ☔ View full report in Codecov by Sentry. |
Builds ready [d46a9c3]
Page Load Metrics (305 ± 280 ms)
Bundle size diffs
|
@@ -0,0 +1,17 @@ | |||
import { test, expect } from '@playwright/test'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi there 👋 I have a couple of questions regarding this e2e implementation:
- is there any reason why we are using playwright?
- we have a lockdown e2e spec here. I'm wondering what's the difference with this one, as it looks like it's already achieving the same goal? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
- No reason from my side. Is there any reason we should not be using playwright? I just used it, because I created this PR based on an example that @Gudahtt gave me: https://github.com/MetaMask/browser-passworder/blob/main/test/index.spec.ts, and I saw some other tests also using playwright.
- That test indeed looks pretty similar, I did not know such a test already existed. Maybe @Gudahtt has a better understanding of the differences? I guess in this case we can reduce the PR to just deleting the unit test.
Builds ready [b5dea0d]
Page Load Metrics (81 ± 24 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!! Interesting approach thanks @itsyoboieltr.
@itsyoboieltr, you may have to put the test results in the gitignore. |
|
Builds ready [5d7c780]
Page Load Metrics (85 ± 12 ms)
Bundle size diffs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
After migrating the global unit tests from Mocha to Jest, the
protect-intrinsics
test started to fail. It seems that the jest environment is not compatible with the lockdownprotect-intrinsics
intends to test. Furthermore, as this test is testing the lockdown of the browser environment, it would probably make more sense to test it in a browser.For this reason, this PR migrates the protect-intrinsics test to run as part of the e2e test suite, as the browser would be a better test environment, closer to production.
Related issues
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2907
Manual testing steps
test:e2e:global
and see the tests passScreenshots/Recordings
Not applicable
Pre-merge author checklist
Pre-merge reviewer checklist