CN116431522A - Automatic test method and system for low-code object storage gateway - Google Patents

Automatic test method and system for low-code object storage gateway Download PDF

Info

Publication number
CN116431522A
CN116431522A CN202310685546.4A CN202310685546A CN116431522A CN 116431522 A CN116431522 A CN 116431522A CN 202310685546 A CN202310685546 A CN 202310685546A CN 116431522 A CN116431522 A CN 116431522A
Authority
CN
China
Prior art keywords
test
test case
request
case
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310685546.4A
Other languages
Chinese (zh)
Inventor
李姗姗
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202310685546.4A priority Critical patent/CN116431522A/en
Publication of CN116431522A publication Critical patent/CN116431522A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention provides a method and a system for automatically testing a low-code object storage gateway, wherein the method comprises the following steps: after receiving the new test cases, inputting test parameters of the new test cases into a test case template to obtain the test cases, and determining a target test set based on scene types; replacing global template parameters through global variables; performing pre-processing on the request parameters based on the pre-processing operation of the test case, determining the processed request parameters, and executing the test step to obtain a test result; and checking based on the assertion mode, the assertion path and the expected value defined in the newly added test case, thereby judging whether the test is passed. Therefore, the automatic test can be completed by the universal execution code, the automatic workload and repeatability are reduced, the test difficulty is reduced, and the system expansibility is improved.

Description

Automatic test method and system for low-code object storage gateway
Technical Field
The invention relates to the technical field of software testing, in particular to an automatic test method and system for a low-code object storage gateway.
Background
With the development of an internet network storage architecture, object storage is performed according to client requirements, so that safe and reliable data storage service is provided for clients, and when the objects are stored, an object gateway supports two client access modes of an API and an SDK, and a stored resource pool is also distributed in multiple provinces and regions nationwide. The customized functional requirements of each resource pool have higher requirements on the flexibility of the automatic test system.
However, at present, when the object is stored, because of the problem of resource pool distribution, the automatic test system used by the storage gateway test team can only support API interface test and is not compatible with SDK in some areas when the object is stored; meanwhile, the functional characteristics supported on each resource pool line are different, each resource pool needs to be tested by maintaining a separate test case and code, the automatic workload is large, and the code repeatability is high, so that the code development difficulty of the existing automatic test system is high, and the code capability requirement on testers is high.
Disclosure of Invention
Aiming at the problems existing in the prior art, the embodiment of the invention provides a method and a system for automatically testing a low-code object storage gateway.
The embodiment of the invention provides a low-code object storage gateway automatic test method, which comprises the following steps:
after receiving the new test case, determining test parameters and test scenes corresponding to the new test case, obtaining a preset test case template, inputting the test parameters into the test case template to obtain a corresponding test case, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation;
acquiring scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types;
after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test case, wherein the replacement sequence is based on the priority of test case codes in the target test set;
performing pre-processing on the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps;
and acquiring an assertion mode, an assertion path and an expected value defined in the newly-added test case based on the post-operation of the test case, checking the test result based on the assertion mode, the assertion path and the expected value, and judging whether the test request of the tester passes or not through the check result.
In one embodiment, the method further comprises:
sequentially executing the test steps in the test cases based on the priorities, and detecting whether the current test case is successfully executed after the test steps in the test cases are executed;
when the current test case is successfully executed, executing the next test case based on the priority;
when the current test case fails to be executed, detecting whether the test case contains a retry identifier, and when the test case contains the retry identifier, repeatedly executing a failure request of the current test case failing to be executed;
after the test steps of all the test cases in the test set are detected to be executed, test results corresponding to the test set are obtained.
In one embodiment, the method further comprises:
judging whether the pre-processing step has processing step execution failure or not based on the test request parameters, and skipping over the current test case when the pre-processing step has processing step execution failure, and executing the next test case based on the priority of the test cases in the test set.
In one embodiment, the method further comprises:
and acquiring an execution code which is pre-stored in a code database and has a mapping relation with the test steps in the test case, and executing the test steps in the test case through the execution code and the mapping relation.
In one embodiment, the pre-processing includes:
data preprocessing, local parameter replacement and context use case parameter replacement;
the local parameter replacement and the context parameter replacement comprise:
and acquiring the target parameter corresponding to the request parameter, and carrying out parameter replacement on the target parameter based on the request parameter.
In one embodiment, the method further comprises:
and generating a test report based on the execution result of the test case in the detection result, and sending the test report to the binding address of the tester.
The embodiment of the invention provides an automatic test system for a low-code object storage gateway, which comprises the following components:
the receiving module is used for determining the test parameters and the test scenes corresponding to the new test cases after receiving the new test cases, obtaining a preset test case template, inputting the test parameters into the test case template to obtain the corresponding test cases, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation;
the classification module is used for acquiring scene types corresponding to the test scenes and classifying the test cases into different test sets based on the differences of the scene types;
the replacing module is used for determining a scene type corresponding to the test request after receiving the test request of the tester, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set through global variables in the test case, wherein the replacing sequence is based on the priority of test case codes in the target test set;
the first execution module is used for carrying out pre-processing on the request parameters based on the pre-operation of the test case to obtain processed test request parameters, executing the test steps in the test case according to the test request parameters and obtaining test results corresponding to the test steps;
and the verification module is used for acquiring the assertion mode, the assertion path and the expected value defined in the new test case based on the post operation of the test case, verifying the test result based on the assertion mode, the assertion path and the expected value, and judging whether the test request of the tester passes or not through the verification result.
In one embodiment, the system further comprises:
the detection module is used for sequentially executing the test steps in the test cases based on the priority, and detecting whether the current test case is successfully executed after the test steps in the test cases are executed;
the second execution module is used for executing the next test case based on the priority when the current test case is successfully executed;
the third execution module is used for detecting whether the test case contains a retry identifier or not when the current test case fails to be executed, and repeatedly executing a failure request for failing to execute the current test case when the test case contains the retry identifier;
the acquisition module is used for acquiring test results corresponding to the test set after the completion of the test steps of all the test cases in the test set.
The embodiment of the invention provides electronic equipment, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the low-code object storage gateway automatic test method when executing the program.
Embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the low code object storage gateway automated test method described above.
The embodiment of the invention provides a low-code object storage gateway automatic test method and a system, after receiving a new test case, determining test parameters and test scenes corresponding to the new test case, acquiring a preset test case template, inputting the test parameters into the test case template to obtain a corresponding test case, wherein the test case template comprises the following components: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation; acquiring scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types; after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test cases according to the priority of test case codes in the target test set; performing pre-processing on the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps; and acquiring an assertion mode, an assertion path and an expected value defined in the newly added test case based on the post operation of the test case, checking a test result based on the assertion mode, the assertion path and the expected value, and judging whether a test request of a tester passes or not through the check result. In this way, the workflow defined in an annotation mode can be driven by the test case as a case execution engine, and the workflow defined in the case is executed by analyzing the test case: the operations of the pre-operation, the testing step, the result assertion, the post-processing and the like finish the automatic test and generate a test report. Therefore, only one group of test case sets is needed during testing, and the automatic testing is completed by combining one group of general execution codes, so that the automatic workload and repeatability are reduced; the method solves the common problems of insufficient conciseness, difficult maintenance and the like of other test system codes, has no script or code writing investment in the test, is convenient for testers who do not understand development to rapidly put into automatic test, supports the automatic test of the object storage gateway in the two modes of an API interface and an SDK, has stronger expansibility, and can easily expand other test modes.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for automated testing of a low code object storage gateway in an embodiment of the present invention;
FIG. 2 is a template structure diagram of a test case template according to an embodiment of the present invention;
FIG. 3 is a flow chart of a method for automated testing of low code object storage gateways in accordance with another embodiment of the present invention;
FIG. 4 is a block diagram of an automated test system for low code object storage gateways in accordance with an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a flow chart of an automatic test method for a low-code object storage gateway according to an embodiment of the present invention, and as shown in fig. 1, an embodiment of the present invention provides an automatic test method for a low-code object storage gateway:
step S101, after receiving a new test case, determining test parameters and test scenes corresponding to the new test case, obtaining a preset test case template, inputting the test parameters into the test case template to obtain a corresponding test case, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation.
Specifically, a worker imports a plurality of or inputs a single newly added test case through an interactive interface, wherein the newly added test case supports har format and jsonArray format, and test parameters, namely the content of the test case comprises: parameters such as a case name, a case priority, a request parameter, a pre-operation, a test step, a post-operation and the like, also comprise an assertion mode, an assertion path and an expected value, and further comprise a scene applicable to the newly added test case, namely a test scene, and a preset test case template is obtained, wherein the test case template can be shown in fig. 2, the test parameter can be input into the test case template, and the test case corresponding to the test content of the newly added test case is obtained.
Step S102, obtaining scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types.
Specifically, different scene types corresponding to the test scenes are obtained, the test cases are divided into different test sets based on differences among the different scene types, and in addition, when the new test cases are received, the new test cases may already select the existing test scenes, and then the new test cases are distributed to the corresponding test sets directly according to the scene types corresponding to the selected test scenes.
Step S103, after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test case, wherein the replacement sequence is based on the priority of test case codes in the target test set.
Specifically, after a tester determines to execute a test, a test request is received, a corresponding scene type is determined according to a test type corresponding to the tester or a corresponding request type in the test request, a corresponding target test set is determined based on the scene type of the test request, global template parameters defined by each test case in a test case set are replaced according to global variables defined by the test cases in a test environment, the replaced sequence is based on the priority of test case codes in the target test set, and in addition, the test cases in the target test set can be ordered according to the priority of the test case codes.
Step S104, pre-processing the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing the test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps.
Specifically, the preprocessing is performed on the request parameters based on the preprocessing operation of the test case, wherein the preprocessing may include: the method comprises the steps of data preprocessing, local parameter replacement, context case parameter replacement, front request method call and the like, wherein the local parameter replacement can be parameter replacement of a target parameter of a current test case, the context case parameter replacement is to perform parameter replacement of the target parameter in a front test case and a rear test case in a target test set to obtain a test request parameter of a request parameter after front processing, then a test step in the test case is executed according to the test request parameter, and the test step can comprise the following steps: according to the request parameters after the pre-processing in the test case, executing the http request, the rgw request, the sdk request or other extended request methods, transferring the response result to the test case object, then obtaining the test result corresponding to the test step, in addition, when executing each request based on the request parameters, such as the http request, the rgw request, the sdk request and the like, the execution codes pre-stored in the code database and having a mapping relation with the specific request in the test case, such as the execution codes corresponding to the http request, the execution codes corresponding to the rgw request and the like, and then executing the test step in the test case directly through the execution codes and the mapping relation, so that the test case in the workflow is defined through the mapping mechanism, repeated input codes are avoided, isolation of the test case and the execution codes is realized, and the automatic workload and repeatability are reduced.
In addition, when a tester performs a test, the test steps can be sequentially executed on all test cases in the target test set according to the priorities, after the test steps in each test case are executed, whether the current test case is executed successfully or not is detected according to the execution result of each test case, when the current test case is executed successfully, the next test case is executed based on the priorities, when the current test case is executed successfully, whether the test case contains a retry mark is detected, wherein the retry mark is used for indicating that the test request of the test case is repeatedly executed when the test request of the test case fails, the retry mark can also comprise the upper limit times including repeated execution, when the test case contains the retry mark, the failure request of the current test case is repeatedly executed when the test step of all the test cases in the test set is detected to be executed successfully, and the test result corresponding to the test set is obtained after the test steps of all the test cases in the test set are detected to be executed completely.
In addition, in the process of carrying out the pre-processing on the request parameters based on the pre-processing of the test cases, after the pre-processing is finished, judging whether the pre-processing fails to be executed based on the test request, and when the pre-processing step fails to be executed, the next test case is executed based on the priority of the test cases in the test set without carrying out the subsequent test step.
Step S105, acquiring an assertion manner, an assertion path and an expected value defined in the new test case based on the post operation of the test case, verifying the test result based on the assertion manner, the assertion path and the expected value, and judging whether the test request of the tester passes through the verification result.
Specifically, based on post-operation of the test case, namely, the assertion mode, the assertion path and the expected result defined in the newly added test case are obtained, the request response result of the test case in the test step is compared, the assertion is carried out by using an assert method, whether the execution of the test case fails or not is judged according to the assertion result, and whether the test request of the tester passes or not is determined according to the result of the failure or not.
In addition, a test report may be generated by acquiring a test case and a case execution result in a DB (storage address), and transmitting the test report to a binding address of the tester.
The embodiment of the invention provides a low-code object storage gateway automatic test method, after receiving a new test case, determining test parameters and test scenes corresponding to the new test case, acquiring a preset test case template, inputting the test parameters into the test case template to obtain a corresponding test case, wherein the test case template comprises the following components: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation; acquiring scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types; after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test cases according to the priority of test case codes in the target test set; performing pre-processing on the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps; and acquiring an assertion mode, an assertion path and an expected value defined in the newly added test case based on the post operation of the test case, checking a test result based on the assertion mode, the assertion path and the expected value, and judging whether a test request of a tester passes or not through the check result. In this way, the workflow defined in an annotation mode can be driven by the test case as a case execution engine, and the workflow defined in the case is executed by analyzing the test case: the operations of the pre-operation, the testing step, the result assertion, the post-processing and the like finish the automatic test and generate a test report. Therefore, only one group of test case sets is needed during testing, and the automatic testing is completed by combining one group of general execution codes, so that the automatic workload and repeatability are reduced; the method solves the common problems of insufficient conciseness, difficult maintenance and the like of other test system codes, has no script or code writing investment in the test, is convenient for testers who do not understand development to rapidly put into automatic test, supports the automatic test of the object storage gateway in the two modes of an API interface and an SDK, has stronger expansibility, and can easily expand other test modes.
In another embodiment, as shown in fig. 3, the method for automatically testing the low-code object storage gateway according to the embodiment of the present invention can better uniformly process the scenes of timeout, exception, failed retry, etc. of each module through a defined general workflow mechanism, and the method in the embodiment can ensure the reusability and readability of the automated code. The workflow processing flow is as follows: using a data-driven parameterized test method as a case execution method, analyzing a test case from a test case json file according to a defined data source analysis method, and carrying out global parameter replacement on the test case; analyzing the test class and the test method defined in each test case, and executing the pre-operation: the method comprises data preprocessing, local parameter replacement, context use case parameter replacement, pre-request method call and the like; the test steps are executed: executing an http request, an rgw sdk request or other extended request methods according to the request parameters in the use case, and transferring a response result to the test case object; post-operation: comparing the request response result according to the assertion mode and the expected result defined in the test case, asserting by using an assent method, judging whether the execution of the case fails or not according to the assertion result, and determining that the failed case is failed to retry according to the global configuration parameter or the case local parameter; the execution log of each key step in the workflow execution process is stored into a DB for generating a test report after all use cases are executed.
Fig. 4 is a schematic diagram of an automated testing system for a low-code object storage gateway according to an embodiment of the present invention, including: the device comprises a receiving module S201, a classifying module S202, a replacing module S203, a first executing module S204 and a checking module S205, wherein:
the receiving module S201 is configured to determine a test parameter and a test scene corresponding to a new test case after receiving the new test case, obtain a preset test case template, input the test parameter into the test case template, and obtain a corresponding test case, where the test case template includes: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation.
The classifying module S202 is configured to obtain a scene type corresponding to the test scene, and divide the test case into different test sets based on the distinction of the scene types.
And the replacing module S203 is used for determining a scene type corresponding to the test request after receiving the test request of the tester, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test case, wherein the replacing sequence is based on the priority of test case codes in the target test set.
The first execution module S204 is configured to perform pre-processing on the request parameter based on the pre-operation of the test case, obtain a processed test request parameter, execute a test step in the test case according to the test request parameter, and obtain a test result corresponding to the test step.
And the verification module S205 is used for acquiring an assertion mode, an assertion path and an expected value defined in the newly added test case based on the post operation of the test case, verifying the test result based on the assertion mode, the assertion path and the expected value, and judging whether the test request of the tester passes or not through the verification result.
In one embodiment, the system further comprises:
and the detection module is used for sequentially executing the test steps in the test cases based on the priority, and detecting whether the current test case is successfully executed after the test steps in the test cases are executed.
And the second execution module is used for executing the next test case based on the priority when the current test case is successfully executed.
And the third execution module is used for detecting whether the test case contains a retry identifier or not when the current test case fails to execute, and repeatedly executing a failure request for failing to execute the current test case when the test case contains the retry identifier.
The acquisition module is used for acquiring test results corresponding to the test set after the completion of the test steps of all the test cases in the test set.
For specific limitations on the low-code object storage gateway automation test system, reference may be made to the limitations of the low-code object storage gateway automation test method hereinabove, and no further description is given here. The various modules in the low code object storage gateway automated test system described above may be implemented in whole or in part in software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 5 illustrates a physical schematic diagram of an electronic device, as shown in fig. 5, which may include: a processor (processor) 301, a memory (memory) 302, a communication interface (Communications Interface) 303 and a communication bus 304, wherein the processor 301, the memory 302 and the communication interface 303 perform communication with each other through the communication bus 304. The processor 301 may call logic instructions in the memory 302 to perform the following method: after receiving the new test case, determining the test parameters and the test scene corresponding to the new test case, obtaining a preset test case template, inputting the test parameters into the test case template to obtain the corresponding test case, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation; acquiring scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types; after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test cases according to the priority of test case codes in the target test set; performing pre-processing on the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps; and acquiring an assertion mode, an assertion path and an expected value defined in the newly added test case based on the post operation of the test case, checking a test result based on the assertion mode, the assertion path and the expected value, and judging whether a test request of a tester passes or not through the check result.
Further, the logic instructions in memory 302 described above may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the transmission method provided in the above embodiments, for example, including: after receiving the new test case, determining the test parameters and the test scene corresponding to the new test case, obtaining a preset test case template, inputting the test parameters into the test case template to obtain the corresponding test case, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation; acquiring scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types; after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test cases according to the priority of test case codes in the target test set; performing pre-processing on the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps; and acquiring an assertion mode, an assertion path and an expected value defined in the newly added test case based on the post operation of the test case, checking a test result based on the assertion mode, the assertion path and the expected value, and judging whether a test request of a tester passes or not through the check result.
The system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. An automated testing method for a low-code object storage gateway, comprising:
after receiving the new test case, determining test parameters and test scenes corresponding to the new test case, obtaining a preset test case template, inputting the test parameters into the test case template to obtain a corresponding test case, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation;
acquiring scene types corresponding to the test scenes, and dividing the test cases into different test sets based on the differences of the scene types;
after receiving a test request of a tester, determining a scene type corresponding to the test request, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set by global variables in the test case, wherein the replacement sequence is based on the priority of test case codes in the target test set;
performing pre-processing on the request parameters based on the pre-processing operation of the test case to obtain processed test request parameters, and executing test steps in the test case according to the test request parameters to obtain test results corresponding to the test steps;
and acquiring an assertion mode, an assertion path and an expected value defined in the newly-added test case based on the post-operation of the test case, checking the test result based on the assertion mode, the assertion path and the expected value, and judging whether the test request of the tester passes or not through the check result.
2. The method for automatically testing the low-code object storage gateway according to claim 1, wherein the step of executing the test procedure in the test case according to the test request parameter, and obtaining the test result corresponding to the test procedure, includes:
sequentially executing the test steps in the test cases based on the priorities, and detecting whether the current test case is successfully executed after the test steps in the test cases are executed;
when the current test case is successfully executed, executing the next test case based on the priority;
when the current test case fails to be executed, detecting whether the test case contains a retry identifier, and when the test case contains the retry identifier, repeatedly executing a failure request of the current test case failing to be executed;
after the test steps of all the test cases in the test set are detected to be executed, test results corresponding to the test set are obtained.
3. The method for automatically testing a low-code object storage gateway according to claim 2, wherein the pre-processing the request parameters based on the pre-operation of the test case, after obtaining the processed test request parameters, further comprises:
judging whether the pre-processing step has processing step execution failure or not based on the test request parameters, and skipping over the current test case when the pre-processing step has processing step execution failure, and executing the next test case based on the priority of the test cases in the test set.
4. The automated testing method of low-code object storage gateways of claim 1, wherein the performing the testing step in the test case according to the test request parameters comprises:
and acquiring an execution code which is pre-stored in a code database and has a mapping relation with the test steps in the test case, and executing the test steps in the test case through the execution code and the mapping relation.
5. The method of automated testing of low code object storage gateways of claim 1, wherein the pre-processing comprises:
data preprocessing, local parameter replacement and context use case parameter replacement;
the local parameter replacement and the context parameter replacement comprise:
and acquiring the target parameter corresponding to the request parameter, and carrying out parameter replacement on the target parameter based on the request parameter.
6. The low code object storage gateway automated test method of claim 1, further comprising:
and generating a test report based on the execution result of the test case in the test result, and sending the test report to the binding address of the tester.
7. A low code object storage gateway automated test system, the system comprising:
the receiving module is used for determining the test parameters and the test scenes corresponding to the new test cases after receiving the new test cases, obtaining a preset test case template, inputting the test parameters into the test case template to obtain the corresponding test cases, wherein the test case template comprises: test case name, priority, global variable, request parameter, pre-operation, test step, post-operation;
the classification module is used for acquiring scene types corresponding to the test scenes and classifying the test cases into different test sets based on the differences of the scene types;
the replacing module is used for determining a scene type corresponding to the test request after receiving the test request of the tester, determining a corresponding target test set based on the scene type of the test request, and replacing global template parameters in the target test set through global variables in the test case, wherein the replacing sequence is based on the priority of test case codes in the target test set;
the first execution module is used for carrying out pre-processing on the request parameters based on the pre-operation of the test case to obtain processed test request parameters, executing the test steps in the test case according to the test request parameters and obtaining test results corresponding to the test steps;
and the verification module is used for acquiring the assertion mode, the assertion path and the expected value defined in the new test case based on the post operation of the test case, verifying the test result based on the assertion mode, the assertion path and the expected value, and judging whether the test request of the tester passes or not through the verification result.
8. The low code object storage gateway automated testing system of claim 7, wherein the system further comprises:
the detection module is used for sequentially executing the test steps in the test cases based on the priority, and detecting whether the current test case is successfully executed after the test steps in the test cases are executed;
the second execution module is used for executing the next test case based on the priority when the current test case is successfully executed;
the third execution module is used for detecting whether the test case contains a retry identifier or not when the current test case fails to be executed, and repeatedly executing a failure request for failing to execute the current test case when the test case contains the retry identifier;
the acquisition module is used for acquiring test results corresponding to the test set after the completion of the test steps of all the test cases in the test set.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of the low code object storage gateway automated test method of any of claims 1 to 6 when the program is executed.
10. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the low code object storage gateway automation test method of any of claims 1 to 6.
CN202310685546.4A 2023-06-12 2023-06-12 Automatic test method and system for low-code object storage gateway Pending CN116431522A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310685546.4A CN116431522A (en) 2023-06-12 2023-06-12 Automatic test method and system for low-code object storage gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310685546.4A CN116431522A (en) 2023-06-12 2023-06-12 Automatic test method and system for low-code object storage gateway

Publications (1)

Publication Number Publication Date
CN116431522A true CN116431522A (en) 2023-07-14

Family

ID=87080046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310685546.4A Pending CN116431522A (en) 2023-06-12 2023-06-12 Automatic test method and system for low-code object storage gateway

Country Status (1)

Country Link
CN (1) CN116431522A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117234944A (en) * 2023-11-09 2023-12-15 天津华来科技股份有限公司 Automatic interface testing method based on pytest

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN111290911A (en) * 2020-01-21 2020-06-16 上海悦易网络信息技术有限公司 Method and equipment for detecting mobile terminal task
CN112052169A (en) * 2020-09-01 2020-12-08 深圳创维-Rgb电子有限公司 Test management method, system, device and computer readable storage medium
US20210209008A1 (en) * 2018-05-23 2021-07-08 South China University Of Technology Unit testing method based on automatic generation of path coverage test cases
CN113448826A (en) * 2020-03-26 2021-09-28 中移物联网有限公司 Software automation test system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210209008A1 (en) * 2018-05-23 2021-07-08 South China University Of Technology Unit testing method based on automatic generation of path coverage test cases
CN109101415A (en) * 2018-06-25 2018-12-28 平安科技(深圳)有限公司 Interface test method, system, equipment and the storage medium compared based on database
CN111290911A (en) * 2020-01-21 2020-06-16 上海悦易网络信息技术有限公司 Method and equipment for detecting mobile terminal task
CN113448826A (en) * 2020-03-26 2021-09-28 中移物联网有限公司 Software automation test system and method
CN112052169A (en) * 2020-09-01 2020-12-08 深圳创维-Rgb电子有限公司 Test management method, system, device and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117234944A (en) * 2023-11-09 2023-12-15 天津华来科技股份有限公司 Automatic interface testing method based on pytest
CN117234944B (en) * 2023-11-09 2024-01-30 天津华来科技股份有限公司 Automatic interface testing method based on pytest

Similar Documents

Publication Publication Date Title
CN110058998B (en) Software testing method and device
CN112052172B (en) Rapid test method and device for third-party channel and electronic equipment
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN112069068A (en) Automatic test data processing method, device, equipment and readable storage medium
CN116431522A (en) Automatic test method and system for low-code object storage gateway
CN111367782B (en) Regression testing data automatic generation method and device
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN115934559A (en) Testing method of intelligent form testing system
CN113886262A (en) Software automation test method and device, computer equipment and storage medium
CN110633204B (en) Program defect detection method and device
CN115878448A (en) Database test method, distributed database and storage medium
CN112015645A (en) Function test method and device of web system and electronic equipment
CN111813665A (en) Big data platform interface data testing method and system based on python
CN107102938B (en) Test script updating method and device
CN110716855B (en) Processor instruction set testing method and device
CN110618943A (en) Security service test method and device, electronic equipment and readable storage medium
CN111752823A (en) Method, device and equipment for testing vehicle-mounted power supply application software
CN113157558B (en) System testing method and device
CN116932413B (en) Defect processing method, defect processing device and storage medium for test task
CN116361193B (en) Method and device for testing layout document text selection
CN108241575B (en) Method and device for upgrading test script
CN116991697A (en) Interface testing method, device, electronic equipment and storage medium
CN116244190A (en) Test data generation method, device, equipment and storage medium
CN116150013A (en) Interface testing method and device, storage medium and computer equipment
CN117785673A (en) Pressure testing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination