0

I'm trying to write E2E tests for my Dapp in which I also want to interact with the contracts on local/test chains. I've managed to do this with Metamask but the issue is that I'm not able to run it headless, I was wondering if there is any other solution to this.

What I have so far basically is that I'm loading the Metamask inside puppeteer with

[
  `--disable-extensions-except=${process.env.METAMASK_PATH}`,
  `--load-extension=${process.env.METAMASK_PATH}`
]

but it's not ideal because I have to specify different paths on different machines (using .env for this). And inside the browser I'm simply navigating to the extension url's to onboard and do the transactions as I would on a normal page i.e.

await page.goto('chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/home.html', { waitUntil: 'load' }

The onboarding takes a lot of time without headless and I'm unable to run it inside CI/CD without a fake display (using Xvfb) and lot of setting up as pointed out here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.