Comments (7)
Could you kindly share what the expected sequence is to start a playwright-controlled Firefox instance with extensions installed?
@gurupras @lfilho Oops sorry it took me a while. I posted some details here: mozilla/web-ext#1927 (comment)
from playwright.
@Banou26 you can already load web extensions to firefox using web-ext - that's the recommended way to load extensions to ff. We explored it a while back here: puppeteer/puppeteer#4162 (comment)
Same instructions should work for PlayWright; cc'ing @denar90 who poked a lot into this.
Hope this helps!
from playwright.
Could you kindly share what the expected sequence is to start a playwright-controlled Firefox instance with extensions installed?
I don't quite understand how to trigger all of this from my playwright script.
Should we be overriding executablePath
in browser.launch()
to point to web-ext
and pass its arguments?
from playwright.
I second what @gurupras said.
I'm also very interested in how to use Playwright for testing WebExtensions. I tried the approach above with Playwright but I'm stuck with the following error when running my script:
Error when running playwright script:
WebSocket error: Unexpected server response: 400
=================== firefox.connect logs ===================
<ws connecting> ws://127.0.0.1:1234/c1f80464-a717-b542-92bf-8884ddef3501/
<ws connect error> ws://127.0.0.1:1234/c1f80464-a717-b542-92bf-8884ddef3501/ Unexpected server response: 400
<ws disconnected> ws://127.0.0.1:1234/c1f80464-a717-b542-92bf-8884ddef3501/
============================================================
Here's my code relevant bits:
web-ext confirmation juggler is listening:
[firefox/index.js][debug] Firefox stdout: Juggler listening on ws://127.0.0.1:1234/c1f80464-a717-b542-92bf-8884ddef3501
my playwright script:
browser = await browserWrapper.firefox.connect({
wsEndpoint: 'ws://127.0.0.1:1234/',
// also tried with:
// wsEndpoint: 'ws://127.0.0.1:1234/c1f80464-a717-b542-92bf-8884ddef3501',
// and:
// wsEndpoint: 'ws://127.0.0.1:1234/c1f80464-a717-b542-92bf-8884ddef3501/',
logger: { // doesn't show any other extra information
isEnabled: () => true,
log: (name, severity, message, args) => console.log(`${name} ${message}`),
},
});
I'm using: "playwright-firefox": "1.1.1"
That's the only missing bit in my quest to fully automate my extension's testing :)
Any ideas how to accomplish testing that? /cc @aslushnikov @denar90
Thank you!
from playwright.
Considering WebKit doesn’t support web extensions, would it be fair to consider this a request for Firefox extension support?
You should be able to load extensions into Firefox though some launch arguments. But we don’t currently have a way for you to evaluate JavaScript in the extension context.
from playwright.
Yeah, i was mainly thinking about FF
from playwright.
I have also just tried a different approach, without using juggler but rather connecting to the remote debugger as suggested in a different thread. I posted all details here: mozilla/web-ext#1927 (there's details about puppeteer and playwright)
from playwright.
Related Issues (20)
- [Bug]: Unable to run playwright tests using github actions HOT 8
- [Bug]: Timing issues with dynamically generated tests. (Updated, originally thought this was a globbing issue) HOT 6
- [Question] Why is 'setDownloadBehavior' required for connect_over_cdp? Any workaround? HOT 1
- [Bug]: playwright tests do not show in test tab in vscode, no errors, cli works HOT 5
- [Bug]: invoke beforeall method with condition skip in loop will skip entire test instead of respective each loop tests HOT 5
- [Bug]: Arch Linux & your OS is not officially supported by Playwright HOT 1
- [Bug]: @tags added using new syntax as per v1.42 is not shown in UI mode HOT 1
- [Feature]: Set proxy in Page HOT 1
- [Bug]: Missing projects/tests when using multiple projects (folders) from 1.43.x HOT 2
- [Regression]: Missing requests on trace file using page.Context.Tracing.StartAsync HOT 3
- [Bug]: Windows: Error with emoji in filename: `Error: ENOENT: no such file or directory, access` HOT 3
- [Regression]: Tests fails in parallel run when click on dropdown options performed HOT 2
- [Bug]: Corepack eneable pnpm does not work in playwright image 1.43.X anymore HOT 5
- [Feature]: pytest-playwright - auto slow down considering cpu load HOT 1
- [Bug]: Results of test run in UI Mode disappear after short delay with "Did not run" message HOT 1
- [Bug]: Intermittent Timeout Errors with Playwright's page.goto Function in Visual Regression Tests HOT 4
- Chromium unable to play videos HOT 2
- [Bug]: electron.launch: Process failed to launch on Bitbucket pipeline HOT 3
- [Bug]: CLI --grep does not accept more arguments separated by whitespace HOT 2
- [Bug]: WebKit TypeError: undefined is not an object (evaluating 'binding.__installed') HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.