Comments (10)
@aslushnikov
Hi,
Do you have example to launch from index.js and control the electron using playwright?
from playwright.
@akosyakov: in case you are still interested...
https://www.npmjs.com/package/playwright-electron is now publicly available. It does not have docs, just a bare README.md, but it should be enough to get a rough idea about it. Please let us know what you think!
Edit: Please reference to an up to date guide here: https://playwright.dev/docs/api/class-electron/
from playwright.
Yes, it should be doable by manually hooking up the debugging protocol as corevo says. But Iād really like to have a nicer solution that just works out of the box.
My app is built with electron but it needs to load a certain page in the headless browser and read cookies. I don't want to run another headless browser because electron already has the debugger window. How exactly to "hook up" the debugging protocol?
from playwright.
An electron support is now available with playwright-electron
! š
Edit: Please reference to an up to date guide here: https://playwright.dev/docs/api/class-electron/
from playwright.
I'm assuming you can do it today the same way you would with puppeteer, by enabling the Chrome debugging protocol.
const { app, BrowserWindow } = require('electron')
const puppeteer = require('puppeteer-core')
app.commandLine.appendSwitch('remote-debugging-port', '8315')
const electronBrowser = await puppeteer.connect({
browserURL: 'http://localhost:8315',
})
By just converting the correct puppeteer calls to playwright, I haven't tried it for myself though.
from playwright.
Yes, it should be doable by manually hooking up the debugging protocol as corevo says. But Iād really like to have a nicer solution that just works out of the box.
There are some logistics to work out. Playwright needs to be compatible with the version of electron. Also the way we handle contexts might clash with how electron is implemented. But these both seem like problems that can be overcome.
from playwright.
puppeteer has some issues to support Electron: puppeteer/puppeteer#4283 I was wondering whether it will be the same here.
from playwright.
Folding into #647
from playwright.
@pavelfeldman cool! thanks. Do I understand correctly that it works only against Electron 9?
from playwright.
Yes, Electron 9+ at this point.
from playwright.
Related Issues (20)
- [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
- [Bug]: Project dependency and `storageState` not working as expected HOT 4
- [Question] Hooks config as JsonObject and vue router HOT 2
- [Bug]: When doing `npx playwright install --with-deps chrome` in CI, browser is installed via .deb, and later testing can't find it HOT 2
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.