ChainSafe / dappeteer

[DEPRECATED]🏌🏼‍E2E testing for dApps using Puppeteer + MetaMask
Other
491 stars 152 forks source link

Waiting for select '.network-display' #352

Open JornTeurlings opened 9 months ago

JornTeurlings commented 9 months ago

Describe the bug When the browser is initialized and the metamask setup is being done, after managing to get through the entire flow it somehow halts and gives a timeout error. In the below presented code, the finished with setup log is never presented and there is the timout error which is mentioned further below

To Reproduce

        console.log('INitialize browser')
        const browser = await dappeteer.launch({
            metaMaskVersion: 'v10.35.0',
            headless: false,
            metaMaskFlask: false
        });

        console.log('Initialize metamask')

        const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
        await sleep(2000);

        await dappeteer.setupMetaMask(browser, metaMaskSetup)

        console.log('Finished with setup')

Logs

Error in Dappeteer process: TimeoutError: Waiting for selector `.network-display` failed: Waiting failed: 30000ms exceeded
    at new WaitTask (.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/WaitTask.js:60:34)
    at IsolatedWorld.waitForFunction (..../node_modules/puppeteer-core/lib/cjs/puppeteer/api/Realm.js:35:26)
    at PQueryHandler.waitFor (.../node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.js:180:95)
    at async CdpFrame.waitForSelector (/.../node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:504:21)
    at async CdpPage.waitForSelector (.../node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:1305:20)
    at async DPupeteerPage.waitForSelector (.../node_modules/@chainsafe/dappeteer/dist/puppeteer/page.js:63:55)
    at async .../node_modules/@chainsafe/dappeteer/dist/helpers/actions.js:19:33
    at async retry .../node_modules/@chainsafe/dappeteer/dist/helpers/utils.js:13:20)
    at async openNetworkDropdown ... /node_modules/@chainsafe/dappeteer/dist/helpers/actions.js:18:5)
    at async showTestNets .../node_modules/@chainsafe/dappeteer/dist/setup/setupActions.js:6:5)

Expected behavior I would expect the setupMetaMask function to finish after getting to the dashboard page of the extension and then continue with the flow. However, it halts at some point.

Screenshots If applicable, add screenshots to help explain your problem.

System:

Additional context Add any other context about the problem here.