getting help on flaky tests
# i-need-help
a
I have a smoke test with a set of 14 tests and these test are flaky due to various reasons . I find a few things that I can do to improve the robustness of the test. 1. Separate tests logically to make them independent of each other 2. Smooth handover of test 1 to test 2, currently if test 1 is looking for an element which if does not find or stuck the test suite is just hanging and not completing ( any suggestions ) 3. Currently the test suite is using css selectors , I am planning to change it to the data- cy attribute ( any suggestions )
p
Make sure tests are totally independable. They have to run without the need of previous tests. If you need setup, database seeding or any type of authentication / token generation, use before and beforeEach
a
Thanks 🙏 Bogdan
Abu help on which is the best method to locate elements - the most stable and better approach
Currently the tests are using css
Selectors
a
Thank you 🙏