Using invoke('val')
instead of invoke('text')
worked for my case.
Reminder of the html tag
<input type="text" class="form-control" name="email">
Cypress code
cy.get('input[name="email"]')
.invoke('val')
.then(sometext => cy.log(sometext));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…