So what's the best way to go about this? Lets pretend im testing localhost, or a remote site. That either has a mysql or postgreSQL database.
I have a few automated tests that create things (X,Y,Z widgets). However deleting these would require clicking a link based on the xpath where it resides on a list of widgets to delete.
This seems....very brittle.
Is there a better way around this? Our main goal is to strengthen regression testing after pushing a new feature to a site that is sort of in "maintenance/final mode"). So resetting the database seed file is possible (This is mostly rails sites).
I would use database cleaner, but I cannot find a good tutorial on using it with capybara/poltergeist. Plus im not sure it works on remote sites (Since im not spinning up a capybara server, im hitting a remote site even if it's just localhost).
Or are tests that "add" things just not a good idea in general, or I just have to deal with using brittle tests to delete the items?