]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/cypress/plugins/index.js
d9294002ba4010eaebd41e33e0141657b1d35861
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / cypress / plugins / index.js
1
2 const browserify = require('@cypress/browserify-preprocessor');
3 const cucumber = require('cypress-cucumber-preprocessor').default;
4 module.exports = (on, _config) => {
5 const options = {
6 ...browserify.defaultOptions,
7 typescript: require.resolve("typescript"),
8 };
9
10 on('file:preprocessor', cucumber(options));
11 on('before:browser:launch', (browser, launchOptions) => {
12 if (browser.name === 'chrome' && browser.isHeadless) {
13 launchOptions.args.push('--disable-gpu');
14 return launchOptions;
15 }
16 });
17
18 on('task', {
19 log({ message, optional }) {
20 optional ? console.log(message, optional) : console.log(message);
21 return null;
22 },
23 });
24 };
25
26 require('@applitools/eyes-cypress')(module);