赛普拉斯:如何访问或键入生成的URL到柏树浏览器中

发布于 2025-02-05 14:31:18 字数 848 浏览 4 评论 0原文

我目前有一封电子邮件SMTP服务器发送电子邮件,该电子邮件生成URL。

我可以从电子邮件中获取URL的内容,但是我想访问,或将此URL键入当前的柏树地址栏。

我在柏树中的代码看起来像这样。

以及功能文件中相关的代码线看起来像这样。

我运行柏树时,代码会得到此错误。

无论如何我可以使用此生成的URL并将其插入柏树地址栏吗?

I currently have an email SMTP server that sends an email, that generates a URL.

I am able to get the contents of the URL from the email, but I want to then visit, or type this URL into the current Cypress address bar.
Cypress Runner Log - URL Example

The code I have in Cypress looks like this.
CypressExample.js

And the line of code related in the feature file looks like this.
CypressExample.feature

When I run the Cypress code is get this error.
CypressError

Is there anyway I can use this generated URL and insert it into the Cypress address bar?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟─花易冷 2025-02-12 14:31:19

您需要的属性是.href而不是.value

cy.mailosaurGetMessage(serverId, {
  sentTo: testEmail
}).then(email => {
  cy.visit(email.text.links[0].href)
})

The property you need is .href rather than .value

cy.mailosaurGetMessage(serverId, {
  sentTo: testEmail
}).then(email => {
  cy.visit(email.text.links[0].href)
})
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文