Skip to content

Commit db35b77

Browse files
fix(test): tap lowercase metamask in Android Connect chooser
CI video shows Choose activity with "metamask"; stop blocking on CDP URL capture and match the chooser case-insensitively. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 658ce5e commit db35b77

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

tests/page-objects/MMConnect/AndroidScreenHelpers.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ const logger = createLogger({
1515
name: 'AndroidScreenHelpers',
1616
});
1717

18-
/** Exact MetaMask label outside Chrome WebView (Android app chooser). */
18+
/** MetaMask label in Android app chooser (CI often shows lowercase "metamask"). */
1919
const CHOOSER_METAMASK_XPATHS = [
20-
'//android.widget.TextView[@text="MetaMask" and not(ancestor::android.webkit.WebView)]',
21-
'//*[@resource-id="android:id/text1" and @text="MetaMask"]',
22-
'//android.widget.Button[@text="MetaMask"]',
23-
'//*[@content-desc="MetaMask"]',
20+
`//android.widget.TextView[translate(@text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='metamask' and not(ancestor::android.webkit.WebView)]`,
21+
`//*[@resource-id="android:id/text1" and translate(@text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='metamask']`,
22+
`//android.widget.Button[translate(@text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='metamask']`,
23+
`//*[translate(@content-desc, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='metamask']`,
24+
// Resolve-info row: text may be nested under list item
25+
`//*[@resource-id="android:id/list"]//*[translate(@text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')='metamask']`,
2426
];
2527

2628
const JUST_ONCE_XPATHS = [

tests/smoke-appium/mm-connect/connection-multichain.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ appiumTest.describe(SmokeMMConnect('Multichain browser connect'), () => {
6666
});
6767

6868
// Emulator Chrome 113: Appium WEBVIEW_chrome switch hangs in Chromedriver
69-
// session creation. Drive the dapp via CDP instead. Connect also
70-
// captures the SDK metamask:// URL and opens it via mobile: deepLink
71-
// (Chrome blocks deferred location.href without lasting activation).
69+
// session creation. Drive the dapp via CDP instead. CI video shows the
70+
// Android "Choose activity" (Chrome vs metamask) after Connect — tap it
71+
// next; do not block on JS deeplink capture.
7272
PlaywrightUtilities.collapseStatusBar();
73-
await ChromeCdpHelpers.waitAndClickTestIdOpeningMetaMask(
73+
await ChromeCdpHelpers.waitAndClickTestId(
7474
DAPP_URL,
7575
MMConnectDappTestIds.CONNECT_BUTTON,
7676
);

0 commit comments

Comments
 (0)