I'd like to write a plugin that will hook onto every visit call, and it'll make sure something exists in the DOM. If not, then reload.
We're using a 3rd party library on dev that we cannot eliminate. It causes a race condition in rare cases, and it makes our React render fail, leaving an empty root behind. This causes random failures during our CI, making E2E tests fail.
I want Cypress to reload always until the root element is not empty.
I went through the Plugin documentation, but couldn't really find anything helpful at first glance.