Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The Design Conception of PHPUnit- Framework for Interface Automation Test Series

Shulou Source: shulou.com Published: 2022-06-03 08:07:44 09月23日 Update

About case Design

We usually focus on coding and often forget that the design of case is also very important. If you are doing interface function automation testing, then you should consider the combination of various interface parameters, such as, in normal times, abnormal times, required, and so on. At this time, it is time to test the foundation of case design.

If you are doing interface performance testing, you can generally choose the positive case.

Design Conception of Test Framework

As mentioned earlier in the article "to those who have code foundation but still don't know how to learn automated testing", testing ideas are more valuable than technology, and an example is given about how to learn automated testing. one of the most taboo is to write code if you don't want to come up.

So, let's calm down and think about it from a design point of view. Everyone's ideas are different, there is no need to be serious, I only list my ideas here, there must be some disadvantages, just for reference.

Commons put public function

Src release source code

Testcases put the test case file, a test case file is best for all test cases of an interface, do not mix together

Testdata puts test data. If the data is long or large, it can be extracted and put here. It can be regarded as a reservation.

Testsuites organizes test cases into different test suites

Imagine further:

Put requests in commons, for example, if you call get, post requests, etc.

Read the configuration file in src. We know that host often changes, and it will be more convenient to manage it in the form of configuration files.

Testcases release the test code

Testdata can put test data, thus achieving the separation of data and code. We haven't mentioned it here. Interested friends can try it themselves.

Testsuites mainly does the combination of use cases, and the method of using it is very simple, followed by code.

Source code acquisition

Click the link to join QQ Group 522720170 (free open courses, videos and everything):

Https://jq.qq.com/?_wv=1027&k=5C08ATe

Tags: Testing code interface design data files automation ideas time friends composition configuration framework different valuable important necessary everything bad from design Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Shulou Tech Info Shulou Information Huawei