Skip to content

Commit

Permalink
feat: upgrade cypress to 12.15.0
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Nov 15, 2023
1 parent 0e53fa2 commit db0f7a8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
30 changes: 30 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
"defaultCommandTimeout": 60000,
"requestTimeout": 60000,
"responseTimeout": 60000,
"baseUrl": "http://localhost:5601",
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporter-config.json"
},
"viewportWidth": 2000,
"viewportHeight": 1320,
"env": {
"openSearchUrl": "http://localhost:9200",
"SECURITY_ENABLED": false,
"AGGREGATION_VIEW": false,
"username": "admin",
"password": "admin",
"ENDPOINT_WITH_PROXY": false,
"MANAGED_SERVICE_ENDPOINT": false,
"VISBUILDER_ENABLED": true,
"DATASOURCE_MANAGEMENT_ENABLED": false,
"ML_COMMONS_DASHBOARDS_ENABLED": true,
"WAIT_FOR_LOADER_BUFFER_MS": 0,
"NO_COMMAND_LOG": 1
}
},
})
31 changes: 14 additions & 17 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,22 @@
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config

/**
* For cypress on 9.6.0 and chrome larger than 117, --headless=new is needed.
* https://github.com/cypress-io/cypress-documentation/issues/5479#issuecomment-1719336938
*/
on('before:browser:launch', (browser = {}, launchOptions) => {
if (
(browser.name === 'chrome' || browser.name === 'chromium') &&
browser.isHeadless
) {
launchOptions.args = launchOptions.args.map((arg) => {
if (arg === '--headless') {
return '--headless=new';
}

return arg;
});
}

return launchOptions;
});
// on('before:browser:launch', (browser = {}, launchOptions) => {
// if (
// (browser.name === 'chrome' || browser.name === 'chromium') &&
// browser.isHeadless
// ) {
// launchOptions.args = launchOptions.args.map((arg) => {
// if (arg === '--headless') {
// return '--headless=new';
// }
// return arg;
// });
// }
// return launchOptions;
// });
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"@faker-js/faker": "^7.6.0",
"commander": "^9.4.1",
"cypress": "9.5.4",
"cypress": "12.15.0",
"cypress-multi-reporters": "^1.5.0",
"cypress-real-events": "1.7.6",
"eslint": "^7.0.0",
Expand Down

0 comments on commit db0f7a8

Please sign in to comment.