I am trying to apply the Page Object Model (POM) to some tests using Cypress.
Unfortunaly I can't read some webelement value and return it as a method or function value. I needed to make something like these to work:
var1 = cy.get("input#inpUserName").then(($var1) => {
cy.log($var1.val());
})
cy.log(var1)
But all I could do was:
cy.get("input#inpUserName").then(($var1) => {
cy.log($var1.val());
})
For what I researched I think there is no solution for that with Cypress. But I'd like to see if anyone has any suggestion about it.