我正在运行 Cypress 测试https://localhost:3000,这也是我的CYPRESS_BASE_URL。导航到/重定向到/en内部,效果很好。但我正在编写的测试是关于构建新 URL 的表单,例如https://localhost:3000/foobar?param=value. 这有效,我什至可以看到我重定向到的页面。但赛普拉斯对此抱怨道:
Cypress detected a cross origin error happened on page load:
> Blocked a frame with origin "https://localhost:3000" from accessing a cross-origin frame.
Before the page load, you were bound to the origin policy:
> https://localhost:3000
A cross origin error happens when your application navigates to a new URL which does not match the origin policy above.
A new URL does not match the origin …Run Code Online (Sandbox Code Playgroud)