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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
|
@SocketSecurity ignore npm/@metamask/browser-playground@0.3.0 This is MM Connect's test dapp. |
✨ Files requiring CODEOWNER review ✨🕵️ @MetaMask/extension-privacy-reviewers (1 files, +2 -0)
🧪 @MetaMask/qa (2 files, +359 -0)
|
Builds ready [3e23c47]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
homepage.headerNavbar.openPermissionsPage() does not exist on HeaderNavbar. The correct utility is openPermissionsPageFlow() from permissions.flow.ts, which calls clickAllPermissionsButton() and handles the Gator (Flask) flow by detecting and clicking 'Sites' when needed.
Builds ready [d1d48c6]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [20bb3aa]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [8039ce2]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [f30a5d7]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
| async selectNetworks(desiredChainIds: string[]): Promise<void> { | ||
| for (const chainId of MM_CONNECT_FEATURED_CHAIN_IDS) { | ||
| const selector = this.checkboxSelector(chainId); | ||
| const isChecked = await this.driver.readElementWithRetry( |
There was a problem hiding this comment.
hi there 👋 I think we don't need a new driver method, we could use the existing method waitUntil which essentially achieves the same goal
Something like:
let isChecked = false;
await this.driver.waitUntil(
async () => {
try {
const element = await this.driver.findElement(selector);
isChecked = await element.isSelected();
return true;
} catch (error) {
const err = error as { name?: string };
if (err.name === 'StaleElementReferenceError') {
return false;
}
throw error;
}
},
{ interval: 500, timeout: this.driver.timeout },
test/e2e/webdriver/driver.js
Outdated
| * @param {number} [options.timeout] - Timeout in milliseconds | ||
| * @returns {Promise<*>} Promise resolving to the read value | ||
| */ | ||
| async readElementWithRetry( |
seaona
left a comment
There was a problem hiding this comment.
hi there 👋 thanks for the changes! Overall looks good. I added a small suggestion for simplifying a bit the approach 🙏
Thanks again for the feedback, I've addressed it 🫡 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
|
Builds ready [35ed097]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
LGTM ✅ |




Description
Adds E2E tests for the Multichain API using Metamask Connect (formerly SDK).
Five scenarios:
wallet_createSessioncan grant 3 EVM chains + Solana scope simultaneously and that all ScopeCards render.personal_signrouting — Confirmspersonal_signrequests are routed to the correct chain scope and return valid signatures.eth_chainIdisolation — Validates thateth_chainIdreturns the correct hex chain ID for each connected scope.wallet_revokeSession(viasdkDisconnect()) clears session state on both dapp and wallet sides.New Test Dapp and Page Object
Adds the MM Connect Test Dapp (
test/e2e/page-objects/pages/test-dapp-mm-connect.ts):@metamask/playground-uitest ID logic in-tree for stable selectorsselectNetworks(),clickConnect(),triggerMethod(),checkMethodResult(),checkScopeCardVisible()waitForSelector)Infrastructure
DAPP_PATH.TEST_DAPP_MM_CONNECTconstantMM_CONNECT_EVM_CHAINSandMM_CONNECT_FEATURED_CHAIN_IDSconstants@metamask/browser-playground@0.3.0devDependencyprivacy-snapshot.jsonwitheth.merkle.io(RPC) andmm-sdk-analytics.api.cx.metamask.io(telemetry)FixtureBuilderV2Privacy Changes
Adds two entries:
https://eth.merkle.io: is the default RPC for Ethereum mainnet chain definition at viem, the base library on top of whichwagmiis built.wagmiis used by thebrowser-playgroundto enable testing the new MM Connect wagmi connector.mm-sdk-analytics.api.cx.metamask.io: is the analytics endpoint for SDK related metrics.Changelog
CHANGELOG entry:
Related issues
Fixes: WAPI-1044
Manual testing steps
yarn && yarn build:testyarn test:e2e:single test/e2e/tests/sdk/connect-multichain.spec.ts --browser=chromeScreenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Primarily adds E2E tests and test infrastructure, but introduces a new dev dependency (
@metamask/browser-playground) and expands the privacy allowlist, which can affect CI stability and policy expectations.Overview
Adds a new MM Connect multichain E2E suite (
connect-multichain.spec.ts) that exerciseswallet_createSessionacross multiple EVM chains plus Solana, per-scope signing/eth_chainId, permission removal propagation, andwallet_revokeSessiondisconnect behavior.Introduces a dedicated page object (
test-dapp-mm-connect.ts) and new E2E constants (DAPP_PATH.TEST_DAPP_MM_CONNECT,MM_CONNECT_EVM_CHAINS,MM_CONNECT_FEATURED_CHAIN_IDS) to drive the@metamask/browser-playgrounddapp, and refactors permission-page navigation by extractinggetPermissionsPageForHostintopermissions.flow.ts.Updates test tooling/config by adding
@metamask/browser-playground@0.3.0to dev deps and depcheck ignores, plus extendsprivacy-snapshot.jsonwitheth.merkle.ioandmm-sdk-analytics.api.cx.metamask.io.Written by Cursor Bugbot for commit 35ed097. This will update automatically on new commits. Configure here.