faint-ocean-92094
01/25/2023, 4:40 PMrecurse(
() = cy.task('getLastEmail'),
Cypress._.isObject,
{
timeout: 60000,
delay: 5000,
},
)
.its('html')
.then((html) => {
cy.document({ log: false }).invoke({ log: false}, 'write', html)
})
That gets the email, brings it up to the screen, and I can extract anything using regular cypress methods
I assume this part .invoke({ log: false}, 'write', html) is what needs to change, but I'm not sure how can I do that. Just parsing the HTML and extracting the document but without actually showing the email in the browser, so I can remain in the screen I was at.
Any ideas?gray-kilobyte-89541
01/25/2023, 6:00 PMfaint-ocean-92094
01/26/2023, 3:16 PMmodern-dawn-86006
01/26/2023, 8:41 PMfaint-ocean-92094
01/27/2023, 4:25 PMcy.document({ log: false }).invoke({ log: false}, 'write', html) you can do:
.its('html')
.then((html) => {
var email = document.createElement( 'html' );
email.innerHTML = html
// <add your code for the HTML doc here>
// example
verificationCode = email.getElementByTagName('em').item('innerText).textContent
})modern-dawn-86006
01/29/2023, 12:03 PM