Dynamically getting the number of elements #18299
Unanswered
ikit
asked this question in
Component Testing
Replies: 1 comment 1 reply
-
How about something like this https://glebbahmutov.com/cypress-examples/8.5.0/recipes/add-list-item.html |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Is there a way to dynamically get the number of element with cypress ?
I see lot of solution on Internet ( like this one or this one ), but no one works for me.
The HMI I have to is plugged to nightly dump of a SAP database with lot of data. I can't create a "simple data set to run my tests" and hardcode test values (like in that test
cy.get("table > tbody").find("tr").should("have.length", 4);
). My tests have to be flexible and I have to compute dynamically some value.By example, I would like to check if the delete button of a element in a list is working.
For this one I would like to first count the number of element in my list, and then after clicking of the delete button of the item, checking that the new lenght of the list is the former lenght - 1.
How do this kind of test ?
Beta Was this translation helpful? Give feedback.
All reactions