fix(ci): cypress ci issue (#5289)

- Replace localhost with 127.0.0.1
- Add feature flag for headless Chrome
This commit is contained in:
jeremywu
2022-01-10 23:27:02 +08:00
committed by GitHub
parent 53b4ceebe8
commit 6b66dcbd96
2 changed files with 10 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
{
"video": false,
"baseUrl": "http://localhost:5001/en-US/"
"baseUrl": "http://127.0.0.1:5001/en-US/"
}

View File

@@ -17,7 +17,15 @@
* @type {Cypress.PluginConfig}
*/
// eslint-disable-next-line no-unused-vars
module.exports = (_on, _config) => {
module.exports = (on, _config) => {
on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chrome') {
// ^ make sure this is your browser name, you may
// be using 'canary' or 'chromium' for example, so change it to match!
args.push('--proxy-bypass-list=<-loopback>')
return args
}
})
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
}