You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're already using @testing-library for our react code, the library for cypress brings the same benefits - it will allow us to write end to end tests that better mimic user behaviour by interacting with elements based on their role/text/labels rather than their classes. As well as making the specs easier to follow and de-coupled from our class names, it helps to ensure our site is accessible (i.e form elements have labels).
To demonstrate this I've written added a new test to work with multiple files. If we like this approach, we can change over other specs as we write or update them.
Note that cypress testing library doesn't seem to have direct support for the Shadow DOM yet (see testing-library/dom-testing-library#413 ) but we still works if we load the shadow DOM using the cypress finder. One quirk I found is that `findByLabelText` doesn't work from the root shadow dom element which is why I've called it on `children()`.
0 commit comments