playwright-electron
This package contains the Electron flavor of Playwright.
How to demo
npm i --save-dev electron@beta playwright-electronnpx mocha
index.js
- main Electron application file.
const app BrowserWindow = ; { let win = width: 800 height: 600 ; win;} app;
index.html
- page that Electron opens in a BrowserWindow.
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>Hello World!</title> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> <style> html width: 100%; height: 100%; display: flex; background: white; body flex: auto; display: flex; justify-content: center; align-items: center; flex-direction: column; </style> </head> <body> <h1>Hello World!</h1> <button onclick="console.log('click')">Click me</button> </body></html>
test/spec.js
- test file
const electron = ;const assert = ;const electronPath = ;const path = ;