From 6b66dcbd96e0844ba3e00a64fbf645b8020f571a Mon Sep 17 00:00:00 2001 From: jeremywu <15975785+JeremyWuuuuu@users.noreply.github.com> Date: Mon, 10 Jan 2022 23:27:02 +0800 Subject: [PATCH] fix(ci): cypress ci issue (#5289) - Replace localhost with 127.0.0.1 - Add feature flag for headless Chrome --- cypress.json | 2 +- cypress/plugins/index.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cypress.json b/cypress.json index 82f61bb79f..2807a91ba0 100644 --- a/cypress.json +++ b/cypress.json @@ -1,4 +1,4 @@ { "video": false, - "baseUrl": "http://localhost:5001/en-US/" + "baseUrl": "http://127.0.0.1:5001/en-US/" } diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index d89c534e01..95e1093782 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -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 }