In order to test some functionalities of a grid we have on our website I am currently creating new entries for each test run that I can then alter and act on in my test suites.
After the tests have run an afterAll()-Function deletes these entries.
Now if for some reason the test crashes and the afterAll()-Function does not get executed properly these entries still remain and will raise a conflict in the next test iteration as they'd be duplicates.
Is there a way to prevent this?
My idea was to check the grid's entries before creating a new entry and if an entry with the same identifying stringalready exists in the grid concatenate a '1' to the end of the new identifying string.
If so, how would this be implemented?