Data Driven Testing (3) - Using Tools

Data Driven Testing (3) - Using Tools

  • Step 1: Prepare the database
  • Step 2: Generate test data template
  • Step 3: Prepare test data
  • Step 4: Import test data
  • Step 5: Prepare and execute unit tests
  • Step 6: System Integration


Step 1: Prepare the database

to execute create_test_db/create_test_db.sql in the attachment

Step 2: Generate a test data template

Modify ddtt_v1.0-SNAPSHOT/test-data-config.properties according to your actual situation and
execute ddtt_v1.0-SNAPSHOT/ in the attachment SyncTemplate.bat

Step 3: Prepare test data

Modify template/DDTT_TEST_DATA.xlsx in the attachment as needed, or directly modify the test data template generated in Step 2

Step

4: Import test data and execute ddtt_v1.0-SNAPSHOT/SyncData in the attachment .bat

Step 5: Prepare the unit test and execute the

normal writing unit test code. There is nothing special, but you don't need to write the data preparation code. It is

recommended to add comments related to the test data in the test code.

//DDTT v0.002
public void deleteStudentTest () {
studentService.deleteStudent(2);

StudentTO to = studentService.findStudent(2);
Assert.assertNull(to);
}

Step 6: System Integration

Execute java -XX:MaxPermSize=512m -jar ddtt_v1 in Maven or Ant. 0.jar syncData

If you are interested in this tool, or if you are interested in this test idea, you can add my WeChat or Weibo to discuss it together.

WeChat: Sulaohuai
Weibo: Su Laohuai

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326637954&siteId=291194637