Full-link scene interface arrangement test method
By setting up process nodes to associate with interfaces and establishing a cache pool, the problem of difficult interface tests in the existing technology is solved, the degree of automation and testing efficiency are improved, and the convenience and efficiency of interface orchestration tests are achieved.
Patent Information
- Application Number
- CN202411115462.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing software interface tests are difficult to connect multiple interface processes in series for process orchestration testing, and cannot effectively improve the degree of automation and execution efficiency of tests.
By setting up the process nodes and interface associations, establishing a cache pool to cache interface in and out parameters information, generating task flow reports, realizing orchestration testing of interfaces and process nodes, and improving automation and testing efficiency.
It realizes the automation level of interface orchestration test, provides convenient acquisition of pre-test results, improves test execution efficiency, and makes orchestration test more convenient and fast.
Smart Images

Figure CN119088682A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software interface testing, and in particular to a full-link scenario interface orchestration testing method. Background Art
[0002] Software interface testing is a key activity to ensure interface functionality, data consistency, integration compatibility, exception handling, performance, security, authorization verification, etc. Software interface testing can improve the quality, stability and reliability of the system.
[0003] Existing software interface tests mostly use tools such as Postman (an HTTP debugging tool), Jmeter (a stress testing tool), Python scripts, etc. to send single interface tests. The input parameter data of many interfaces depends on the output parameter data of other interfaces, and it is impossible to connect multiple interface processes in series for process orchestration testing.
[0004] The information disclosed in this background technology section is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as acknowledging or suggesting in any form that the information constitutes the prior art already known to those skilled in the art. Summary of the invention
[0005] In view of the defects existing in the prior art, the purpose of the present invention is to provide a full-link scenario interface orchestration testing method, which completes the task flow setting of the orchestration test by binding the interface to the process node, thereby improving the degree of automation of the test; by establishing a cache pool, multiple sets of interface input parameter information and interface output parameter information can be saved, providing better convenience for obtaining pre-test results, and can be repeatedly obtained as needed, thereby improving the execution efficiency of the test.
[0006] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0007] A full-link scenario interface orchestration test method, characterized by comprising the following steps:
[0008] Set the process node and drag it to the task flow setting area;
[0009] An interface corresponding to a process node is set through an interface association operation, wherein the interface refers to an interface to be tested by an orchestration;
[0010] Establish a cache pool to cache interface input parameter information and interface output parameter information;
[0011] Repeat the above steps to set at least two process nodes and mark the start node and the end node;
[0012] Set up test scripts to complete the orchestration test;
[0013] From the start node to the end node, the test script is called in sequence to complete the orchestration test of each node; during the test, the test script obtains the interface input parameter information, transmits the interface input parameter information to the interface, and then obtains the interface output parameter information from the interface;
[0014] Parse all interface output parameter information to obtain test results, and generate a task flow report based on the test results.
[0015] Based on the above technical solution, the process nodes at least include:
[0016] The name of the process node, which is used to identify its interactive content in the full-link scenario;
[0017] Node key, used to uniquely identify the process node;
[0018] Association information is used to identify the binding relationship between the process node and the interface.
[0019] On the basis of the above technical solution, a one-to-one association relationship is formed between the process node and the interface through the interface association operation;
[0020] or:
[0021] Through the interface association operation, at least two process nodes are firstly made to form a process node group; then each process node in the same process node group is made to form a one-to-one association relationship with the same interface.
[0022] Based on the above technical solution, when the cache pool caches the interface input parameter information and the interface output parameter information, it also caches the node key and the first timestamp, so that when the information is read subsequently, the interface input parameter information or the interface output parameter information that needs to be obtained can be uniquely determined.
[0023] On the basis of the above technical solution, the cache pool also includes an information destruction timestamp, and the information destruction timestamp is used to determine when the cached interface input parameter information or interface output parameter information is marked as invalid information;
[0024] When you try to obtain the interface input parameter information or interface output parameter information that is marked as invalid, an error message will be generated.
[0025] On the basis of the above technical solution, the data format of the interface input parameter information and the interface output parameter information is constrained by a pre-compiled data structure template.
[0026] On the basis of the above technical solution, when the interface input parameter information of an interface is designated as the interface output parameter information of other interfaces, the following steps are followed to determine whether the interface output parameter information of the other interfaces can be successfully obtained:
[0027] First, obtain the current time as the second timestamp, then obtain the required interface input parameter information from the cache pool, and then compare the second timestamp with the first timestamp corresponding to the interface input parameter information. Only when the first timestamp is earlier than the second timestamp can it be successfully obtained.
[0028] Based on the above technical solution, the interface association operation also includes an optional preprocessing operation;
[0029] The optional preprocessing operation is used to perform specified data preprocessing on the interface input parameter information or the interface output parameter information as required;
[0030] The data preprocessing includes: data type conversion, data format conversion, data encryption, data decryption, adding a response header, deleting a response header, adding a data identifier, replacing a data identifier, and deleting a data identifier.
[0031] The full-link scenario interface orchestration test method described in the present invention has the following beneficial effects:
[0032] By binding the interface to the process node, the task flow setting of the orchestration test is completed, which improves the degree of test automation; by establishing a cache pool, multiple sets of interface input parameter information and interface output parameter information can be saved, providing better convenience for obtaining pre-test results, and can be repeatedly obtained as needed, improving the execution efficiency of the test.
[0033] The method described in the present invention can make test arrangement more convenient and quick, and effectively improve test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The present invention has the following accompanying drawings:
[0035] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0036] Figure 1 Flowchart of Example 1 of a full-link scenario interface orchestration testing method described in the present invention. DETAILED DESCRIPTION
[0037] The present invention is further described in detail below in conjunction with the accompanying drawings. The detailed description is an explanation made in conjunction with the exemplary embodiments of the present invention, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0038] like Figure 1As shown, the present invention provides a full-link scenario interface orchestration test method, comprising the following steps:
[0039] Set the process node and drag it to the task flow setting area;
[0040] An interface corresponding to a process node is set through an interface association operation, wherein the interface refers to an interface to be tested by an orchestration;
[0041] Establish a cache pool to cache interface input parameter information and interface output parameter information;
[0042] Repeat the above steps to set at least two process nodes and mark the start node and the end node;
[0043] Set up test scripts to complete the orchestration test;
[0044] From the start node to the end node, the test script is called in sequence to complete the orchestration test of each node; during the test, the test script obtains the interface input parameter information, transmits the interface input parameter information to the interface, and then obtains the interface output parameter information from the interface;
[0045] Parse all interface output parameter information to obtain test results, and generate a task flow report based on the test results.
[0046] Figure 1 In the example shown, the start node represents the startup phase of the process, which may be triggered by external events (such as user requests, scheduled tasks, message queue triggers, etc.). This phase is responsible for initializing necessary environment variables, configuration parameters, etc., to prepare for subsequent steps;
[0047] The end node marks the completion of the entire business process. At this stage, temporary resources can be cleaned up, locks can be released, connections can be closed, etc. to ensure the effective recycling and utilization of system resources. At the same time, a completion notification can also be sent to the relevant system or user.
[0048] The specific steps of the testing process include:
[0049] Obtaining orchestration process nodes and edges; illustratively, obtaining orchestration information of the test task, wherein the orchestration information includes a number of process nodes and edges connecting the process nodes, and the orchestration information defines the execution order and conditions of subsequent steps;
[0050] Find the start node and end node identifiers: traverse the orchestration information to locate the first process node to be executed, and locate the next process node to be executed based on the edge; traverse until the process node that serves as the end node is located;
[0051] Initialize necessary resources, environment and data to ensure the smooth execution of the test;
[0052] Determine the node type of the current process node:
[0053] Scenario node: executes specific logical branches according to business scenarios; illustratively, processes node input data and obtains process nodes and edges included in the entire scenario;
[0054] Waiting node: suspends execution until a specific condition is met (such as time arrival, external event triggering, etc.); illustratively, the query node associates the waiting configuration information and then executes the waiting;
[0055] HITP request node: executes specific business logic related to the node, which may involve interaction with external systems; illustratively, query node associated interface data, process input parameter data, execute http request, and obtain output parameter data;
[0056] Database DB node: executes SQL query or update operations and processes database interactions; illustratively, the query node associates database configuration information, processes SQL parameterized data, executes SQL, and obtains parameter data;
[0057] Fork node: decide which branch path to execute based on conditional judgment; query node branch judgment information, execute judgment logic to get the next execution node;
[0058] After processing each current process node, determine whether the next process node is the end node. If so, end the test; otherwise, use the next process node as the new current process node.
[0059] Based on the above technical solution, the process nodes at least include:
[0060] The name of the process node is used to identify its interactive content in the full-link scenario. For example, the names of the various process nodes in the full-link scenario are: user login, get warehouse list, get product list, product inventory query, product inventory, create inventory record;
[0061] Node key, used to uniquely identify a process node; illustratively, the node key is a combination of numbers and letters, the first character is a number, used to distinguish node grouping information, and the last two characters are numbers, used to distinguish the number of times the process node information has been modified;
[0062] Association information is used to identify the binding relationship between the process node and the interface.
[0063] On the basis of the above technical solution, a one-to-one association relationship is formed between the process node and the interface through the interface association operation;
[0064] or:
[0065] Through the interface association operation, at least two process nodes are firstly made to form a process node group; then each process node in the same process node group is made to form a one-to-one association relationship with the same interface.
[0066] It can be understood that, as mentioned above, the first character of the node key of each process node in the same process node group is the same number, and the number of the first character is used to distinguish the node grouping information; when the first character is set to a single character, the first character selects any one of the numbers 0-9; when the first character is set to a double character, the first character selects any one of the numbers 00-99.
[0067] Based on the above technical solution, when the cache pool caches the interface input parameter information and the interface output parameter information, it also caches the node key and the first timestamp, so that when the information is read subsequently, the interface input parameter information or the interface output parameter information that needs to be obtained can be uniquely determined.
[0068] On the basis of the above technical solution, the cache pool also includes an information destruction timestamp, and the information destruction timestamp is used to determine when the cached interface input parameter information or interface output parameter information is marked as invalid information;
[0069] When you try to obtain the interface input parameter information or interface output parameter information that is marked as invalid, an error message will be generated.
[0070] On the basis of the above technical solution, the data format of the interface input parameter information and the interface output parameter information is constrained by a pre-compiled data structure template.
[0071] On the basis of the above technical solution, when the interface input parameter information of an interface is designated as the interface output parameter information of other interfaces, the following steps are followed to determine whether the interface output parameter information of the other interfaces can be successfully obtained:
[0072] First, obtain the current time as the second timestamp, then obtain the required interface input parameter information from the cache pool, and then compare the second timestamp with the first timestamp corresponding to the interface input parameter information. Only when the first timestamp is earlier than the second timestamp can it be successfully obtained.
[0073] Based on the above technical solution, the interface association operation also includes an optional preprocessing operation;
[0074] The optional preprocessing operation is used to perform specified data preprocessing on the interface input parameter information or the interface output parameter information as required;
[0075] The data preprocessing includes: data type conversion, data format conversion, data encryption, data decryption, adding a response header, deleting a response header, adding a data identifier, replacing a data identifier, and deleting a data identifier.
[0076] The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.
[0077] The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. Any equivalent modifications or changes made by those skilled in the art based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.
Claims
1. A full-link scenario interface orchestration test method, characterized in that: The steps include: Set the process node and drag it to the task flow setting area; An interface corresponding to a process node is set through an interface association operation, wherein the interface refers to an interface to be tested by an orchestration; Establish a cache pool to cache interface input parameter information and interface output parameter information; Repeat the above steps to set at least two process nodes and mark the start node and the end node; Set up test scripts to complete the orchestration test; From the start node to the end node, the test script is called in sequence to complete the choreography test of each node; During the test, the test script obtains the interface input parameter information, transmits the interface input parameter information to the interface, and then obtains the interface output parameter information from the interface; Parse all interface output parameter information to obtain test results, and generate a task flow report based on the test results.
2. A full-link scenario interface orchestration test method as claimed in claim 1, characterized in that: The process nodes at least include: The name of the process node, which is used to identify its interactive content in the full-link scenario; Node key, used to uniquely identify the process node; Association information is used to identify the binding relationship between the process node and the interface.
3. A full-link scenario interface orchestration test method as claimed in claim 1, characterized in that: Through the interface association operation, a one-to-one association relationship is formed between the process node and the interface; or: Through the interface association operation, at least two process nodes are firstly made to form a process node group; and then each process node in the same process node group is made to form a one-to-one association relationship with the same interface.
4. A full-link scenario interface orchestration test method as claimed in claim 1, characterized in that: When the cache pool caches the interface input parameter information and the interface output parameter information, it also caches the node key and the first timestamp, so that when the information is subsequently read, the interface input parameter information or the interface output parameter information that needs to be obtained can be uniquely determined.
5. A full-link scenario interface orchestration test method as claimed in claim 4, characterized in that: The cache pool also includes an information destruction timestamp, which is used to determine when the cached interface input parameter information or interface output parameter information is marked as invalid information; When you try to obtain the interface input parameter information or interface output parameter information that is marked as invalid, an error message will be generated.
6. A full-link scenario interface orchestration test method as claimed in claim 1, characterized in that: The data format of the interface input parameter information and the interface output parameter information is constrained by a pre-compiled data structure template.
7. A full-link scenario interface orchestration test method as claimed in claim 1, characterized in that: When the interface input parameter information of an interface is designated as the interface output parameter information of other interfaces, the following steps are used to determine whether the interface output parameter information of the other interfaces can be successfully obtained: First, obtain the current time as the second timestamp, then obtain the required interface input parameter information from the cache pool, and then compare the second timestamp with the first timestamp corresponding to the interface input parameter information. Only when the first timestamp is earlier than the second timestamp can it be successfully obtained.
8. A full-link scenario interface arrangement test method as claimed in claim 1, characterized in that: The interface association operation also includes an optional pre-processing operation; The optional preprocessing operation is used to perform specified data preprocessing on the interface input parameter information or the interface output parameter information as required; The data preprocessing includes: data type conversion, data format conversion, data encryption, data decryption, adding a response header, deleting a response header, adding a data identifier, replacing a data identifier, and deleting a data identifier.
