Reputation: 47
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.
The code I have in Cypress looks like this.
And the line of code related in the feature file looks like this.
When I run the Cypress code is get this error.
Is there anyway I can use this generated URL and insert it into the Cypress address bar?
Upvotes: 1
Views: 486
Reputation: 32034
The property you need is .href
rather than .value
cy.mailosaurGetMessage(serverId, {
sentTo: testEmail
}).then(email => {
cy.visit(email.text.links[0].href)
})
Upvotes: 1