Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Steps for PHPUnit- Interface testing of Interface Automation Test Series

Shulou Source: shulou.com Published: 2022-06-03 07:22:54 09月18日 Update

Then the last article continues to talk about the PHPUnit- interface testing basis of the interface automation test series.

Steps for interface testing

There is nothing special about the steps of interface testing, but the key thing is to read the interface documentation. There is a particularly strange phenomenon here. As a test, we read all kinds of complex and unreliable requirements every day, and we still do a good job of testing. But why don't you know how to read a very good document? I really don't understand! For example, give you a very detailed study document, or build the environment of the document or API document, many people do not want to read, or even refuse to read! Then how can you do the test well? Especially those who want to achieve a high end point. This habit needs to be changed, folks!

OK, to get back to the point, the interface document should pay attention to the interface address, requirements, input parameters (request), output parameters (response) and the meaning of key parameters. Just like demo in the last article.

Let's briefly summarize the following steps:

Ask for the interface documentation and read it, especially to find out the parameters mentioned above

Design and test case. If it is an interface function test, the combination of parameters should be considered, including required, optional, etc.

Set up the test environment. There's no need to say more about that. Sometimes the interface is not well developed, and we want to debug the script in advance, so we can use mock technology.

Write interface test code. I know a lot of people have headaches. But... no, no, no. Let's just say practice and never tire of it.

Run the record results and generate a report

PS: we will follow this step in the follow-up.

By the way, the interfaces of both mobile app and web are similar, except for a few more parameters, or some of them are logically different, so this is also one of the important reasons for the cost-effectiveness of the interface testing framework.

Data acquisition

The code involved later can be obtained in the following ways (the code will be distributed gradually, don't worry):

Click the link to join group 522720170 (available in the share): https://jq.qq.com/?_wv=1027&k=5C08ATe

Tags: Interfaces tests documentation steps parameters code keys situations environment or automation complexity headaches special anxious important tiresome pretty much next the first part Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi vpn Shulou Technology MySQL