Automatic testing method and device based on plug-in and storage medium
Through the plug-in-based automated testing method, test case data is obtained and executed, which solves the web page testing efficiency and quality problems caused by the lack of professional technical capabilities of small development teams, and achieves the efficiency and quality assurance of automated testing.
Patent Information
- Application Number
- CN202310210118.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2024-09-10
AI Technical Summary
Existing automated testing tools for website development interfaces require professional technical capabilities, making it difficult for small development teams to conduct web page interaction testing with high efficiency and quality.
Provides a plug-in-based automated testing method that starts automated testing by obtaining test case data, executes tests based on process node information and expected results, generates test reports, and records execution results to ensure test quality.
In the absence of professional automated testers, the efficiency and quality of web page testing are improved and the labor cost of testing is reduced.
Smart Images

Figure CN118626360A
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing technology, and in particular to a plug-in-based automated testing method, device, and storage medium. Background Art
[0002] The current mainstream website development interface automation testing tools are all developed and tested based on testing frameworks such as Selenium and RobotFramework. Although the above framework technologies are mature and powerful, they all require testers to have strong technical capabilities, such as having a basic understanding of languages such as Java, Python, PHP, being familiar with the page interaction logic in web pages, and being able to write complex test scripts, which greatly increases the testing threshold.
[0003] However, many small development teams do not have professional automated testing teams, and many interface interaction tests are done manually by operating web pages, which is not only inefficient but also cannot guarantee the quality of the test. Therefore, how to improve the efficiency and quality of web page testing is an urgent problem to be solved. Summary of the invention
[0004] Based on this, the present application provides a plug-in-based automated testing method, device and storage medium to solve the problems existing in the prior art.
[0005] In a first aspect, a plug-in-based automated testing method is provided, which is applied to a web page extension plug-in, and the method comprises:
[0006] Acquire test case data of the test case based on the web page, wherein the test case data includes test data and process data, the process data includes information of each process node of the test case, process execution sequence information and expected results of each process node, and the test data includes input parameter data of each process node;
[0007] Initiate automated testing of the test case, perform automated testing according to the information of each process node, the input parameter data of each process node, and the process execution sequence information, and when the automated testing reaches any process node, obtain the expected result of any process node;
[0008] In response to the execution result of any one of the process nodes being consistent with the expected result of any one of the process nodes, executing the next process node of any one of the process nodes based on the process execution sequence information;
[0009] In response to an execution result of any one of the process nodes being inconsistent with an expected result of any one of the process nodes, recording test information of any one of the process nodes and stopping execution of automated testing of the test case, wherein the test information is determined based on the execution result;
[0010] When the automated test of the test case is completed, a test report is generated based on the execution result of each process node that has been tested.
[0011] According to an achievable method in an embodiment of the present application, the expected result includes that the process node is not blocked by the test, and when the execution result of any one of the process nodes is blocked by the test, the execution result of any one of the process nodes is inconsistent with the expected result of any one of the process nodes.
[0012] According to an achievable method in an embodiment of the present application, in response to the execution result of any one of the process nodes being inconsistent with the expected result of any one of the process nodes, recording the test information of any one of the process nodes and stopping the automated test of the test case, including:
[0013] When the execution result of any of the process nodes is inconsistent with the expected result of any of the process nodes, obtaining node information and execution error information of any of the process nodes;
[0014] Generate test information of any process node according to the node information of any process node and the execution error information;
[0015] Record the test information of any process node and stop executing the automated test of the test case.
[0016] According to an achievable method in an embodiment of the present application, when the automated test of the test case is completed, a test report is generated based on the execution result of each process node that has been tested, including:
[0017] If, at the end of the automated testing of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, the generated test report contains information indicating that the test was successful;
[0018] If, at the end of the automated testing of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, the test report is generated based on the node information of any process node and the execution error information, and the test report includes information indicating the failure of the test, as well as the node information of any process node and the execution error information.
[0019] According to an achievable method in an embodiment of the present application, the initiating the automated test of the test case includes:
[0020] Receiving a test start instruction sent by a user based on a web page;
[0021] The test case data is read according to the test start instruction, and the automated test of the test case is started according to the test case data.
[0022] According to an achievable method in an embodiment of the present application, the test case data of the test case obtained based on a web page includes:
[0023] Acquire test case data based on a web page, and write the test case data into a database provided by the browser;
[0024] The automated test of the test case is started, and the automated test is performed according to the information of each process node, the input parameter data of each process node, and the process execution sequence information, including:
[0025] Acquire the test case data from the database, start the automated test of the test case based on the test case data, and perform the automated test according to each process node information, input parameter data of each process node and process execution sequence information in the test case data;
[0026] When the automated test of the test case is completed, a test report is generated based on the execution result of each process node that has been tested, including:
[0027] When the automated test of the test case is finished, the execution result of each tested process node is saved to the database;
[0028] Receiving a test report generation instruction sent by a user based on a web page;
[0029] The execution result of each process node that has been tested is obtained based on the test report generation instruction, and a test report is generated according to the execution result of each process node that has been tested.
[0030] According to an achievable method in the embodiment of the present application, the test data includes policyholder information, insured person information, beneficiary information and product information;
[0031] The process data includes information of each process node in the process node of opening a page, the process node of logging in, the process node of filling in an order, the process node of saving an order, and the process node of submitting an order, as well as process execution sequence information of each process node, and expected results of each process node, and the expected results of each process node are all unblocked tests;
[0032] If, at the end of the automated test of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, the generated test report contains information indicating that the test was successful, including:
[0033] If, at the end of the automated testing of the test case, the page opening process node, the login process node, the order filling process node, the order saving process node and the order submission process node have all been tested and the execution results of each process node are all unblocked tests, then the generated test report contains information that the insured item test was successful;
[0034] If, at the end of the automated test of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, the test report is generated according to the node information and execution error information of any process node, including:
[0035] If, at the end of the automated testing of the test case, the execution result of any of the process nodes including the open page process node, the login process node, the fill in order process node, the save order process node and the submit order process node is a blocked test, the test report is generated based on the node information of any of the process nodes and the execution error information.
[0036] According to an achievable method in an embodiment of the present application, the execution result of the save order process node is a blocked test;
[0037] The test report is generated according to the node information and execution error information of any one of the process nodes, including: generating the test report according to the node information and execution error information of the saved order process node, the test report includes the node information and execution error information of the saved order process node, and the execution error information includes information indicating that updating user information is unsuccessful.
[0038] In a second aspect, a computer device is provided, comprising:
[0039] at least one processor; and
[0040] a memory communicatively connected to the at least one processor; wherein,
[0041] The memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method involved in the first aspect above.
[0042] According to a third aspect, a computer-readable storage medium is provided, on which computer instructions are stored, wherein the computer instructions are used to enable a computer to execute the method involved in the first aspect.
[0043] According to the technical content provided by the embodiments of the present application, the present application performs automated testing in the form of a plug-in, obtains the test case data of the test case based on the web page, starts the automated testing, and when the automated testing is executed to any process node, obtains the expected result of the process node. If the execution result is consistent with the expected result, the execution continues; if the execution result is inconsistent with the expected result, the test information of the process node is recorded and the execution of the test is stopped, and a test report is generated based on the execution result of each process node that has been tested. The present application can carry out automated testing based on plug-ins without professional automated testers, thereby improving the testing efficiency and quality of the project and reducing the labor cost of testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of a flow chart of a plug-in-based automated testing method in an embodiment;
[0045] Figure 2 FIG. 4 is a schematic structural diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] Figure 1 A flowchart of a plug-in-based automated testing method provided in an embodiment of the present application is applied to a web page extension plug-in, such as Figure 1 As shown, the method may include the following steps:
[0048] Step 101: Acquire test case data of the test case based on the web page, wherein the test case data includes test data and process data, the process data includes each process node information of the test case, process execution sequence information and expected results of each process node, and the test data includes input parameter data of each process node.
[0049] Specifically, an embodiment of the present application provides a plug-in-based automated testing method, which is applied to a web page. The method provided in this embodiment is applied to a web page extension plug-in program, which can be applicable to mainstream browsers such as Chrome. First, the user, i.e. the tester, selects the extension program in the browser settings and selects the corresponding compressed package to install the plug-in. Then, the tester fills in the test case data on the web page as required. The test case is defined by the tester in json format. The plug-in program saves the test case data in the IndexDb database that comes with the Chrome browser to ensure that the program shares the test case data under the same domain name, and then reads all test cases from the IndexDb database that comes with the Chrome browser.
[0050] In this step, the plug-in reads the test case data written by the tester based on the web page. The test case data includes test data and process data. The process data includes the process node information of each test process in the test case, the execution order between each test process, and the expected result when each process node is executed. The test data includes the input parameter data of the process node of each test process. The input parameter data of the process node represents the data for calling the execution of the process.
[0051] Step 102: Start the automated test of the test case, and execute the automated test according to the information of each process node, the input parameter data of each process node, and the process execution sequence information. When the automated test is executed to any process node, the expected result of any process node is obtained.
[0052] Specifically, the program reads the test case data and starts the automated test of the test case according to the process data and the input parameter data in the test data. After the automated test is started, the automated test is performed according to the information of each process node in the process data, the input parameter data of each process node, and the process execution sequence information. Each process is executed in sequence according to the execution sequence information. When the automated test is executed to any process node, the expected result of any process node is obtained.
[0053] In one embodiment of the present application, starting the automated test of the test case in step 102 includes: receiving a test start instruction sent by a user based on a web page; reading the test case data according to the test start instruction, and starting the automated test of the test case according to the test case data.
[0054] Specifically, the tester generates a test start instruction by clicking a link to start the test on a web page. The plug-in receives the test start instruction, calls the module for reading test cases to obtain the test case data stored in the database, and performs automated testing based on the information of each process node in the test case data, the input parameter data of each process node, and the process execution sequence information.
[0055] Step 103: In response to the execution result of any process node being consistent with the expected result of any process node, the next process node of any process node is executed based on the process execution sequence information.
[0056] Specifically, when the automated test is executed to any process node, it is determined whether the execution result of the automated test at the process node is consistent with the expected result of the process node. If the execution result of the automated test at the process node is consistent with the expected result of the process node, the test continues to be executed, and the next process node of the process node is executed according to the process execution sequence information in the process data until all process nodes are executed.
[0057] Step 104: In response to the execution result of any process node being inconsistent with the expected result of any process node, recording the test information of any process node and stopping the automated test of the test case, wherein the test information is determined based on the execution result.
[0058] Specifically, when the automated test is executed to any process node, it is determined whether the execution result of the automated test at the process node is consistent with the expected result of the process node. If the execution result of the automated test at the process node is inconsistent with the expected result of the process node, the test information of the process node is recorded based on the execution result of the process node, and the automated test of the test case is stopped. The test information is determined based on the execution result, and the test information includes information that characterizes that the test result of the process node is inconsistent with the expected result.
[0059] Step 105: When the automated test of the test case is completed, a test report is generated based on the execution results of each process node that has been tested.
[0060] Specifically, when the automated test of the test case is completed, a test report is generated based on the execution results of each process node that has been tested. The end of the automated test includes two situations. The first is that the execution result of any process node is consistent with the expected result, all process nodes are executed, and the automated test is ended; the second is that when the test case is executed to one of the process nodes, because the execution result is inconsistent with the expected result, the execution of the test case is stopped and the automated test is ended. When the end of the automated test belongs to any of the situations, the execution result of each process node that has been tested is read, and a test report is generated according to the execution result of each process node that has been tested.
[0061] In one embodiment of the present application, when the automated testing of the test case is completed in step 105, a test report is generated based on the execution results of each process node that has been tested, including: when the automated testing of the test case is completed, receiving a test report generation instruction sent by a user based on a web page; obtaining the execution results of each process node that has been tested based on the test report generation instruction, and generating a test report according to the execution results of each process node that has been tested.
[0062] It can be seen that the embodiment of the present application performs automated testing in the form of a plug-in, obtains the test case data of the test case based on the web page, starts the automated testing, and when the automated testing is executed to any process node, obtains the expected result of the process node. If the execution result is consistent with the expected result, the execution continues; if the execution result is inconsistent with the expected result, the test information of the process node is recorded and the execution of the test is stopped, and a test report is generated based on the execution result of each process node that has been tested. The present application can carry out automated testing based on plug-ins without professional automated testers, thereby improving the testing efficiency and quality of the project and reducing the labor cost of testing.
[0063] This application is a self-developed web extension program, which defines the logic of reading and storing initial test cases, test case source data and results. The test project team is generally composed of software development engineers and test engineers. Before the start of the Web project testing work, the software development engineers in the project team define the triggering method of each page interaction event based on the page logic. According to the test requirements, the test engineer defines the test data, the triggering process (test process) of the serial interaction events, and the expected results of the test case. After the test engineer completes the test data preparation, enter the automated test case startup method in the Google Chrome console, and this application can complete the testing of all use cases based on the test case data, process and expectations.
[0064] In one embodiment of the present application, the expected result includes that the process node is not blocked by the test, and when the execution result of any process node is blocked by the test, the execution result of any process node is inconsistent with the expected result of any process node.
[0065] Specifically, the expected result of any process node includes that the process node is not blocked by the test. When the execution result of any process node is blocked by the test, the execution result of the process node is inconsistent with the expected result of the process node. When the execution result of any process node is not blocked by the test, the execution result of the process node is consistent with the expected result of the process node.
[0066] In one embodiment of the present application, in response to the execution result of any process node being inconsistent with the expected result of any process node, step 104 records the test information of any process node and stops executing the automated test of the test case, including: when the execution result of any process node is inconsistent with the expected result of any process node, obtains the node information and execution error information of any process node; generates the test information of any process node according to the node information and execution error information of any process node; records the test information of any process node and stops executing the automated test of the test case.
[0067] Specifically, when the execution result of any process node is inconsistent with the expected result of the process node, the node information and execution error information of the process node are obtained and recorded. The test information of the process node is generated according to the node information and the execution error information, and the test information includes the node information and the execution error information of the process node. The test information of the process node is recorded and the automated test of the test case is stopped.
[0068] In one embodiment of the present application, when the automated testing of the test case in step 105 is completed, a test report is generated based on the execution results of each process node that has been tested, including: if at the end of the automated testing of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, then the generated test report contains information indicating that the test is successful; if at the end of the automated testing of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, then a test report is generated based on the node information of any process node and the execution error information, and the test report contains information indicating that the test failed, as well as the node information of any process node and the execution error information.
[0069] Specifically, based on the above embodiment, step 105 includes: if at the end of the automated test of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, for example, the execution result of each process node is a non-blocked test, then the generated test report contains information indicating that the test was successful. If at the end of the automated test of the test case, the execution result of a process node of the test case is inconsistent with the expected result, for example, the execution result of the process node is a blocked test, causing the test to stop. A test report is generated based on the node information of the process node and the execution error information, and the test report contains information indicating that the test failed, as well as the node information of the process node and the execution error information. For example, the following test report is generated:
[0070]
[0071] In one embodiment of the present application, the test case data of the test case is obtained based on the web page in step 101, including: obtaining the test case data based on the web page, and writing the test case data into the database of the browser. The automated test of the test case is started in step 102, and the automated test is performed according to the information of each process node, the input parameter data of each process node, and the process execution sequence information, including: obtaining the test case data from the database, starting the automated test of the test case based on the test case data, and performing the automated test according to the information of each process node, the input parameter data of each process node, and the process execution sequence information in the test case data. When the automated test of the test case is completed in step 105, a test report is generated based on the execution result of each process node that has been tested, including: when the automated test of the test case is completed, the execution result of each process node that has been tested is saved to the database; a test report generation instruction sent by the user is received based on the web page; the execution result of each process node that has been tested is obtained based on the test report generation instruction, and a test report is generated according to the execution result of each process node that has been tested.
[0072] In one embodiment of the present application, the test data includes policyholder information, insured information, beneficiary information and product information; the process data includes information of each process node in the process node of opening a page, the process node of logging in, the process node of filling out an order and the process node of submitting an order, as well as the process execution sequence information of each process node, and the expected result of each process node, and the expected result of each process node is a non-blocking test; if at the end of the automated test of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, then the generated test report contains information indicating that the test was successful, including: if at the end of the automated test of the test case, the process node of opening a page, the process node of logging in, the process node of filling out an order and the process node of submitting an order are completed, the test result of the test case is completed, and the test result of the test case is completed. If the node, save order process node and submit order process node have all been tested and the execution results of each process node are non-blocked tests, the generated test report will contain information on the successful test of the insured item; if at the end of the automated test of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, a test report will be generated based on the node information and execution error information of any process node, including: if at the end of the automated test of the test case, the execution result of any process node among the open page process node, the login process node, the fill in order process node, the save order process node and the submit order process node is a blocked test, a test report will be generated based on the node information and execution error information of any process node.
[0073] Specifically, the test case data in step 101 includes test data and process data, wherein the test data includes policyholder information, insured person information, beneficiary information and product information.
[0074] The information of the policyholder, the insured, and the beneficiary includes the name, ID number, address, etc. of the policyholder, the insured, and the beneficiary respectively. The product information indicates the type of insurance product, such as pension insurance, etc. For example:
[0075]
[0076] The process data includes the information of each process node in the process node of opening the page, the process node of logging in, the process node of filling in the order, the process node of saving the order and the process node of submitting the order, as well as the process execution sequence information of each process node and the expected result of each process node. The expected result of each process node is not blocked test. For example:
[0077]
[0078]
[0079] If at the end of the automated test of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, the generated test report contains information indicating that the test was successful, including: if at the end of the automated test of the test case, the open page process node, login process node, fill in order process node, save order process node and submit order process node have all been tested and the execution results of each process node are not blocked tests, the generated test report contains information that the insurance item test was successful. For example:
[0080]
[0081] If, at the end of the automated test of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, a test report is generated based on the node information of any process node and the execution error information, including: if, at the end of the automated test of the test case, the execution result of any process node among the open page process node, the login process node, the fill order process node, the save order process node and the submit order process node is a blocked test, a test report is generated based on the node information of any process node and the execution error information. For example:
[0082]
[0083] In one embodiment of the present application, the execution result of the saved order process node is a blocked test; a test report is generated based on the node information of any process node and the execution error information, including: a test report is generated based on the node information of the saved order process node and the execution error information, the test report includes the node information of the saved order process node and the execution error information, and the execution error information includes information indicating that the update of user information was unsuccessful.
[0084] Specifically, in this embodiment, the test case is blocked when executing the "Save Order" process, and the error message obtained is: "Update customer information has not been successful yet, please try again later." A test report is generated based on the node information of the Save Order process node and the execution error information, and the test report contains the node information of the Save Order process node and the execution error information. For example:
[0085]
[0086]
[0087] The embodiment of the present application performs automated testing in the form of a plug-in, obtains the test case data of the test case based on the web page, starts the automated testing, and when the automated testing is executed to any process node, obtains the expected result of the process node. If the execution result is consistent with the expected result, the execution continues; if the execution result is inconsistent with the expected result, the test information of the process node is recorded and the execution of the test is stopped, and a test report is generated based on the execution result of each process node that has been tested. The present application can carry out automated testing based on plug-ins without professional automated testers, thereby improving the testing efficiency and quality of the project and reducing the labor cost of the test.
[0088] This application is a self-developed web extension program, which defines the logic of reading and storing initial test cases, test case source data and results. The test project team is generally composed of software development engineers and test engineers. Before the start of the Web project testing work, the software development engineers in the project team define the triggering method of each page interaction event based on the page logic. According to the test requirements, the test engineer defines the test data, the triggering process (test process) of the serial interaction events, and the expected results of the test case. After the test engineer completes the test data preparation, enter the automated test case startup method in the Google Chrome console, and this application can complete the testing of all use cases based on the test case data, process and expectations.
[0089] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in the application, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0090] The same or similar parts between the above embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0091] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described in this article within the scope permitted by applicable laws and regulations, provided that the applicable laws and regulations of the country are met (for example, the user's explicit consent, effective notification to the user, and the user's explicit authorization, etc.).
[0092] According to an embodiment of the present application, the present application also provides a computer device and a computer-readable storage medium. The present application also provides a computer device, including at least one processor and a memory connected to the at least one processor in communication; wherein the memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor so that the at least one processor can execute the plug-in-based automated testing method described in any of the above embodiments.
[0093] like Figure 2 , is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. The digital computer may include a desktop computer, a portable computer, a workbench, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device may include a tablet computer, a smart phone, a wearable device, etc.
[0094] like Figure 2As shown, the computer device 200 includes a computing unit 201, a ROM 202, a RAM 203, a bus 204, and an input / output (I / O) interface 205. The computing unit 201, the ROM 202, and the RAM 203 are connected to each other via the bus 204. The input / output (I / O) interface 205 is also connected to the bus 204.
[0095] The computing unit 201 can perform various processes in the method embodiment of the present application according to the computer instructions stored in the read-only memory (ROM) 202 or the computer instructions loaded from the storage unit 208 to the random access memory (RAM) 203. The computing unit 201 can be various general and / or special processing components with processing and computing capabilities. The computing unit 201 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. In some embodiments, the method provided in the embodiment of the present application can be implemented as a computer software program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 208.
[0096] RAM 202 may also store various programs and data required for the operation of device 200. Part or all of a computer program may be loaded and / or installed on device 200 via ROM 202 and / or communication unit 209.
[0097] The input unit 206, output unit 207, storage unit 208 and communication unit 209 in the computer device 200 can be connected to the I / O interface 205. The input unit 206 can be, for example, a keyboard, a mouse, a touch screen, a microphone, etc. The output unit 207 can be, for example, a display, a speaker, an indicator light, etc. The device 200 can exchange information, data, etc. with other devices through the communication unit 209.
[0098] It should be noted that the device may also include other components necessary for normal operation, or may only include components necessary for implementing the solution of the present application, rather than all the components shown in the figure.
[0099] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0100] The computer instructions for implementing the method of the present application can be written in any combination of one or more programming languages. These computer instructions can be provided to the computing unit 201, so that when the computer instructions are executed by the computing unit 201 such as a processor, the steps involved in the method embodiment of the present application are executed.
[0101] The present application also provides a computer-readable storage medium on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the plug-in-based automated testing method described in any of the above embodiments.
[0102] The computer-readable storage medium provided in the present application may be a tangible medium that may contain or store computer instructions for executing the steps involved in the method embodiments of the present application. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, and other forms of storage media.
[0103] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A plug-in-based automated testing method, characterized in that: Applied to a web page extension plug-in, the method comprises: Acquire test case data of the test case based on the web page, wherein the test case data includes test data and process data, the process data includes information of each process node of the test case, process execution sequence information and expected results of each process node, and the test data includes input parameter data of each process node; Initiate automated testing of the test case, perform automated testing according to the information of each process node, the input parameter data of each process node, and the process execution sequence information, and when the automated testing reaches any process node, obtain the expected result of any process node; In response to the execution result of any one of the process nodes being consistent with the expected result of any one of the process nodes, executing the next process node of any one of the process nodes based on the process execution sequence information; In response to an execution result of any one of the process nodes being inconsistent with an expected result of any one of the process nodes, recording test information of any one of the process nodes and stopping execution of automated testing of the test case, wherein the test information is determined based on the execution result; When the automated test of the test case is completed, a test report is generated based on the execution result of each process node that has been tested.
2. The plug-in-based automated testing method according to claim 1, characterized in that: The expected result includes that the process node is not blocked by the test. When the execution result of any one of the process nodes is blocked by the test, the execution result of any one of the process nodes is inconsistent with the expected result of any one of the process nodes.
3. The plug-in-based automated testing method according to claim 2, characterized in that: In response to the execution result of any one of the process nodes being inconsistent with the expected result of any one of the process nodes, recording the test information of any one of the process nodes and stopping the automated test of the test case, including: When the execution result of any of the process nodes is inconsistent with the expected result of any of the process nodes, obtaining node information and execution error information of any of the process nodes; Generate test information of any process node according to the node information of any process node and the execution error information; Record the test information of any process node and stop executing the automated test of the test case.
4. The plug-in-based automated testing method according to claim 3, characterized in that: When the automated test of the test case is completed, a test report is generated based on the execution results of each process node that has been tested, including: If, at the end of the automated testing of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, the generated test report contains information indicating that the test was successful; If, at the end of the automated testing of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, the test report is generated based on the node information of any process node and the execution error information, and the test report includes information indicating the failure of the test, as well as the node information of any process node and the execution error information.
5. The plug-in-based automated testing method according to claim 1, characterized in that The initiating the automated test of the test case comprises: Receiving a test start instruction sent by a user based on a web page; The test case data is read according to the test start instruction, and the automated test of the test case is started according to the test case data.
6. The plug-in-based automated testing method according to claim 1, characterized in that: The test case data of the test case obtained based on the web page includes: Acquire test case data based on a web page, and write the test case data into a database provided by the browser; The automated test of the test case is started, and the automated test is performed according to the information of each process node, the input parameter data of each process node, and the process execution sequence information, including: Acquire the test case data from the database, start the automated test of the test case based on the test case data, and perform the automated test according to each process node information, input parameter data of each process node and process execution sequence information in the test case data; When the automated test of the test case is completed, a test report is generated based on the execution result of each process node that has been tested, including: When the automated test of the test case is finished, the execution result of each tested process node is saved to the database; Receiving a test report generation instruction sent by a user based on a web page; The execution result of each process node that has been tested is obtained based on the test report generation instruction, and a test report is generated according to the execution result of each process node that has been tested.
7. The plug-in-based automated testing method according to claim 4, characterized in that: The test data includes information of the policyholder, the insured, the beneficiary and the product; The process data includes information of each process node in the process node of opening a page, the process node of logging in, the process node of filling in an order, the process node of saving an order, and the process node of submitting an order, as well as process execution sequence information of each process node, and expected results of each process node, and the expected results of each process node are all unblocked tests; If, at the end of the automated test of the test case, all process nodes of the test case have been tested and the execution results of each process node are consistent with the results of each process node, the generated test report contains information indicating that the test was successful, including: If, at the end of the automated test of the test case, the open page process node, the login process node, the fill order process node, the save order process node and the submit order process node have all been tested and the execution results of each process node are all unblocked tests, then the generated test report contains information about the test success; If, at the end of the automated test of the test case, the execution result of any process node of the test case is inconsistent with the expected result of any process node, the test report is generated according to the node information and execution error information of any process node, including: If at the end of the automated testing of the test case, the execution result of any of the process nodes including the open page process node, the login process node, the fill in order process node, the save order process node and the submit order process node is a blocked test, then the test report is generated based on the node information and execution error information of any of the process nodes.
8. The plug-in-based automated testing method according to claim 7, characterized in that: The execution result of the save order process node is a blocked test; The test report is generated according to the node information and execution error information of any one of the process nodes, including: generating the test report according to the node information and execution error information of the saved order process node, the test report includes the node information and execution error information of the saved order process node, and the execution error information includes information indicating that updating user information is unsuccessful.
9. A computer device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 8.
