https://cypress.io logo
h
What is the best approach to test react js (and the like) generated html which often without id, name or tag and uses a lot of flexbox to hide things?
l
have u tried xpaths?
its not natively supported in cypress but there is a library for it
e
Either go in and add
testids
to the elements yourself, or get stuck using a lot of
contains
h
Yes I am using xpath, cypress build-in element selector as well as browser dev tool at the moment. It will get the job done but not in an elegant manner. React generated elements that I am looking at are nested within a lof of div or container, checkboxes are not standard checkboxes and don't have input tag...etc it make selecting somewhat troublesome and messy