webext-dynamic-content-scripts icon indicating copy to clipboard operation
webext-dynamic-content-scripts copied to clipboard

Run tests in Firefox

Open fregante opened this issue 2 years ago • 1 comments
trafficstars

Quite difficult, but I wanted to open an issue to link to my last attempt:

https://github.com/fregante/content-scripts-register-polyfill/pull/58#issuecomment-1157420311

We're here hoping that someone will simplify the process of starting Firefox and loading an extension into it without having to copy-paste https://github.com/puppeteer/puppeteer/issues/5532#issuecomment-706239839 or https://github.com/mozilla/web-ext/issues/1927

fregante avatar Mar 09 '23 11:03 fregante

Hey @fregante 👋

I solved this using WebdriverIO, using:

const extension = await fs.readFile(path.resolve(__dirname, '..', `runme-firefox-v${pkg.version}.xpi`))
await browser.installAddOn(extension.toString('base64'), true)

My web extension registers a content script that modifies the web app. It has e2e tests set up to validate that the modifications are actually happening. They run with Chrome and Firefox in parallel.

christian-bromann avatar Apr 05 '23 23:04 christian-bromann