How do you test for Add, Edit, Delete user functionalities?

Hello All,
I want to write UI automated test scripts for an application that has functionalities of Add user, edit user, delete user.

How can I do this since I am going to run the scripts in a pipeline/continuously? My issue is that the tests may fail after the delete user test runs since there may be no more data. How do I write tests such that there is always data to add, edit and delete even if I want to run these tests in parallel? Can I do this with UI tests? the application lets you view when you add, edit or delete a user? or what are some of the best ways for this?

Hello @adea and Welcome!

I recommend isolating the Add/Edit/Delete functions from the User Interface. That is, design tests to evaluate these functions through an API, web service, or other method of interaction. Ideally, these tests are unit tests and would easily fit into a pipeline.

With the results of those tests, the tests executed through the UI become simpler in that the tests mostly confirm that data collected from the UI is successfully presented to the layer that implements the function (the API, web service, or other). If the tests are written with a mocking library, there should be no concerns about data since the database interaction can be mocked.


1 Like

Okay great!
Thank you @devtotest