#28: CRUD Test Revisit (without Database Reset)
Client CRUD Test without Database Reset.
This article is one of the “Selenium Training Workbook” series, a set of bite-sized exercises. While each exercise is independent, it may require knowledge and practices covered in previous episodes.
In the previous episode, we created CRUD Client tests for WhenWise with database reset (my father calls it ‘The Simpsons Pattern’). However, 99.9+% web apps won’t have this database reset utility implemented. This exercise shows a typical set of CRUD tests, without database reset.
Learning Objectives
Review CRUD Test Design, without database reset.
Review refactoring
Variables and Scope
Global Variables
Test Design
We still design four test cases as a whole, putting them into a single test script file.
CREATE
We need to create a unique client every single time. This can be achieved using dynamicly-generated names and emails.READ
Use the new client freshly created by the above test case. This means We need to remember the new client name.UPDATE and DELETE
These two actually are similar to the READ — using the newly created client. DELETE must be the last test case in the script.
Test Data:
Site URL: https://whenwise.agileway.net
Login: driving@biz.com
Password: test01
Tasks
Task 1: Using Dynamic Data for CREATE
To ensure uniqueness within the system, each client must have a distinct email address. This means it has to be dynamically assigned. Thanks to Faker, it is quite easy to do so.
Keep reading with a 7-day free trial
Subscribe to AgileWay’s Test Automation & Continuous Testing Blog to keep reading this post and get 7 days of free access to the full post archives.