2021-02-09 16:28:01 +01:00
|
|
|
const webpackPreprocessor = require('@cypress/webpack-preprocessor')
|
|
|
|
|
|
|
|
const { createEntry } = require('../../webpack.config')
|
|
|
|
|
|
|
|
module.exports = (on, config) => {
|
|
|
|
const options = {
|
|
|
|
webpackOptions: createEntry('cypress'),
|
|
|
|
watchOptions: {},
|
|
|
|
}
|
|
|
|
|
|
|
|
on('file:preprocessor', webpackPreprocessor(options))
|
|
|
|
try {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
|
|
require('cypress-terminal-report/src/installLogsPrinter')(on)
|
|
|
|
} catch (e) {}
|
|
|
|
|
2021-02-26 15:50:36 +01:00
|
|
|
on('before:browser:launch', (browser, launchOptions) => {
|
|
|
|
if (browser.name === 'chrome') {
|
|
|
|
// https://www.ghacks.net/2013/10/06/list-useful-google-chrome-command-line-switches/
|
|
|
|
// Compatibility with gh actions
|
|
|
|
launchOptions.args.push('--window-size=1280,720')
|
|
|
|
return launchOptions
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2021-02-09 16:28:01 +01:00
|
|
|
return config
|
2020-08-11 10:52:43 +02:00
|
|
|
}
|