赛普拉斯 - 无法打开链接/锚定标签URL
我正在尝试使用cy.click()方法通过Cypress单击简单的锚标签来导航到Web应用程序的不同部分。
浏览器中的URL更新到新URL,但页面加载失败。它给出了一个错误,随后所有以下步骤都失败了。这个错误是我可以手动和Firefox时通过相同步骤导航的原因。
我尝试使用CY.Wait()也尝试使用CY.SHOULD()断言,直到可见一个元素,但页面本身未能加载。
如果我使用cy.reload()页面重新加载并正常工作(浏览中已经设置了新的URL)。
注意:我仅在Chrome和Electron中面对这个问题。这不是Firefox中的问题,这是令人惊讶的。
cy.get("button[href='someLink']").click()
cy.reload()
赛普拉斯赛跑者新url
在单击我可以看到的“ new url”的Cypress Runner中 Chrome中没有发生
只是在控制台的
,我可以看到新的URL和URL更新:PushState Console URL URL更新:
Web应用程序问题是吗?还是Chrome侧或柏树上的错误根本无法路由到URL?
I am trying to navigate to different parts of my web application by clicking on simple anchor tags via cypress using cy.click() method.
The url in the browser updates to the new url but the page load fails. It gives an error and subsequently all the following steps fail. This error is not valid cause I can manually and on Firefox navigate to this with the same steps.
I have tried to cy.wait() also tried to assert using cy.should() till an element is visible but the page itself fails to load.
If I use cy.reload() the page reloads and works fine (new url is already set in the browse).
Note: I am facing this issue only in Chrome and Electron. This is not a problem in Firefox which is surprising.
cy.get("button[href='someLink']").click()
cy.reload()
Cypress runner New Url
On click in the cypress runner I can see "new url" but the redirect fails or just doesn't happen in chrome
In the console I can see New url and Url updated by: pushState
Console url update by pushState:
Is the issue with the web app? Or is there a bug on chrome side or cypress is simply not able to route to the url?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现这个解决方法
I found this workaround