cy.contains cant find element after calculations #29736
Replies: 1 comment
-
i use .invoke |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
When I try to find an element by doing a preliminary calculation (withinSubject: true,):
const contribution = 10000000.01;
const survival = new Intl.NumberFormat().format(contribution);
....
cy.get('[class="parent-grid-12 ai-width-12"] tr[id="-row-0"]')
.find('[class="ai-output-text-bootstrap"]')
.should('be.visible')
.eq(1)
.contains(survival, {matchCase: false})
But I see this:
Try toLocaleString(). Same error.
If i type like this all works:
cy.get('[class="parent-grid-12 ai-width-12"] tr[id="-row-0"]')
.find('[class="ai-output-text-bootstrap"]')
.should('be.visible')
.eq(1)
.contains('10 000 000,01')
But i need to use calculation and find this element:
10 000 000,00
I new in cypress and JS. Sry, if my question is stupid
Beta Was this translation helpful? Give feedback.
All reactions