Cypress显示JS窗口_tcfapi错误,我无法从手动测试中重现



Cypress测试再现此错误https://github.com/Robot72/quantcast-cypress-issue/blob/master/cypress/integration/quantcast/check_errors.spec.js

此测试代码:

context('Navigation to our website', () => {
it('Visit and check quantcast has error or not', () => {
cy.visit('https://www.nanoresort.com/stories/celebrities-lost-money-can-no-longer-afford-extravagant-lifestyles/');
})
})

屏幕截图显示了此问题窗口_tcfapi错误

如果我在浏览器中从测试中打开此链接,则不会看到此窗口__tcfapi错误。我可以在任何其他使用quantcast库的网站上重现这个错误,但如果没有柏树,我的浏览器就看不到这个错误。

你能帮我理解为什么我在柏树运行这个测试时会出现这个错误吗?

如果您不需要调用Quantcast api,您可以通过阻塞cypress.json中的脚本域来修复它

{
"blockHosts": [
"*.quantserve.com",
"*.consensu.org"
]
}

最新更新