Version: Next
Electron
Playwright has experimental support for Electron automation. You can access electron namespace via:
An example of the Electron automation script would be:
Note that since you don't need Playwright to install web browsers when testing Electron, you can omit browser download via setting the following environment variable when installing Playwright:
electron.launch([options])#
options<Object>args<Array<string>> Additional arguments to pass to the application when launching. You typically pass the main script name here.cwd<string> Current working directory to launch application from.env<Object<string, string>> Specifies environment variables that will be visible to Electron. Defaults toprocess.env.executablePath<string> Launches given Electron application. If not specified, launches the default Electron executable installed in this package, located atnode_modules/.bin/electron.
- returns: <Promise<ElectronApplication>>
Launches electron application specified with the executablePath.