webext-dynamic-content-scripts
webext-dynamic-content-scripts copied to clipboard
Run tests in Firefox
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
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.