如何解决在cypress无头运行中将命令行参数传递给chrome驱动程序
按照https://github.com/cypress-io/cypress/issues/3459所述的解决方法,我正在为使用OpenID connect进行身份验证的应用程序编写e2e测试 我可以使用Chrome驱动程序解决cypress GUI上的问题,但是当我以无头模式运行它时,它仍然失败。
if (browser.family === 'chromium' || browser.name === 'electron') {
launchOptions.args.push("--disable-features=CrossSiteDocumentBlockingIfIsolating,CrossSiteDocumentBlockingAlways,IsolateOrigins,site-per-process");
// whatever you return here becomes the launchOptions
// cypress triggers redirect in frame,and AD does not like this
//https://github.com/cypress-io/cypress/issues/3459
const ignoreXFrameHeadersExtension = path.join(__dirname,'../extensions/ignore-x-frame-headers');
launchOptions.args.push(`--load-extension=${ignoreXFrameHeadersExtension}`)
return launchOptions
}
上面的代码是我的插件的一部分,我希望它即使在无头模式下也能正常工作。 在chrome中无头运行Cypress时如何传递上述参数?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。