What i want is to check that "ZZ" is showing in the table row considering that i can have other rows with the same "ZZ" in the same cell name.
i have done this so far:
cy.contains('tr', 'abc...')
.parent()
.within(()=> {
cy.get('td.v-cell').should('have.text', 'ZZ')
})
I am getting: expected [ <td.v-cell>, 19 more... ] to have text ZZ, but the text was 20%20%5%0%20%-0-20%-20%-ZZ
I have this html: https://i.stack.imgur.com/k224U.png
How do i verify the text even if the text can appear in other rows as well..Also if i change ZZ to 20% it should be getting error as the text is ZZ.
Thank you
Instead if have.text you can use include.text something like:
cy.get('td.v-cell').should('include.text', 'ZZ')
Assuming abc is a td element, you can do like this:
cy.contains('td', 'abc...')
.parent()
.within(() => {
cy.get('td.v-cell').should('include.text', 'ZZ')
})
Again assuming that the tr you want to go is the immediate next:
cy.contains('td', 'abc...')
.parent('tr')
.next()
.within(() => {
cy.get('td.v-cell').should('include.text', 'ZZ')
})