vitest-plugin-wdio-electron
v0.0.3
Published
## About
Readme
vitest-plugin-wdio-electron
About
This plugin for vitest integrates E2E test for the electron application using the WebdriverIO.
This plugin will launch the electron application for each test suite.
Installation
npm install --save-dev vitest-plugin-wdio-electronConfiguration
Typescript Configuration
Add the configuration for typescript using tsconfig.json.
{
"compilerOptions": {
// ...
"types": [
"vitest-plugin-wdio-electron/types"
// ...
]
}
// ...
}Vitest configuration
Add this plugin to configuration of the vitest.
This plugin has some options that is explained by here.
import { defineConfig } from 'vitest/config'
import vitestPluginWdioElectron from 'vitest-plugin-wdio-electron'
export default defineConfig({
plugins: [
vitestPluginWdioElectron({
wdioLogLevel: 'warn',
'goog:chromeOptions': {
args: ['--disable-dev-shm-usage', '--disable-gpu', '--headless'],
},
}),
// ...
],
// ...
})Plugin options
Please check the following table and linked documents.
| option | default | description | reference |
| ----------------------------- | :-------------: | :---------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
| wdioLogLevel | warn | Log level of WebdriverIO | See the Docs of WDIO |
| rootDir | process.cwd() | The root directory of the electron application | - |
| electronVersion | - | Define the version of electron. (It will determined by automatically) | See the browserVersion |
| wdio:electronServiceOptions | {} | The Option for the electron service of WebdriverIO | See the Service Options |
| wdio:chromedriverOptions | {} | The option for the ChromeDriver | See the Docs |
| goog:chromeOptions | {} | The option for the Chrome | See the Docs |
