Issue
how can I test the Textarea text which is disappearing after you start to write something?
after I write something nothing changes on showed dom.
I want to test that Enter a comment.
texts disappearing.
Thank you for advices...
Solution
Expanding on @Prophet's answer:
I would test the placeholder and the value of the input, in that order.
cy.get('your textarea selector')
.should('have.attr','placeholder','Enter a comment.')
.type('stackoverflow')
.should('have.value','stackoverflow')
Edit: Checking if the textarea is empty before typing (more robust test). Another option could be doing a .clear before the .type
cy.get('your textarea selector')
.should('have.attr','placeholder','Enter a comment.')
.should('have.value','')
.type('stackoverflow')
.should('have.value','stackoverflow')
Answered By - Jon A
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.