Automatic interface testing method and system, terminal and storage medium
Through automated interface testing methods, we can obtain testing requirements, formulate strategies, build frameworks and conduct automated testing, and solve the problems of low efficiency and low accuracy of interface testing in the existing technology, and achieve more efficient and accurate test results.
Patent Information
- Application Number
- CN202411511046.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, interface testing requires frequent manual participation, resulting in low testing efficiency and low accuracy.
Provide an automated testing method for interfaces, including obtaining test requirements, formulating test strategies, building a test framework, and obtaining test results through automated testing, and determining that the interface test is completed.
It reduces interface testing time, improves testing efficiency and accuracy, and reduces the occurrence of manual errors.
Smart Images

Figure CN119493727A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automated testing technology, and in particular to an automated testing method, system, terminal and computer-readable storage medium for an interface. Background Art
[0002] Before a software product such as a system or application is released to the market, it is usually necessary to conduct various tests. Automated interface testing is an important cornerstone of software testing. When the interface between systems is developed, it is necessary to test the various functions of the interface, such as checking data interaction, transmission, control management process, and interdependence between systems, in order to verify the qualification rate of the interface.
[0003] At present, in the prior art, interface testing requires frequent manual participation, which not only consumes a lot of manual time, resulting in low test efficiency, but also causes errors during testing, resulting in low test accuracy.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The main purpose of the present invention is to provide an automated testing method, system, terminal and storage medium for an interface, aiming to solve the problem in the prior art that interface testing requires frequent manual participation, which not only consumes a lot of manual time, resulting in low testing efficiency, but also causes errors during testing, resulting in low test accuracy.
[0006] To achieve the above object, the present invention provides an automated testing method for an interface, the automated testing method for an interface comprising the following steps:
[0007] When it is detected that the test button of the target interface is clicked, the test requirement of the target interface is obtained, and a corresponding test strategy is obtained according to the test requirement;
[0008] Formulate a plan for the target interface according to the test strategy to obtain a target test plan, and build a corresponding test framework according to the target test plan;
[0009] The target interface is automatically tested according to the test framework to obtain a test result. If the test result meets the preset requirements, it is determined that the target interface test is completed.
[0010] Optionally, the automated testing method for the interface, wherein when it is detected that the test button of the target interface is clicked, the test requirements of the target interface are obtained, and a corresponding test strategy is obtained according to the test requirements, specifically including:
[0011] When it is detected that the test button of the target interface is clicked, the test requirements of the target interface are obtained, wherein the test requirements include a test object, a test purpose, a test focus, and a test type;
[0012] A scheme evaluation is performed on the target interface according to the test purpose, the test focus and the test type to obtain an evaluation result, and a corresponding test strategy is determined according to the evaluation result.
[0013] Optionally, the automated testing method for the interface, wherein the step of formulating a plan for the target interface according to the test strategy to obtain a target test plan, and building a corresponding test framework according to the target test plan, specifically includes:
[0014] Formulate a test execution mode of the target interface according to the test strategy to obtain a target test execution mode, determine corresponding test output information according to the target test execution mode, and formulate a corresponding target test plan according to the target test execution mode and the test output information, wherein the test output information includes an automated test report and an execution log;
[0015] Obtain the programming language and interface type of the target interface, and build a corresponding test framework according to the target test scheme, the programming language and the interface type, wherein the target test scheme is one of the equivalence class partitioning method, the boundary value method and the scenario method.
[0016] Optionally, the method for automated testing of an interface, wherein the target interface is formulated according to the test strategy to obtain a target test plan, and a corresponding test framework is built according to the target test plan, and then further comprises:
[0017] Acquire the operating environment information of the target interface, extract the corresponding source code information according to the operating environment information, and decompress the source code information to obtain the target source code;
[0018] The target source code is compiled to obtain a corresponding execution file, and a test environment for the target interface is constructed according to the execution file.
[0019] Optionally, the automated testing method for the interface, wherein the automated testing of the target interface is performed according to the test framework to obtain a test result, and if the test result meets a preset requirement, it is determined that the target interface test is completed, specifically includes:
[0020] Performing automated testing on the target interface according to the test framework and the test environment to obtain a test result, and determining whether the test of the target interface is completed according to the test result;
[0021] If the test result shows that all test items of the target interface are completed, it means that the test result meets the preset requirements, and it is determined that the target interface test is completed.
[0022] Optionally, the method for automated testing of the interface, wherein the automated testing of the target interface is performed according to the test framework and the test environment to obtain a test result, and whether the test of the target interface is completed is determined according to the test result, and then further comprises:
[0023] If the test result shows that the test item of the target interface is abnormal, it means that the test result does not meet the preset requirements, and the corresponding abnormal item is extracted;
[0024] The abnormal items are recorded and processed to obtain corresponding abnormal logs, abnormal reminder information is generated according to the abnormal logs, and an early warning is issued according to the abnormal reminder information.
[0025] Optionally, the method for automated testing of an interface, wherein the automated testing of the target interface is performed according to the testing framework and the testing environment to obtain a test result, further comprises:
[0026] Obtaining a test time of a test item of the target interface, comparing the test time with a preset time threshold to obtain a comparison result, and determining whether the test item is abnormal according to the comparison result;
[0027] If the comparison result is that the test time is less than or equal to the preset time threshold, it is determined that there is no abnormality in the test item;
[0028] If the comparison result is that the test time is greater than the preset time threshold, it is determined that there is an abnormality in the test item.
[0029] Optionally, in the method for automated testing of an interface, the automated testing system for the interface comprises:
[0030] A requirement acquisition module, used to acquire the test requirement of the target interface when detecting that the test button of the target interface is clicked, and obtain the corresponding test strategy according to the test requirement;
[0031] A program formulation module, used to formulate a program for the target interface according to the test strategy, obtain a target test program, and build a corresponding test framework according to the target test program;
[0032] The interface testing module is used to perform automated testing on the target interface according to the testing framework to obtain a test result. If the test result meets the preset requirements, it is determined that the target interface test is completed.
[0033] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and an automatic testing program for an interface stored in the memory and executable on the processor, wherein the automatic testing program for the interface, when executed by the processor, implements the steps of the automatic testing method for the interface as described above.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an automated testing program for an interface, and when the automated testing program for an interface is executed by a processor, the steps of the automated testing method for an interface as described above are implemented.
[0035] In the present invention, the present invention discloses an automatic test method, system, terminal and storage medium of an interface, the method comprising: when detecting that the test button of the target interface is clicked, obtaining the test requirements of the target interface, and obtaining the corresponding test strategy according to the test requirements; formulating the target interface according to the test strategy, obtaining the target test plan, and building the corresponding test framework according to the target test plan; performing automatic testing on the target interface according to the test framework, obtaining the test result, and judging that the target interface test is completed if the test result meets the preset requirements. The present invention can reduce the test time of the interface, thereby improving the efficiency of the interface test, and also reduces the situation of errors caused during the test, thereby improving the accuracy of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flow chart of a preferred embodiment of the automatic testing method of the interface in the present invention;
[0037] Figure 2 It is a structural diagram of a preferred embodiment of the automatic test system of the interface in the present invention;
[0038] Figure 3 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0040] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0041] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0042] The automated testing method of the interface described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the automated testing method for the interface comprises the following steps:
[0043] Step S10: When it is detected that the test button of the target interface is clicked, the test requirement of the target interface is obtained, and a corresponding test strategy is obtained according to the test requirement.
[0044] The step S10 comprises:
[0045] Step S11: when it is detected that the test button of the target interface is clicked, the test requirements of the target interface are obtained, wherein the test requirements include a test object, a test purpose, a test focus, and a test type;
[0046] Step S12: perform a solution evaluation on the target interface according to the test purpose, the test focus and the test type to obtain an evaluation result, and determine a corresponding test strategy according to the evaluation result.
[0047] Specifically, before a system or application software product is launched on the market, various tests are usually required, and the automated testing of interfaces is an important cornerstone of software testing. After the interface between systems is developed, it is necessary to test the various functions of the interface, and the significance of interface testing is that, first, interface testing may find defects that cannot be found by application testing; second, interface testing is easier to combine with an automated testing system or platform; third, it can be invested earlier than application testing, thereby discovering problems earlier. In the embodiment of the present invention, an API interface (Application Programming Interface) is used as an example, wherein the API interface is some predefined functions, the purpose of which is to provide applications and developers with the ability to access a set of routines based on certain software or hardware, without accessing the source code or understanding the details of the internal working mechanism, and the corresponding interface types are divided into local interfaces (for example, Windows API, Android API, etc.) and network interfaces (for example, Http, Coap interfaces, etc.), and are also divided into internal interfaces and external interfaces; the KaihongOS interface corresponding to the test belongs to the local interface, and the L0 centralized control platform interface belongs to the network interface. When it is detected that the test button of the target interface (for example, the L0 centralized control platform interface) is clicked, the test requirements of the target interface are obtained, wherein the test requirements include the test object, test purpose, test focus and test type, and the test purpose is to detect the interaction points between the external system and the tested system and between the internal systems, the test focus refers to checking the data interaction, transmission, control management process and the interdependence between systems, etc., and the test type refers to mainly functional testing, taking into account a small amount of stress and performance testing. Afterwards, the target interface is evaluated according to the test purpose, the test focus and the test type to obtain the evaluation result, and the corresponding test strategy is determined according to the evaluation result.
[0048] Step S20: formulate a plan for the target interface according to the test strategy to obtain a target test plan, and build a corresponding test framework according to the target test plan.
[0049] The step S20 comprises:
[0050] Step S21: formulate a test execution mode of the target interface according to the test strategy to obtain a target test execution mode, determine corresponding test output information according to the target test execution mode, and formulate a corresponding target test plan according to the target test execution mode and the test output information, wherein the test output information includes an automated test report and an execution log;
[0051] Step S22, obtain the programming language and interface type of the target interface, and build a corresponding test framework according to the target test scheme, the programming language and the interface type, wherein the target test scheme is one of the equivalence class partitioning method, the boundary value method and the scenario method.
[0052] Specifically, in an embodiment of the present invention, after obtaining the test strategy of the target interface, it is necessary to formulate a corresponding test plan, namely, a target test plan. The specific formulation process is to formulate the test execution mode of the target interface according to the test strategy to obtain the target test execution mode, determine the corresponding test output information according to the target test execution mode, and formulate the corresponding target test plan according to the target test execution mode and the test output information, wherein the test output information includes an automated test report and an execution log; and the target test plan is one of an equivalence class partitioning method, a boundary value method and a scenario method; the equivalence class partitioning method refers to dividing the input into several subsets, selecting representative data from the divided subsets for testing, and the equivalence class partitioning method is divided into valid equivalence classes and invalid equivalence classes. For example, in a student score entry interface, the score X is an integer from 0 to 100, then the valid equivalence class: 0≤X≤100 (for example, 50), the invalid equivalence class: X<0 (for example, -5), X<0 >100 (for example, 200); the boundary value analysis method is a supplement to the equivalence class partitioning method. Generally, errors are found from the boundary of the equivalence class, including being exactly equal to the boundary value, just less than the boundary value, and just greater than the boundary value. For example, in the student score entry interface, the score X is an integer from 0 to 100, then the upper boundary value of X is: 99, 100, 101, and the lower boundary value is: -1, 0, 1; the scenario method solution refers to a design method that combs business logic based on user scenarios and simulates user operations. The scenario method solution is generally divided into simulating correct user operations and simulating incorrect user operations. For example, the printing interface of a printer, the correct operation is to call the printing interface after turning on the printer, and the incorrect operation is to call the printing interface after turning off the printer; then, the programming language and interface type of the target interface are obtained, and a corresponding test framework is built according to the target test solution, the programming language and the interface type. Building a corresponding test framework can handle many detailed problems of the system, such as transaction processing, security, data flow control, and other issues.
[0053] Furthermore, after building the test framework of the target interface, it is necessary to determine the corresponding test environment. The specific process is to obtain the operating environment information of the target interface, extract the corresponding source code information according to the operating environment information, and decompress the source code information to obtain the target source code; compile the target source code to obtain the corresponding execution file, and build the test environment of the target interface according to the execution file; and write test cases under the corresponding test framework. For example, ExampleJsunit.test.js is a test case, List.test.js is a test case loading file, and the test case follows the ES6 standard, describe represents a test suite, it represents a test case, describe supports multi-layer nesting; and describe supports two parameters, which are the test suite name and Test suite function; it supports three parameters, namely, the test case name, the filter parameter and the test case function; beforeAll means defining a preset condition in the test suite, which is executed before all test cases start and only executed once, supports one parameter, and is a preset action function; beforeEach means defining a unit preset condition in the test suite, which is executed before each test case starts, and the number of executions is consistent with the number of test cases defined by it, supports one parameter, and is a preset action function; afterEach means defining a unit cleanup condition in the test suite, which is executed after each test case ends, and the number of executions is consistent with the number of test cases defined by it, supports one parameter, and is a cleanup action function; afterAll means defining a cleanup condition in the test suite, which is executed after all test cases end and only executed once, supports one parameter, and is a cleanup action function.
[0054] Furthermore, if it is found that the content of the development interface description document is incomplete when designing the test plan and test cases, for example, the document lacks input parameter values, abnormal error codes, etc., then during the corresponding test, it is necessary not only to report the risk, but also to communicate with the developer in a timely manner. It is forbidden to write test cases based on subjective assumptions when the test input is insufficient; if the test can be started normally during script execution but the print log is interspersed and disordered, for example, due to improper use of the done function of the test case, then when debugging the script, the time consumption of each test case should be fully considered; in the test case that calls the asynchronous interface, the done function is only used when the test case ends abnormally or the last callback is completed; if during script execution, the failure of the current test case causes the subsequent test cases to fail to execute, for example, there is a coupling relationship between the use cases, such as the output of the next use case depends on the previous use case, then when writing the script, a single use case should be followed as the minimum test unit to avoid coupling relationships. For example, when testing Ethernet features, the Ethernet switch state is reset at the beginning of each use case to ensure that the abnormal switch state after the execution of a certain use case will not affect the subsequent use cases.
[0055] Step S30: perform automated testing on the target interface according to the test framework to obtain a test result. If the test result meets a preset requirement, it is determined that the target interface test is completed.
[0056] The step S30 comprises:
[0057] Step S31, performing automated testing on the target interface according to the test framework and the test environment to obtain a test result, and judging whether the test of the target interface is completed according to the test result;
[0058] Step S32: If the test result shows that all test items of the target interface are completed, it means that the test result meets the preset requirements, and it is determined that the target interface test is completed.
[0059] Specifically, in an embodiment of the present invention, after completing the construction of the test framework and test environment of the target interface, it is necessary to perform automated testing on the target interface. Specifically, the target interface is automatically tested according to the test framework and the test environment to obtain test results, and whether the test of the target interface is completed is judged according to the test results. If the test result shows that all test items of the target interface are completed, it means that the test result meets the preset requirements, and it is judged that the test of the target interface is completed. The present invention can reduce the testing time of the interface, thereby improving the efficiency of the interface testing, while also reducing the errors caused during the test, thereby improving the accuracy of the test.
[0060] Furthermore, if the test result shows that there is an abnormality in the test item of the target interface, it means that the test result does not meet the preset requirements, and the corresponding abnormal item is extracted; the abnormal item is recorded and processed to obtain the corresponding abnormal log, and abnormal reminder information is generated according to the abnormal log, and an early warning is issued according to the abnormal reminder information, so as to promptly remind the corresponding relevant personnel to handle it.
[0061] Furthermore, after the target interface is automatically tested according to the test framework and the test environment to obtain the test result, the test time of the test item of the target interface is obtained, the test time is compared with a preset time threshold to obtain a comparison result, and it is determined whether the test item has an abnormality based on the comparison result; if the comparison result is that the test time is less than or equal to the preset time threshold, it is determined that there is no abnormality in the test item; if the comparison result is that the test time is greater than the preset time threshold, it is determined that there is an abnormality in the test item.
[0062] Furthermore, if Figure 2As shown, based on the above-mentioned interface automation testing method, the present invention also provides an interface automation testing system accordingly, and the interface automation testing system includes:
[0063] The requirement acquisition module 51 is used to acquire the test requirement of the target interface when detecting that the test button of the target interface is clicked, and obtain the corresponding test strategy according to the test requirement;
[0064] A program formulation module 52 is used to formulate a program for the target interface according to the test strategy, obtain a target test program, and build a corresponding test framework according to the target test program;
[0065] The interface testing module 53 is used to perform an automated test on the target interface according to the testing framework to obtain a test result. If the test result meets a preset requirement, it is determined that the target interface test is completed.
[0066] Furthermore, if Figure 3 As shown, based on the above-mentioned automatic testing method of the interface, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Figure 3 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0067] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the terminal, such as the program code of the installation terminal, etc. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, an automated test program 40 of an interface is stored on the memory 20, and the automated test program 40 of the interface can be executed by the processor 10, thereby realizing the automated test method of the interface in the present application.
[0068] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing an automated testing method of the interface.
[0069] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0070] In one embodiment, when the processor 10 executes the automated test program 40 of the interface in the memory 20, the following steps are implemented:
[0071] When it is detected that the test button of the target interface is clicked, the test requirement of the target interface is obtained, and a corresponding test strategy is obtained according to the test requirement;
[0072] Formulate a plan for the target interface according to the test strategy to obtain a target test plan, and build a corresponding test framework according to the target test plan;
[0073] The target interface is automatically tested according to the test framework to obtain a test result. If the test result meets the preset requirements, it is determined that the target interface test is completed.
[0074] When it is detected that the test button of the target interface is clicked, the test requirement of the target interface is obtained, and a corresponding test strategy is obtained according to the test requirement, which specifically includes:
[0075] When it is detected that the test button of the target interface is clicked, the test requirements of the target interface are obtained, wherein the test requirements include a test object, a test purpose, a test focus, and a test type;
[0076] A scheme evaluation is performed on the target interface according to the test purpose, the test focus and the test type to obtain an evaluation result, and a corresponding test strategy is determined according to the evaluation result.
[0077] The step of formulating a plan for the target interface according to the test strategy to obtain a target test plan, and building a corresponding test framework according to the target test plan, specifically includes:
[0078] Formulate a test execution mode of the target interface according to the test strategy to obtain a target test execution mode, determine corresponding test output information according to the target test execution mode, and formulate a corresponding target test plan according to the target test execution mode and the test output information, wherein the test output information includes an automated test report and an execution log;
[0079] Obtain the programming language and interface type of the target interface, and build a corresponding test framework according to the target test scheme, the programming language and the interface type, wherein the target test scheme is one of the equivalence class partitioning method, the boundary value method and the scenario method.
[0080] The method further comprises formulating a plan for the target interface according to the test strategy to obtain a target test plan, and building a corresponding test framework according to the target test plan. The method further comprises:
[0081] Acquire the operating environment information of the target interface, extract the corresponding source code information according to the operating environment information, and decompress the source code information to obtain the target source code;
[0082] The target source code is compiled to obtain a corresponding execution file, and a test environment for the target interface is constructed according to the execution file.
[0083] The step of performing an automated test on the target interface according to the test framework to obtain a test result, and determining that the target interface test is completed if the test result meets a preset requirement, specifically includes:
[0084] Performing automated testing on the target interface according to the test framework and the test environment to obtain a test result, and determining whether the test of the target interface is completed according to the test result;
[0085] If the test result shows that all test items of the target interface are completed, it means that the test result meets the preset requirements, and it is determined that the target interface test is completed.
[0086] The method further comprises: performing an automated test on the target interface according to the test framework and the test environment to obtain a test result, and judging whether the test of the target interface is completed according to the test result, and then:
[0087] If the test result shows that the test item of the target interface is abnormal, it means that the test result does not meet the preset requirements, and the corresponding abnormal item is extracted;
[0088] The abnormal items are recorded and processed to obtain corresponding abnormal logs, abnormal reminder information is generated according to the abnormal logs, and an early warning is issued according to the abnormal reminder information.
[0089] The step of performing automated testing on the target interface according to the test framework and the test environment to obtain a test result further includes:
[0090] Obtaining a test time of a test item of the target interface, comparing the test time with a preset time threshold to obtain a comparison result, and determining whether the test item is abnormal according to the comparison result;
[0091] If the comparison result is that the test time is less than or equal to the preset time threshold, it is determined that there is no abnormality in the test item;
[0092] If the comparison result is that the test time is greater than the preset time threshold, it is determined that there is an abnormality in the test item.
[0093] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an automatic test program for an interface, and when the automatic test program for an interface is executed by a processor, the steps of the automatic test method for an interface as described above are implemented.
[0094] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0095] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0096] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. An automated testing method for an interface, characterized in that: The automated testing method of the interface includes: When it is detected that the test button of the target interface is clicked, the test requirement of the target interface is obtained, and a corresponding test strategy is obtained according to the test requirement; Formulate a plan for the target interface according to the test strategy to obtain a target test plan, and build a corresponding test framework according to the target test plan; The target interface is automatically tested according to the test framework to obtain a test result. If the test result meets the preset requirements, it is determined that the target interface test is completed.
2. The automated interface testing method according to claim 1, characterized in that: When it is detected that the test button of the target interface is clicked, the test requirement of the target interface is obtained, and a corresponding test strategy is obtained according to the test requirement, which specifically includes: When it is detected that the test button of the target interface is clicked, the test requirements of the target interface are obtained, wherein the test requirements include a test object, a test purpose, a test focus, and a test type; A scheme evaluation is performed on the target interface according to the test purpose, the test focus and the test type to obtain an evaluation result, and a corresponding test strategy is determined according to the evaluation result.
3. The automated testing method for an interface according to claim 1, characterized in that: Formulating a plan for the target interface according to the test strategy to obtain a target test plan, and building a corresponding test framework according to the target test plan, specifically includes: Formulate a test execution mode of the target interface according to the test strategy to obtain a target test execution mode, determine corresponding test output information according to the target test execution mode, and formulate a corresponding target test plan according to the target test execution mode and the test output information, wherein the test output information includes an automated test report and an execution log; Obtain the programming language and interface type of the target interface, and build a corresponding test framework according to the target test scheme, the programming language and the interface type, wherein the target test scheme is one of the equivalence class partitioning method, the boundary value method and the scenario method.
4. The automated testing method for an interface according to claim 1, characterized in that: The method further comprises formulating a plan for the target interface according to the test strategy to obtain a target test plan, and building a corresponding test framework according to the target test plan, and then further comprising: Acquire the operating environment information of the target interface, extract the corresponding source code information according to the operating environment information, and decompress the source code information to obtain the target source code; The target source code is compiled to obtain a corresponding execution file, and a test environment for the target interface is constructed according to the execution file.
5. The automated interface testing method according to claim 4, characterized in that: The step of performing an automated test on the target interface according to the test framework to obtain a test result, and determining that the target interface test is completed if the test result meets a preset requirement, specifically includes: Performing automated testing on the target interface according to the test framework and the test environment to obtain a test result, and determining whether the test of the target interface is completed according to the test result; If the test result shows that all test items of the target interface are completed, it means that the test result meets the preset requirements, and it is determined that the target interface test is completed.
6. The automated interface testing method according to claim 5, characterized in that: The method further comprises: performing an automated test on the target interface according to the test framework and the test environment to obtain a test result, and judging whether the test of the target interface is completed according to the test result, and then: If the test result shows that the test item of the target interface is abnormal, it means that the test result does not meet the preset requirements, and the corresponding abnormal item is extracted; The abnormal items are recorded and processed to obtain corresponding abnormal logs, abnormal reminder information is generated according to the abnormal logs, and an early warning is issued according to the abnormal reminder information.
7. The automated testing method for an interface according to claim 5, characterized in that: The target interface is automatically tested according to the test framework and the test environment to obtain a test result, and then the following steps are further included: Obtaining a test time of a test item of the target interface, comparing the test time with a preset time threshold to obtain a comparison result, and determining whether the test item is abnormal according to the comparison result; If the comparison result is that the test time is less than or equal to the preset time threshold, it is determined that there is no abnormality in the test item; If the comparison result is that the test time is greater than the preset time threshold, it is determined that there is an abnormality in the test item.
8. An automated test system for an interface, characterized in that: The automated testing system for the interface comprises: A requirement acquisition module, used to acquire the test requirement of the target interface when detecting that the test button of the target interface is clicked, and obtain the corresponding test strategy according to the test requirement; A program formulation module, used to formulate a program for the target interface according to the test strategy, obtain a target test program, and build a corresponding test framework according to the target test program; The interface testing module is used to perform automated testing on the target interface according to the testing framework to obtain a test result. If the test result meets the preset requirements, it is determined that the target interface test is completed.
9. A terminal, characterized in that: The terminal includes a memory, a processor, and an automated testing program for an interface stored in the memory and executable on the processor. When the automated testing program for the interface is executed by the processor, the steps of the automated testing method for the interface as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer-readable storage medium stores an automated testing program for an interface, and when the automated testing program for an interface is executed by a processor, the steps of the automated testing method for an interface as described in any one of claims 1-7 are implemented.