-
Notifications
You must be signed in to change notification settings - Fork 5.2k
test: Add E2E test for first install #31435
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
base: main
Are you sure you want to change the base?
Conversation
✨ Files requiring CODEOWNER review ✨🔒 @MetaMask/extension-security-team
|
897848a
to
5efe7d9
Compare
Builds ready [5efe7d9]
UI Startup Metrics (1193 ± 56 ms)
Bundle size diffs
|
/** | ||
* Reload the extension. | ||
* | ||
* This is used for the `first-install` E2E test, which uses a production-like build. This | ||
* function must be present even if `process.env.IN_TEST` is false. | ||
*/ | ||
window.stateHooks.reloadExtension = () => { | ||
browser.runtime.reload(); | ||
}; |
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.
Just a quick drive by comment: Since we use browser.runtime.reload()
in a few places in our code, it might make sense to update those to use this new stateHooks.reloadExtension
line... that way we can say we aren't shipping test functions in production 😆
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.
Hmm, interesting idea, but it would probably be better to minimize the reliance on functions we make accessible outside the root compartment. Just to minimize the complexity of any audits into what could go wrong if they're tampered with somehow.
Add E2E test to ensure a window opens upon first install. This test needs to use a production-like build rather than a standard E2E build, so the existing "vault decryptor" job was repurposed to be more generically for E2E tests using a production-like build. A global function `reloadExtension` is added to `stateHooks` for use by this test. This function had to be enabled for production builds because the test uses a production build.
5efe7d9
to
837e3b0
Compare
Builds ready [837e3b0]
UI Startup Metrics (1195 ± 66 ms)
|
Some changes needed here due to #31363, which migrated the vault decryptor test to GHA |
81c10ba
to
cbc2979
Compare
Builds ready [cbc2979]
UI Startup Metrics (1204 ± 63 ms)
|
…e-test * origin/main: (57 commits) fix: cp-12.17.0 Fix remove nft (#32102) chore: rename migration 154 to 152.1 (#32109) feat: bump multichain-api-client 0.2.0 (#32104) chore: upgrade assets controllers to v58.0.0 (#32019) feat: upload test runs (#32103) chore: improving disabled functionality to tabs component (#32081) ci: add a soft gate for our page load benchmarks (#31912) test: Added bridge user action benchmark (#31952) fix: chromedriver crash on Windows (#31962) fix: add retries to get-job-id (#32015) feat: Adds Remote Mode hardware wallet gating (#32012) chore: clean up tech debt for `MegaETH Testnet` integration (#31867) chore: bump `@metamask/{polling,gas-fee}-controller` to `v13`,`v23` (#32035) chore(snaps): Bump Snaps packages (#32042) feat: auto create solana account after ondboarding or srp import cp-12.17.0 (#32038) feat: add option to switch from standard account <-> smart account on accounts details modal (#31899) fix: cp-12.17.0 - Center buttons in wider popup (#31897) feat: add non EVM testnets (#31702) feat: expose Multichain API via window.postMessage for Firefox (#30142) feat: Add "Create Solana Account" in connection flow when Solana is requested chain by dapp (#31781) ...
Description
Add E2E test to ensure a window opens upon first install.
This test needs to use a production-like build rather than a standard E2E build, so the existing "vault decryptor" job was repurposed to be more generically for E2E tests using a production-like build.
A global function
reloadExtension
is added tostateHooks
for use by this test. This function had to be enabled for production builds because the test uses a production build.Related issues
This is an E2E test for #31332
Manual testing steps
yarn dist
)yarn test:e2e:single ./test/e2e/first-install.spec.ts --browser chrome
to run the test on Chromeyarn dist:mv2
)yarn test:e2e:single ./test/e2e/first-install.spec.ts --browser firefox
to run the test on FirefoxScreenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist