When you are going to use an interface testing framework or self-made wheels, maybe you need to know what functions the next interface automation testing framework must have.
1. Verification
This is easy to understand. If there is no verification and the interface is simply executed, then there is no testing. Therefore, it is a necessary function to support the verification of the return value.
Python automated testing video tutorial: The latest collection of Python automated testing development framework in 2023 [full stack/actual combat/tutorial] collection essence, annual salary of 40W+ after learning_哔哩哔哩_bilibili https://www.bilibili.com/video/BV1AF411T7qJ /?spm_id_from=333.999.0.0
2. Data isolation
Data isolation means that the specific request interface, parameters, verification and other data are separated from the code for easy maintenance. Once you need to adjust the interface use case or add an interface use case, you can quickly find the location. Another benefit of isolation is that you can Reuse, the framework can be extended to other teams, users can use the same code, and only need to fill in their own use cases according to the requirements to test.
3. Data transfer
After achieving data isolation and maintainability, data transfer is another more important requirement.
Data transfer refers to the ability to pass parameters downward between interface use cases. For example, we create an order by creating an order interface, and the interface will return an order number. Next, we need to call the interface to query the order, and from the returned data Verify with the data in the use case of creating an order. At this time, the request data of the second interface needs to be extracted from the return of the first interface use case. Examples of this abound, so supporting data passing is yet another essential feature.
If you are interested in software testing, interface testing, automated testing, and interview experience exchange, you can add software testing exchange: 1085991341, there will be irregular free information links, and there will be technical exchanges with colleagues.
4. Dynamic functions
In actual use case scenarios, we may have requirements such as randomly generating a mobile phone number and encrypting strings. After the data and code are isolated, we need the code to support the execution of corresponding functions to fill in when the corresponding keywords are identified. For example, when you fill in phone() in the data, it will be replaced with 137XXXXXXXX during execution, and when you fill in random(5), it will be replaced with a five-digit random number. etc.
Five, configurable
Sometimes, our requirement is that the use case can not only be executed in one environment, but the same interface use case can be executed in multiple environments such as QA, pre-release, and online. Therefore, the framework needs to be configurable, easy to switch, and call different configuration files to execute in different environments.
6. Log
The log contains key information such as the specific execution interface, request method, request parameters, return value, verification interface, request time, time-consuming and other key information. The advantage of the log is that it can quickly locate where to fill in when there is a problem with the new use case If there is a problem, the second reason is that when a bug is found, it is convenient to provide data to the development feedback, and the development can quickly locate the problem from information such as trigger time and parameters.
Video Tutorial:
7. Visual report
After the use case is executed, it is time to show the results to the team. A visual report can facilitate team members to know the number of successes and failures of each automation interface use case execution.
8. Use Case Driven
-
The driving mode of the use case involves how to store test data, how to describe the use case, and how to reuse;
-
In consideration of efficiency, concurrency should also be supported;
-
Of course, the test report can not only record success and failure, but also statistics on the time-consuming use case execution, interface call time, and the pass rate of the scene.
9. Data isolation
-
Whether a use case can be reused should be related to the design of the use case, not so much to the framework.
-
Concurrency is not necessary in terms of interface automation, of course it is more perfect.
-
The report is indeed as powerful as possible. It is best to have data that the boss cares about and data that development cares about.
I hope the above content is helpful to you. Friends who have been helped are welcome to like and comment.
Python automated testing video tutorial: The latest collection of Python automated testing development framework in 2023 [full stack/actual combat/tutorial] collection of essence, annual salary of 40W+ after learning_哔哩哔哩_bilibili https://www.bilibili.com/video/BV1AF411T7qJ /?spm_id_from=333.999.0.0