Skip to content

Commit

Permalink
fix disable gpt for cypress chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad-Altabba committed Jun 4, 2023
1 parent 93f0870 commit b83833a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@ const webpackOptions = require('../webpack.config.js');
// eslint-disable-next-line no-unused-vars
module.exports = (on, config) => {
on('file:preprocessor', webpackPreprocessor({ webpackOptions }));

on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name == 'chrome') {
launchOptions.args.push('--disable-gpu');
}
return launchOptions;
});

return config;
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test": "jest --config=./test/unit/jest.config.js",
"test:black-box": "yarn pre-black-box && ./scripts/black_box_test_helpers.sh runTests",
"test:coverage": "jest --config=./test/unit/jest.config.js --coverage=true --coverage-reporters=text",
"test:e2e:chrome": "npx cypress run --headless --browser chrome --disable-gpu",
"test:e2e:chrome": "npx cypress run --headless --browser chrome",
"test:e2e:firefox": "npx cypress run --headless --browser firefox",
"test:e2e:electron": "npx cypress run --headless --browser electron",
"test:unit": "jest --config=./test/unit/jest.config.js"
Expand Down

0 comments on commit b83833a

Please sign in to comment.