mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-24 00:47:50 +01:00
b7bdad90eb
* Add test for bar charts Since our charts are rendered on a canvas we can't really interact well with it. Instead, we take a screenshot now (new dependency). * Debug error in CI * Make sure images are the same size on CI and locally
31 lines
967 B
JavaScript
31 lines
967 B
JavaScript
const webpackPreprocessor = require('@cypress/webpack-preprocessor')
|
|
const { initPlugin } = require('cypress-plugin-snapshots/plugin')
|
|
|
|
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) {}
|
|
|
|
initPlugin(on, config)
|
|
|
|
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
|
|
}
|
|
})
|
|
|
|
return config
|
|
}
|