Using cypress.io I can get a list of HTML elements matching a given CSS selector like so:
cypress.get(".some-class")
If no elements having the class
'some-class'
are found on the page, the test fails. This is by design.
I would like to try to get a list of HTML elements as above, but not to fail the test if the number of elements is 0.
How can I achieve this using cypress.io?