A method, system and medium for testing front-end presentation and interaction logic
By constructing test data and using proxy tools for data logic verification, the problem of time-consuming and data confusion in the test front-end display and interactive logic in the existing technology is solved, and an efficient test process and accurate results are achieved.
Patent Information
- Application Number
- CN202111179567.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-10-11
AI Technical Summary
The existing technology requires a long manual time when testing the front-end display and interactive logic, and frequent modification of the database will affect other logical chains, resulting in data confusion and reducing work efficiency.
Provide a method to test front-end display and interactive logic, obtain the elements of front-end display and interactive logic through initialization, build test data, and use proxy tools to perform data logic verification operations on front-end display and interactive logic to generate test results.
It greatly improves the efficiency of testing front-end display and interactive logic, saves testing time, improves work efficiency, and can promptly discover problems in front-end display and interactive logic processing, improving the accuracy of the test.
Smart Images

Figure CN113900943B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of front-end and back-end data verification, and in particular to a method, system and medium for testing front-end presentation and interaction logic. Background Art
[0002] In the existing development process, interaction between multiple systems through interfaces is a common development method, which realizes data interaction and logical processing between various systems or modules through interfaces.
[0003] Due to the convenience of the interface, its application scenarios are also relatively complex, which makes it difficult to display data and interact with the logic on the front end. There are generally two existing solutions:
[0004] One is to manually process the pre-data and then implement data changes through front-end logic interaction;
[0005] The other is to manually modify the data in the relevant database tables to verify the front-end data presentation and interaction logic.
[0006] When the first solution mentioned above is used, in order to verify an interactive logic, it takes a long time for manual data maintenance, which increases the overall testing cost and reduces work efficiency; when the second solution mentioned above is used, it is necessary to frequently modify the test environment database, which will affect other logical chains, easily cause data confusion, and reduce work efficiency. Summary of the invention
[0007] The present invention mainly solves the problem that the existing processing scheme consumes a long time of manpower, affects other logical chains, easily causes data confusion, and thus reduces work efficiency.
[0008] To solve the above problems, a technical solution adopted by the present invention is to provide a method for testing front-end presentation and interaction logic, comprising the following steps:
[0009] Initialization: Get the first element of the front-end display and the second element of the interaction logic;
[0010] Constructing data: constructing test data according to the first element and the second element;
[0011] Test verification: Based on the test data, perform data logic verification operations on the front-end display and the interaction logic through the proxy tool;
[0012] Generate test results: construct test results based on the results of the data logic verification operation.
[0013] As a preferred technical solution, the test verification step further includes:
[0014] Initiate a request: perform a data acquisition operation according to the front-end display and the interaction logic to obtain the test data;
[0015] Data transmission: performing a data transmission operation on the test data through the proxy tool;
[0016] Front-end display verification: according to the result of the data sending operation, a data verification operation is performed on the front-end display to obtain a data verification result;
[0017] Interactive logic verification: Based on the result of the data sending operation, a logic verification operation is performed on the interactive logic to obtain a logic verification result.
[0018] As a preferred technical solution, the test data includes first test data and second test data; the step of constructing data further includes:
[0019] Constructing the first test data according to the first element;
[0020] The second test data is constructed according to the second element.
[0021] Furthermore, the step of data transmission further includes:
[0022] Acquire the first test data, and send the first test data to the front-end for display through the proxy tool;
[0023] The second test data is obtained, and the second test data is sent to the interaction logic through the proxy tool.
[0024] As a preferred technical solution, the step of front-end display verification further includes:
[0025] If the front-end display receives the first test data, the data verification operation is performed to obtain the data verification result;
[0026] If the front-end display does not receive the first test data, the front-end display test fails, and the first failure reason is recorded, and the data verification result is generated according to the first failure reason.
[0027] As a preferred technical solution, the step of interactive logic verification further includes:
[0028] If the interactive logic receives the second test data, the logic verification operation is performed to obtain the logic verification result;
[0029] If the interactive logic does not receive the second test data, the interactive logic test fails, and the second failure reason is recorded, and the logic verification result is generated according to the second failure reason.
[0030] As a preferred technical solution, the step of initiating a request further includes:
[0031] Initiate a first data acquisition request through the front-end display to obtain the first test data;
[0032] A second data acquisition request is initiated through the interaction logic to obtain the second test data.
[0033] A system for testing front-end presentation and interaction logic, including: an initialization module, a data construction module, a test verification module and a test result generation module;
[0034] The initialization module is used to obtain a first element of the front-end display and a second element of the interaction logic of the front-end;
[0035] The data construction module is used to construct test data according to the first element and the second element;
[0036] The test verification module is used to perform data logic verification operations on the front-end display and the interactive logic through a proxy tool according to the test data;
[0037] The test result generation module is used to construct a test result according to the result of the data logic verification operation.
[0038] As a preferred technical solution, the test verification module includes a request initiating unit, a data transmission unit, a front-end display verification unit and an interactive logic verification unit;
[0039] The request initiating unit is used to perform a data acquisition operation according to the front-end display and the interaction logic to obtain the test data;
[0040] The data transmission unit is used to perform a data sending operation on the test data through the proxy tool;
[0041] The front-end display verification unit is used to perform a data verification operation on the front-end display according to the result of the data sending operation to obtain a data verification result;
[0042] The interactive logic verification unit is used to perform a logic verification operation on the interactive logic according to the result of the data sending operation to obtain a logic verification result.
[0043] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the method for testing front-end presentation and interaction logic are implemented.
[0044] The beneficial effects of the present invention are:
[0045] 1. The method for testing the front-end presentation and interaction logic of the present invention can realize the construction of test data according to the presentation elements and logic processing elements of the front-end, and then test the front-end through the test data, thereby greatly improving the test efficiency of the front-end presentation and interaction logic;
[0046] 2. The system for testing front-end display and interaction logic of the present invention can realize the unified construction of test data for testing the front-end display and interaction logic, without the need to frequently operate the data, thus saving test time and improving work efficiency;
[0047] 3. The medium for testing the front-end display and interactive logic described in the present invention can realize timely discovery of problems in the front-end display and interactive logic processing through the constructed test data, thereby improving the accuracy of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 is a flowchart of the method for testing front-end presentation and interaction logic according to Embodiment 1 of the present invention;
[0050] Figure 2 It is a flowchart of the test verification steps of the method for testing the front-end presentation and interaction logic described in Example 1 of the present invention;
[0051] Figure 3 is a schematic diagram of a system for testing front-end presentation and interaction logic according to Embodiment 2 of the present invention;
[0052] Figure 4 It is a schematic diagram of the test verification module of the system for testing front-end presentation and interactive logic described in Example 2 of the present invention. DETAILED DESCRIPTION
[0053] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "front end", "front end display", "first element", "interactive logic", "second element", "test data", "agent tool", "data logic verification operation", "test result", "data acquisition operation", "data sending operation", "data verification operation", "data verification result", "logic verification operation", "logic verification result", "first test data", "second test data", "first failure reason", "second failure reason", "first data acquisition request", "second data acquisition request", "initialization module", "data construction module", "test verification module", "test result generation module", "request initiation unit", "data transmission unit", "front end display verification unit", "interactive logic verification unit" and the like should be understood in a broad sense. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0055] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.
[0056] Example 1
[0057] The present invention provides a method for testing front-end display and interaction logic. Figure 1 and Figure 2 , including the following steps:
[0058] S100, initialization:
[0059] After the front-end display page is developed and needs to be tested for the front-end display and interactive logic processing, the first element of the front-end display and the second element of the front-end interactive logic are obtained; the first element is the data information that the front-end needs to display, and the second element is the data information that the front-end needs to perform logical processing.
[0060] In order to explain the present invention more clearly, a simulation of the road to winning the European Cup is used as an example for illustration. The first element information displayed by the front end is the information of each participating team, and the second element of the front end interaction logic is the teams that compete against each other and the results of the competition.
[0061] S200, build data:
[0062] Construct the first test data according to the first element, and construct the second test data according to the second element; when constructing the test data here, you can set the test data according to the front-end processing, or you can set the test data with reference to past test data; after the first test data and the second test data are set, you need to manually verify the data, and the data needs to comply with the processing logic of the front-end page; after the data verification is completed, the first data and the second data are recorded in a json file to facilitate the response to the request initiated by the front-end.
[0063] In order to explain the present invention more clearly, the example in the initialization step S100 is continued here for illustration, and the first test data is set, that is, the top 16 teams participating in the European Cup are Wales, Denmark, the Netherlands, the Czech Republic, England, Germany, Sweden, Ukraine, Italy, Austria, Belgium, Portugal, Croatia, Spain, France and Switzerland, and the second test data is set, that is, the battle groups of the teams participating in the European Cup are Wales vs. Denmark, the Netherlands vs. the Czech Republic, England vs. Germany, Sweden vs. Ukraine, Italy vs. Austria, Belgium vs. Portugal, Croatia vs. Spain, and France vs. Switzerland; when setting 16 to 8, the winning teams are Denmark, the Czech Republic, England, Ukraine, Italy, Belgium, Spain and Switzerland, that is, in the top 8, the second test data is set. The first test data is Denmark, Czech Republic, England, Ukraine, Italy, Belgium, Spain and Switzerland, and the second test data is Denmark vs. Czech Republic, England vs. Ukraine, Italy vs. Belgium, and Spain vs. Switzerland; when setting 8 to 4, the winning teams are Denmark, England, Italy and Spain respectively, that is, in the semi-finals, the first test data is Denmark, England, Italy and Spain, and the second test data is Denmark vs. England, Italy vs. Spain; when setting 4 to 2, the winning teams are England and Italy respectively, that is, in the competition for the championship and runner-up, the first data is England and Italy, and the second data is England vs. Italy; after the setting is completed, the set data is manually verified to prevent unreasonable situations such as a team playing twice.
[0064] S300, test verification:
[0065] S301. Initiate a request:
[0066] The first data acquisition request is initiated through the front-end display of the front-end page, and the second data acquisition request is initiated through the interactive logic of the front-end page. That is, when the test is started, the front-end page is refreshed or loaded, and the front-end page will initiate a data acquisition request to the background, and then display the front-end page.
[0067] In order to explain the present invention more clearly, the example in the data construction step S200 is continued here for illustration. When it is necessary to view the front-end display and the battle situation of the top 16 teams, the front-end display sample picture of the top 16 is refreshed, and the front-end will initiate a data acquisition request to the background, and it is necessary to obtain the first test data and the second test data in the front-end display sample picture of the top 16; when it is necessary to view the front-end display and the battle situation of the top 8 teams, the front-end display sample picture of the top 8 is used, and the front-end will initiate a data acquisition request to the background.
[0068] S302, data transmission:
[0069] The first test data is obtained, and the first test data is sent to the front-end display of the front-end through the proxy tool; the second test data is obtained, and the second test data is sent to the interactive logic of the front-end through the proxy tool.
[0070] The proxy tool may be Charles, Fillder or other proxy tools, and MapLocal in the proxy tool is mainly used to transmit data.
[0071] In order to explain the present invention more clearly, the example in the request initiation step S301 is continued here for illustration. When checking the front-end display and the battle situation of the top 16 teams, the first test data and the second test data are obtained, that is, the battle situation between the top 16 participating teams and the 16 teams. The file where the first test data is located and the file where the second test data is located are obtained through MapLocal, and the files are sent to the front-end. After the front-end parses the data, it is displayed on the front-end interface.
[0072] S303, front-end display verification:
[0073] Determine whether the front-end display of the front-end has received the first test data:
[0074] If the front-end display of the front end receives the first test data, the first test data is parsed, and the front-end display verification is performed to obtain a data verification result;
[0075] If the front-end display of the front end does not receive the first test data, it means that the first test data sending fails, that is, the front-end display test fails, the first failure reason is recorded, and the data verification result is generated according to the first failure reason.
[0076] In order to explain the present invention more clearly, the example in the S302 data transmission step is continued here for explanation. If the team information of the top 16 teams of the European Cup is sent, the data of the corresponding top 16 teams can be obtained in the top 16 front-end display sample picture, then the data of the corresponding team will be displayed, and the data verification result is that the test of the top 16 front-end display sample picture is successful; if the top 16 front-end display sample picture does not obtain the corresponding data of the top 16 teams or the data parsing of the top 16 teams fails, then it means that the test of the top 16 front-end display sample picture has failed, and the first failure reason is that the data was not successfully obtained or the data parsing failed, and the generated data verification result is that the test of the top 16 front-end display sample picture has failed, and the failure reason is that the data was not successfully obtained or the data parsing failed, and the generated data verification result is that the test of the top 16 front-end display sample picture has failed, and the failure reason is that the data was not successfully obtained or the data parsing failed.
[0077] S304, interactive logic verification:
[0078] Determine whether the front-end interaction logic has received the second test data:
[0079] If the front-end interactive logic receives the second test data, the second test data is parsed, and the interactive logic is processed on the parsed second test data to obtain a logic verification result;
[0080] If the front-end interactive logic does not receive the second test data, it means that the second test data fails to be sent, that is, the interactive logic test fails, the second failure reason is recorded, and a logic verification result is generated according to the second failure reason.
[0081] In order to explain the present invention more clearly, the example in the S303 front-end display verification step is continued here for explanation. If the match information of the top 16 teams in the European Cup is sent, the corresponding match information can be obtained in the top 16 front-end display sample picture, then the corresponding match information will be displayed, and the logic verification result is that the interactive logic test of the top 16 front-end display sample picture is successful; if the top 16 front-end display sample picture does not obtain the corresponding match information of the top 16 teams, then it means that the interactive logic test of the top 16 front-end display sample picture has failed, and the second failure reason is that the data was successfully obtained or the data parsing failed, etc., and the generated logic verification result is that the interactive logic test of the top 16 front-end display sample picture has failed, and the failure reason is that the match data was not successfully obtained or the data parsing failed.
[0082] S400, generate test results:
[0083] The final test results are generated based on the data verification results and logic verification results, and the final test results are saved electronically to facilitate subsequent tracking of the test process and analysis of the test data.
[0084] It should be noted that the above examples are only for explaining the implementation process of the present invention and cannot limit the protection scope of the present invention.
[0085] Example 2
[0086] The present invention provides a system for testing front-end presentation and interaction logic. Figure 3 and Figure 4 , including: initialization module, data construction module, test verification module and test result generation module;
[0087] Initialize the module:
[0088] The initialization module is used to obtain the first element of the front-end display and the second element of the interaction logic of the front-end;
[0089] Specifically, when the front-end display page is developed and the front-end display and interactive logic processing need to be tested, the initialization module obtains the first element of the front-end display and the second element of the front-end interactive logic; the first element is the data information that the front end needs to display, and the second element is the data information that the front end needs to perform logical processing.
[0090] In order to explain the present invention more clearly, a simulation of the road to winning the European Cup is used as an example for illustration. The first element information displayed by the front end is the information of each participating team, and the second element of the front end interaction logic is the teams that compete against each other and the results of the competition.
[0091] Build the data module:
[0092] The data building module is used to build test data according to the first element and the second element;
[0093] Specifically, the data construction module constructs the first test data according to the first element, and constructs the second test data according to the second element; when constructing the test data here, you can set the test data according to the front-end processing, or you can set the test data with reference to past test data; after the first test data and the second test data are set, you need to manually verify the data, and the data needs to comply with the processing logic of the front-end page; after the data verification is completed, the first data and the second data are recorded in a json file to facilitate the response to the request initiated by the front-end.
[0094] In order to explain the present invention more clearly, the example in the initialization step S100 is continued here for illustration, and the first test data is set, that is, the top 16 teams participating in the European Cup are Wales, Denmark, the Netherlands, the Czech Republic, England, Germany, Sweden, Ukraine, Italy, Austria, Belgium, Portugal, Croatia, Spain, France and Switzerland, and the second test data is set, that is, the battle groups of the teams participating in the European Cup are Wales vs. Denmark, the Netherlands vs. the Czech Republic, England vs. Germany, Sweden vs. Ukraine, Italy vs. Austria, Belgium vs. Portugal, Croatia vs. Spain, and France vs. Switzerland; when setting 16 to 8, the winning teams are Denmark, the Czech Republic, England, Ukraine, Italy, Belgium, Spain and Switzerland, that is, in the top 8, the second test data is set. The first test data is Denmark, Czech Republic, England, Ukraine, Italy, Belgium, Spain and Switzerland, and the second test data is Denmark vs. Czech Republic, England vs. Ukraine, Italy vs. Belgium, and Spain vs. Switzerland; when setting 8 to 4, the winning teams are Denmark, England, Italy and Spain respectively, that is, in the semi-finals, the first test data is Denmark, England, Italy and Spain, and the second test data is Denmark vs. England, Italy vs. Spain; when setting 4 to 2, the winning teams are England and Italy respectively, that is, in the competition for the championship and runner-up, the first data is England and Italy, and the second data is England vs. Italy; after the setting is completed, the set data is manually verified to prevent unreasonable situations such as a team playing twice.
[0095] Test verification module:
[0096] The test verification module is used to perform data logic verification operations on the front-end display and interaction logic through the proxy tool according to the test data; the test verification module includes a request initiation unit, a data transmission unit, a front-end display verification unit and an interaction logic verification unit;
[0097] Initiate request unit:
[0098] The request initiating unit is used to perform data acquisition operations according to the front-end display and interaction logic to obtain test data;
[0099] Specifically, the request initiating unit initiates a first data acquisition request through the front-end display of the front-end page to obtain first test data, and initiates a second data acquisition request through the interactive logic of the front-end page to obtain second test data. That is, when the test is started, the front-end page is refreshed or loaded, and the front-end page will initiate a data acquisition request to the background, and then display the front-end page.
[0100] In order to explain the present invention more clearly, the example in the data construction step S200 is continued here for illustration. When it is necessary to view the front-end display and the battle situation of the top 16 teams, the front-end display sample picture of the top 16 is refreshed, and the front-end will initiate a data acquisition request to the background, and it is necessary to obtain the first test data and the second test data in the front-end display sample picture of the top 16; when it is necessary to view the front-end display and the battle situation of the top 8 teams, the front-end display sample picture of the top 8 is used, and the front-end will initiate a data acquisition request to the background.
[0101] Data transmission unit:
[0102] The data transmission unit is used to perform a data sending operation on the test data through an agent tool;
[0103] Specifically, the data transmission unit sends the first test data to the front-end display of the front-end through the proxy tool; and sends the second test data to the interactive logic of the front-end through the proxy tool.
[0104] The proxy tool may be Charles, Fillder or other proxy tools, and MapLocal in the proxy tool is mainly used to transmit data.
[0105] In order to explain the present invention more clearly, the example in the request initiation step S301 is continued here for illustration. When checking the front-end display and the battle situation of the top 16 teams, the first test data and the second test data are obtained, that is, the battle situation between the top 16 participating teams and the 16 teams. The file where the first test data is located and the file where the second test data is located are obtained through MapLocal, and the files are sent to the front-end. After the front-end parses the data, it is displayed on the front-end interface.
[0106] Front-end display verification unit:
[0107] The front-end display verification unit is used to perform a data verification operation on the front-end display according to the result of the data sending operation to obtain a data verification result;
[0108] Specifically, the front-end display verification unit determines whether the front-end display of the front end receives the first test data:
[0109] If the front-end display of the front end receives the first test data, the first test data is parsed, and the front-end display verification is performed to obtain a data verification result;
[0110] If the front-end display of the front end does not receive the first test data, it means that the first test data sending fails, that is, the front-end display test fails, the first failure reason is recorded, and the data verification result is generated according to the first failure reason.
[0111] In order to explain the present invention more clearly, the example in the S302 data transmission step is continued here for explanation. If the team information of the top 16 teams of the European Cup is sent, the data of the corresponding top 16 teams can be obtained in the top 16 front-end display sample picture, then the data of the corresponding team will be displayed, and the data verification result is that the test of the top 16 front-end display sample picture is successful; if the top 16 front-end display sample picture does not obtain the corresponding data of the top 16 teams or the data parsing of the top 16 teams fails, then it means that the test of the top 16 front-end display sample picture has failed, and the first failure reason is that the data was not successfully obtained or the data parsing failed, and the generated data verification result is that the test of the top 16 front-end display sample picture has failed, and the failure reason is that the data was not successfully obtained or the data parsing failed, and the generated data verification result is that the test of the top 16 front-end display sample picture has failed, and the failure reason is that the data was not successfully obtained or the data parsing failed.
[0112] Interactive logic verification unit:
[0113] The interactive logic verification unit is used to perform a logic verification operation on the interactive logic according to the result of the data sending operation to obtain a logic verification result;
[0114] Specifically, the interactive logic verification unit determines whether the interactive logic of the front end receives the second test data:
[0115] If the front-end interactive logic receives the second test data, the second test data is parsed, and the interactive logic is processed on the parsed second test data to obtain a logic verification result;
[0116] If the front-end interactive logic does not receive the second test data, it means that the second test data fails to be sent, that is, the interactive logic test fails, the second failure reason is recorded, and a logic verification result is generated according to the second failure reason.
[0117] In order to explain the present invention more clearly, the example in the S303 front-end display verification step is continued here for explanation. If the match information of the top 16 teams in the European Cup is sent, the corresponding match information can be obtained in the top 16 front-end display sample picture, then the corresponding match information will be displayed, and the logic verification result is that the interactive logic test of the top 16 front-end display sample picture is successful; if the top 16 front-end display sample picture does not obtain the corresponding match information of the top 16 teams, then it means that the interactive logic test of the top 16 front-end display sample picture has failed, and the second failure reason is that the data was successfully obtained or the data parsing failed, etc., and the generated logic verification result is that the interactive logic test of the top 16 front-end display sample picture has failed, and the failure reason is that the match data was not successfully obtained or the data parsing failed.
[0118] Generate test result module:
[0119] The test result generation module is used to construct the test result according to the result of the data logic verification operation;
[0120] Specifically, the test result generation module generates the final test result according to the data verification result and the logic verification result, and saves the final test result electronically to facilitate the subsequent tracking of the test process and the analysis of the test data.
[0121] It should be noted that the above examples are only for explaining the implementation process of the present invention and cannot limit the protection scope of the present invention.
[0122] Example 3
[0123] This embodiment 3 has a computer-readable storage medium, which is used to store computer software instructions used to implement the method of testing front-end presentation and interactive logic described in the above-mentioned embodiment 1, which includes a program set up for the method of testing front-end presentation and interactive logic; specifically, the executable program can be built into the system of testing front-end presentation and interactive logic described in embodiment 2, so that the system of testing front-end presentation and interactive logic can implement the method of testing front-end presentation and interactive logic of embodiment 1 by executing the built-in executable program.
[0124] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0125] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware. The program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk, or an optical disk, etc.
[0126] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for testing front-end presentation and interaction logic, characterized in that: The following steps are involved: Initialization: Get the first element of the front-end display and the second element of the interaction logic; Constructing data: constructing test data according to the first element and the second element; Test verification: Based on the test data, perform data logic verification operations on the front-end display and the interaction logic through the proxy tool; Generate test results: construct test results according to the results of the data logic verification operation; The test verification step further comprises: Initiate a request: perform a data acquisition operation according to the front-end display and the interaction logic to obtain the test data; Data transmission: performing a data transmission operation on the test data through the proxy tool; Front-end display verification: according to the result of the data sending operation, a data verification operation is performed on the front-end display to obtain a data verification result; Interaction logic verification: according to the result of the data sending operation, a logic verification operation is performed on the interaction logic to obtain a logic verification result; The test data includes first test data and second test data; the step of constructing data further includes: constructing the first test data according to the first element; constructing the second test data according to the second element; The data transmission step further includes: obtaining the first test data, and sending the first test data to the front-end display through the proxy tool; obtaining the second test data, and sending the second test data to the interactive logic through the proxy tool.
2. A method for testing front-end presentation and interaction logic according to claim 1, characterized in that: The step of front-end display verification further includes: If the front-end display receives the first test data, the data verification operation is performed to obtain the data verification result; If the front-end display does not receive the first test data, the front-end display test fails, and the first failure reason is recorded, and the data verification result is generated according to the first failure reason.
3. A method for testing front-end presentation and interaction logic according to claim 1, characterized in that: The step of interactive logic verification further includes: If the interactive logic receives the second test data, the logic verification operation is performed to obtain the logic verification result; If the interactive logic does not receive the second test data, the interactive logic test fails, and the second failure reason is recorded, and the logic verification result is generated according to the second failure reason.
4. A method for testing front-end presentation and interaction logic according to claim 1, characterized in that: The step of initiating a request further comprises: Initiate a first data acquisition request through the front-end display to obtain the first test data; A second data acquisition request is initiated through the interaction logic to obtain the second test data.
5. A system for testing front-end presentation and interaction logic based on the method for testing front-end presentation and interaction logic according to claim 1, characterized in that: include: Initialization module, data construction module, test verification module and test result generation module; The initialization module is used to obtain a first element of the front-end display and a second element of the interaction logic of the front-end; The data construction module is used to construct test data according to the first element and the second element; The test verification module is used to perform data logic verification operations on the front-end display and the interactive logic through a proxy tool according to the test data; The test result generation module is used to construct a test result according to the result of the data logic verification operation.
6. A system for testing front-end presentation and interaction logic according to claim 5, characterized in that: The test verification module includes a request initiation unit, a data transmission unit, a front-end display verification unit and an interactive logic verification unit; The request initiating unit is used to perform a data acquisition operation according to the front-end display and the interaction logic to obtain the test data; The data transmission unit is used to perform a data sending operation on the test data through the proxy tool; The front-end display verification unit is used to perform a data verification operation on the front-end display according to the result of the data sending operation to obtain a data verification result; The interactive logic verification unit is used to perform a logic verification operation on the interactive logic according to the result of the data sending operation to obtain a logic verification result.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method steps of testing front-end presentation and interaction logic described in any one of claims 1-4 are implemented.
Citation Information
Patent Citations
Interface test method and device based on test scene, equipment and medium
CN113176995A