CN117453561A - Test script calling method, device, computer equipment and storage medium - Google Patents

Test script calling method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117453561A
CN117453561A CN202311496140.8A CN202311496140A CN117453561A CN 117453561 A CN117453561 A CN 117453561A CN 202311496140 A CN202311496140 A CN 202311496140A CN 117453561 A CN117453561 A CN 117453561A
Authority
CN
China
Prior art keywords
test
script
target
event
verification rule
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
CN202311496140.8A
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.)
Southern Power Grid Digital Grid Research Institute Co Ltd
Original Assignee
Southern Power Grid Digital Grid Research Institute 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 Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Southern Power Grid Digital Grid Research Institute Co Ltd
Priority to CN202311496140.8A priority Critical patent/CN117453561A/en
Publication of CN117453561A publication Critical patent/CN117453561A/en
Pending legal-status Critical Current

Links

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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a test method, a test device, computer equipment and a storage medium of a test case. When a test request exists, responding to the test request of the test case, and under the condition that the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts; determining a target test script according to the universal test script and the target event script of the test case; and running the target test script to test the test case. The verification rule for verifying the test case is encoded into the corresponding event script, and under the condition that the verification rule of the test case is changed, the event script corresponding to the new verification rule is determined, and the target test script is determined by the event script and the universal test script.

Description

Test script calling method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for calling a test script, a computer device, and a storage medium.
Background
A test case is a detailed normalization file that is used to test software applications or system functions. It contains a set of steps, input data, expected results, and possible preconditions and post-conditions to verify that a particular function is functioning properly as required. Typically, after the test cases are designed, a tester performs the test step by step according to the procedure described in the test cases, obtains an actual result, and compares the actual result with an expected result. In order to improve the test efficiency, the automatic test of different test cases can be realized by a hard coding mode.
However, the verification rules of different devices and different test cases are inconsistent in requirements, hard coding development is complex, workload is large, and when the verification rules of the test cases are changed, program codes need to be repeatedly modified, so that the test case has low test efficiency.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a test method, apparatus, computer device, and storage medium for a test case, which can improve the test efficiency of the test case.
In a first aspect, the present application provides a test method for a test case, where the method includes:
responding to a test request of a test case, and selecting a target event script matched with a new verification rule after modification from candidate event scripts under the condition that the verification rule of the test case is determined to be modified according to the test request;
determining a target test script according to the universal test script of the test case and the target event script;
and running the target test script to test the test case.
In one embodiment, the determining, according to the test request, that the verification rule of the test case is changed includes:
extracting a target test requirement from the test request;
and if the target test requirement is inconsistent with the original test requirement of the test case, determining that the verification rule of the test case is changed.
In one embodiment, the selecting a target event script matching the changed new verification rule from the candidate event scripts includes:
constructing a target event according to the target test requirement; the target event comprises a target event identification and a changed new verification rule;
And determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
In one embodiment, the selecting a target event script matching the changed new verification rule from the candidate event scripts includes:
if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end;
and generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generation interface.
In one embodiment, the selecting a target event script matching the changed new verification rule from the candidate event scripts includes:
if the candidate event script does not have the target event script matched with the changed new verification rule, updating the universal event script according to the target test requirement in the test request to obtain the target event script matched with the new verification rule.
In one embodiment, in the case that the number of the new verification rules is at least two, the method further includes:
Summarizing the test results of the test cases according to the execution sequence among the target event scripts corresponding to the new verification rules, and displaying the summarized test results to the test requirement end.
In a second aspect, the present application further provides a test apparatus for testing a case, where the apparatus includes:
the selection module is used for responding to the test request of the test case, and selecting a target event script matched with the new verification rule after the change from candidate event scripts under the condition that the verification rule of the test case is determined to be changed according to the test request;
the determining module is used for determining a target test script according to the universal test script of the test case and the target event script;
and the operation module is used for operating the target test script so as to test the test case.
In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
responding to a test request of a test case, and selecting a target event script matched with a new verification rule after modification from candidate event scripts under the condition that the verification rule of the test case is determined to be modified according to the test request;
Determining a target test script according to the universal test script of the test case and the target event script;
and running the target test script to test the test case.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
responding to a test request of a test case, and selecting a target event script matched with a new verification rule after modification from candidate event scripts under the condition that the verification rule of the test case is determined to be modified according to the test request;
determining a target test script according to the universal test script of the test case and the target event script;
and running the target test script to test the test case.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
responding to a test request of a test case, and selecting a target event script matched with a new verification rule after modification from candidate event scripts under the condition that the verification rule of the test case is determined to be modified according to the test request;
Determining a target test script according to the universal test script of the test case and the target event script;
and running the target test script to test the test case.
When a test request exists, responding to the test request of the test case, and under the condition that the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts; determining a target test script according to the universal test script and the target event script of the test case; and further running the target test script to test the test case. The verification rule for verifying the test case is encoded into the corresponding event script, and under the condition that the verification rule of the test case is changed, the event script corresponding to the new verification rule is determined, and the target test script is determined by the event script and the universal test script.
Drawings
FIG. 1 is an application environment diagram of a test method of a test case in one embodiment;
FIG. 2 is a flow chart of a test method of a test case in one embodiment;
FIG. 3 is a flow diagram of a method for determining a target event script that matches a new validation rule in one embodiment;
FIG. 4 is a flow diagram of a method of generating a target event script in one embodiment;
FIG. 5 is a flow chart of a test method of a test case in another embodiment;
FIG. 6 is a block diagram of a test device for testing cases in one embodiment;
FIG. 7 is a block diagram of a test device for testing cases in another embodiment;
fig. 8 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The test method of the test case provided by the embodiment of the application can be suitable for a scene of testing the test case. For example, fig. 1 is an application environment diagram of a test method of a test case provided in an embodiment of the present application. Wherein the terminal 102 communicates with the server 104 via a network. For example, the terminal 102 sends a test request of a test case to the server 104, the server 104 generates a target test script in response to the test request of the test case, tests the test case, and returns a test result to the terminal 102. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers. The server 104 may include a test system function module and a script test function module, where the test system function module is used for managing a general test platform, for example, for test case addition control (change of test case data), user management (login verification of a tester), test case management (adding a test case or modifying a test case, etc.), test case editing, and transmission of a test result to the terminal 102; the script test function module is used for calling a corresponding test script, testing the test case and transmitting the test result to the test system.
In one embodiment, as shown in fig. 2, a test method for a test case is provided, and the method is applied to the server 104 in fig. 1 for illustration, and includes the following steps:
S201, responding to a test request of the test case, and when the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts.
Alternatively, the test case may be a detailed normalization file for testing software applications or system functions that contains a set of steps, input data, expected results, and possible preconditions and post-conditions to verify that a particular function is functioning properly as required. When the test requirement end has a test requirement, a test case test request is initiated. The verification rule may be understood as a verification rule for data related to the test case, so as to judge that the data related to the test case meets the requirement. For example, the test case is to test the data acquisition accuracy of the data acquisition channel 1, and the verification rule may be to verify whether the difference between the data acquired by the data acquisition channel 1 and the expected data is within a preset range. The target event script may be understood as a script file corresponding to the new validation rule.
The server 104 receives the test request and, in response to the test request for the test case, may first determine whether a verification rule for the test case changes according to the test request. When it is determined that the verification rule for the test case is changed according to the test request, a target event script matching the new verification rule after the change is selected from the candidate event scripts. It should be understood that the event scripts corresponding to each verification rule may be edited in advance, and a one-to-one correspondence may be established between each event script and each verification rule, and candidate event scripts may be generated. In this way, when the verification rule of the test case is changed, a target event scenario matching the changed new verification rule can be selected from the candidate event scenarios according to the correspondence between the test rule and the event scenario.
Optionally, according to the test request, determining whether the verification rule of the test case is changed or not may be specifically implemented by the following manner:
firstly, extracting a target test requirement from a test request; the target test requirement may include information such as test data for testing the test case, a manner for acquiring the test data, and a rule for verifying the test data. And then judging whether the target test requirement is consistent with the original test requirement of the test case. If the target test requirement is inconsistent with the original test requirement of the test case, the verification rule of the test case is determined to be changed.
S202, determining a target test script according to the universal test script and the target event script of the test case.
Alternatively, the universal test script may be understood as a universal script file for performing test case testing, that is, a test script that needs to be used for testing each test case. The target event script is a script file corresponding to the new verification rule. The target test script may be understood as a script file for testing test cases. The universal test script and the target event script of the test case may be invoked to determine the target test script.
S203, running a target test script to test the test case.
After determining the target test script for the test script, the target test script is run to complete the test of the test case, for example, to output a final test result.
When a test request exists, responding to the test request of the test case, and under the condition that the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts; determining a target test script according to the universal test script and the target event script of the test case; and further running the target test script to test the test case. The verification rule for verifying the test case is encoded into the corresponding event script, and under the condition that the verification rule of the test case is changed, the event script corresponding to the new verification rule is determined, and the target test script is determined by the event script and the universal test script.
In one embodiment, referring to fig. 3, fig. 3 provides a flowchart of a method for determining a target event script matching a new validation rule, which specifically includes the following steps:
s301, constructing a target event according to the target test requirement.
Optionally, when the target test requirement exists, a target event may be constructed according to the target test requirement, where the target event includes a target event identifier and a new verification rule after modification. For example, the target event is testing the accuracy of the acquired data of the data acquisition channel 1. The target event identification may create an event for the event name and event; the new verification rule after the change can be to verify whether the relative difference between the acquired data and the expected data of the data acquisition channel 1 is within 10%.
S302, determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identification based on the corresponding relation between the candidate event identification and the candidate event script.
Optionally, a corresponding target event script may be generated in advance according to the target event, and a corresponding relationship is established between the target event and the target event according to the target event identifier, and then the corresponding relationship and other event scripts are put into the candidate event script together. In this way, the target event script matched with the new verification rule after the change in the candidate event script can be determined according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
In the embodiment of the application, the target event script matched with the changed new verification rule in the candidate event script can be rapidly determined through the target event identifier, so that the test efficiency of the test case is improved.
Alternatively, there may not be a target event script matching the changed new validation rule in the candidate event script, and at this time, the target event script may be generated to test the test case. In one embodiment, referring to FIG. 4, FIG. 4 provides a flow diagram of a method of generating a target event script. The method specifically comprises the following steps:
s401, if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end.
Optionally, if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end. The script generation interface may include an event script similar to the target event script, so that the user may modify the event script through the test requirement end to generate the target event script.
S402, generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generation interface.
The user may operate the script generation interface through the test requirement end, for example, modify a similar script file in the script generation interface, and the server 104 may generate a target event script matched with the new verification rule according to an input operation of the test requirement end on the script generation interface.
In the embodiment of the application, under the condition that the target event script matched with the changed new verification rule does not exist in the candidate event script, a script generation interface is displayed to the test demand end so that a user corresponding to the test demand end can operate the script generation interface to generate the target event script. The script file does not need to be modified in a large amount, and the efficiency of generating the target event script is improved.
Further, in the case that there may not be a target event script matching the changed new verification rule in the candidate event script, the target event script may also be automatically generated to test the test case. Optionally, if the candidate event script does not have the target event script matched with the changed new verification rule, the universal event script may be updated according to the target test requirement in the test request, so as to obtain the target event script matched with the new verification rule. Wherein the generic event script is essentially an event script template.
For example, key fields in the target test requirements may be extracted and filled into corresponding locations of the generic event script to obtain a target event script that matches the new validation rule.
In the embodiment of the application, the universal event script is updated according to the target test requirement in the test request, so that the target event script matched with the new verification rule can be automatically generated, and the efficiency of generating the target event script is improved.
Optionally, when the test requirement end initiates different test requests of the test case, different target test requirements can be extracted from the different test requests, and different target events can be generated according to the target test requirements. When the number of the target events is multiple, the target events can be placed in an event queue, target event scripts matched with verification rules included in the target events in candidate event scripts are determined according to the arrangement sequence of the events in the event queue and the target event scripts in sequence and according to the target event identifications, and the universal test scripts and the target event scripts are operated until unprocessed target events do not exist in the event queue, and the scripts of the stop instructions are operated, so that the test of the test cases is completed.
In one embodiment, when the number of the new verification rules is at least two, the corresponding test results may also be generated and displayed according to the sequence of the target events corresponding to the new verification rules. The specific implementation process is as follows:
optionally, according to the execution sequence among the target event scripts corresponding to each new verification rule, summarizing the test results of the test case, and displaying the summarized test results to the test requirement end. The test results may include test data, validation rules, test results, and the like, among others.
In the embodiment of the application, the test results of the test cases are summarized, and the summarized test results are displayed to the test demand end, so that the user of the test demand end can conveniently check the test results.
In one embodiment, referring to fig. 5, fig. 5 provides a method flow diagram of a testing method of another test case, which specifically includes the following steps:
s501, responding to a test request of a test case, and extracting a target test requirement from the test request.
Optionally, the server 104 receives the test request and, in response to the test request for the test case, may extract the target test requirement from the test request. The target test requirement may include information such as test data for testing the test case, a manner for acquiring the test data, and a rule for verifying the test data.
S502, judging whether the target test requirement is consistent with the original test requirement of the test case. If not, determining that the verification rule of the test case is changed, and executing step S503; if so, it is determined that the verification rule for the test case has not been changed, and step S506 is executed.
S503, constructing a target event according to the target test requirement.
Optionally, when the target test requirement exists, a target event may be constructed according to the target test requirement, where the target event includes a target event identifier and a new verification rule after modification. For example, the target event is testing the accuracy of the acquired data of the data acquisition channel 1. The target event identification may create an event for the event name and event; the new verification rule after the change can be to verify whether the relative difference between the acquired data and the expected data of the data acquisition channel 1 is within 10%.
S504, determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identification based on the corresponding relation between the candidate event identification and the candidate event script.
Optionally, a corresponding target event script may be generated in advance according to the target event, and a corresponding relationship is established between the target event and the target event according to the target event identifier, and then the corresponding relationship and other event scripts are put into the candidate event script together. In this way, the target event script matched with the new verification rule after the change in the candidate event script can be determined according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
If the candidate event script may not have a target event script matching the changed new verification rule, the target event script may be generated at this time to test the test case.
Specifically, if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end. The script generation interface may include an event script similar to the target event script, so that the user may modify the event script through the test requirement end to generate the target event script.
The user may operate the script generation interface through the test requirement end, for example, modify a similar script file in the script generation interface, and the server 104 may generate a target event script matched with the new verification rule according to an input operation of the test requirement end on the script generation interface.
Further, if the candidate event script does not have the target event script matched with the changed new verification rule, the universal event script can be updated according to the target test requirement in the test request, so that the target event script matched with the new verification rule is obtained. For example, key fields in the target test requirements may be extracted and filled into corresponding locations of the generic event script to obtain a target event script that matches the new validation rule.
S505, determining a target test script according to the universal test script and the target event script of the test case.
Alternatively, the universal test script may be understood as a universal script file for performing test case testing, that is, a test script that needs to be used for testing each test case. The target event script is a script file corresponding to the new verification rule. The target test script may be understood as a script file for testing test cases. The universal test script and the target event script of the test case may be invoked to determine the target test script.
S506, taking the test script corresponding to the original test requirement as a target test script.
The test scripts corresponding to the original test requirements comprise universal test scripts of the test cases and event scripts determined based on the original test requirements.
S507, running a target test script to test the test case.
After determining the target test script for the test script, the target test script is run to complete the test of the test case, for example, to output a final test result.
And S508, summarizing the test results of the test cases, and displaying the summarized test results to the test demand end.
Optionally, according to the execution sequence among the target event scripts corresponding to each new verification rule, summarizing the test results of the test case, and displaying the summarized test results to the test requirement end. The test results may include test data, validation rules, test results, and the like, among others.
The specific processes of S501 to S508 may be referred to the description of the above method embodiments, and the implementation principle and technical effects are similar, and are not repeated herein.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a test case testing device for realizing the test method of the test case. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the method, so the specific limitation in the embodiment of the test device for one or more test cases provided below can be referred to the limitation of the test method for the test case hereinabove, and will not be repeated here.
In one embodiment, as shown in fig. 6, there is provided a block diagram of a test apparatus for a test case, including:
a selection module 10, configured to respond to a test request of a test case, and select, when it is determined that a verification rule of the test case is changed according to the test request, a target event script that matches the new verification rule after the change from candidate event scripts;
the determining module 20 is configured to determine a target test script according to the universal test script and the target event script of the test case;
and the operation module 30 is used for operating the target test script to test the test case.
In one embodiment, the selection module 10 may include:
The extraction unit is used for extracting target test requirements from the test request;
the first determining unit is used for determining that the verification rule of the test case is changed if the target test requirement is inconsistent with the original test requirement of the test case.
In one embodiment, the selection module 10 may further include:
the building unit is used for building a target event according to the target test requirement; the target event comprises a target event identification and a changed new verification rule;
and the second determining unit is used for determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
In one embodiment, the selection module 10 may further include:
the display unit is used for displaying a script generation interface to the test demand end if the candidate event script does not have the target event script matched with the changed new verification rule;
and the generating unit is used for generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generating interface.
In one embodiment, the selection module 10 may further include:
And the updating unit is used for updating the universal test script according to the target test requirement in the test request if the target event script matched with the new verification rule after the change does not exist in the candidate event scripts, so as to obtain the target event script matched with the new verification rule.
In one embodiment, referring to fig. 7, on the basis of fig. 6, fig. 7 provides a block diagram of a test apparatus for another test case, and the apparatus further includes:
and the summarizing module 40 is used for summarizing the test results of the test cases according to the execution sequence among the target event scripts corresponding to the new verification rules and displaying the summarized test results to the test requirement end.
The modules in the test device of the test case can be all or partially implemented by software, hardware and a combination 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.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing script data and test data corresponding to the test cases. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a test method for testing cases.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
responding to a test request of the test case, and under the condition that the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts;
determining a target test script according to the universal test script and the target event script of the test case;
and running the target test script to test the test case.
In one embodiment, the processor when executing the computer program further performs the steps of:
extracting a target test requirement from the test request; if the target test requirement is inconsistent with the original test requirement of the test case, the verification rule of the test case is determined to be changed.
In one embodiment, the processor when executing the computer program further performs the steps of:
constructing a target event according to the target test requirement; the target event comprises a target event identification and a changed new verification rule; and determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
In one embodiment, the processor when executing the computer program further performs the steps of:
if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end; and generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generation interface.
In one embodiment, the processor when executing the computer program further performs the steps of:
if the candidate event script does not have the target event script matched with the changed new verification rule, updating the universal event script according to the target test requirement in the test request to obtain the target event script matched with the new verification rule.
In one embodiment, the processor when executing the computer program further performs the steps of:
summarizing the test results of the test cases according to the execution sequence among the target event scripts corresponding to the new verification rules, and displaying the summarized test results to the test demand end.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
responding to a test request of the test case, and under the condition that the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts;
determining a target test script according to the universal test script and the target event script of the test case;
and running the target test script to test the test case.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting a target test requirement from the test request; if the target test requirement is inconsistent with the original test requirement of the test case, the verification rule of the test case is determined to be changed.
In one embodiment, the computer program when executed by the processor further performs the steps of:
constructing a target event according to the target test requirement; the target event comprises a target event identification and a changed new verification rule; and determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end; and generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generation interface.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the candidate event script does not have the target event script matched with the changed new verification rule, updating the universal event script according to the target test requirement in the test request to obtain the target event script matched with the new verification rule.
In one embodiment, the computer program when executed by the processor further performs the steps of:
summarizing the test results of the test cases according to the execution sequence among the target event scripts corresponding to the new verification rules, and displaying the summarized test results to the test demand end.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
responding to a test request of the test case, and under the condition that the verification rule of the test case is determined to be changed according to the test request, selecting a target event script matched with the new verification rule after the change from candidate event scripts;
determining a target test script according to the universal test script and the target event script of the test case;
and running the target test script to test the test case.
In one embodiment, the computer program when executed by the processor further performs the steps of:
extracting a target test requirement from the test request; if the target test requirement is inconsistent with the original test requirement of the test case, the verification rule of the test case is determined to be changed.
In one embodiment, the computer program when executed by the processor further performs the steps of:
constructing a target event according to the target test requirement; the target event comprises a target event identification and a changed new verification rule; and determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end; and generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generation interface.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the candidate event script does not have the target event script matched with the changed new verification rule, updating the universal event script according to the target test requirement in the test request to obtain the target event script matched with the new verification rule.
In one embodiment, the computer program when executed by the processor further performs the steps of:
summarizing the test results of the test cases according to the execution sequence among the target event scripts corresponding to the new verification rules, and displaying the summarized test results to the test demand end.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A method for testing a test case, the method comprising:
responding to a test request of a test case, and selecting a target event script matched with a new verification rule after modification from candidate event scripts under the condition that the verification rule of the test case is determined to be modified according to the test request;
determining a target test script according to the universal test script of the test case and the target event script;
And running the target test script to test the test case.
2. The method of claim 1, wherein determining that the validation rule for the test case has changed based on the test request comprises:
extracting a target test requirement from the test request;
and if the target test requirement is inconsistent with the original test requirement of the test case, determining that the verification rule of the test case is changed.
3. The method of claim 2, wherein selecting a target event script from the candidate event scripts that matches the changed new validation rule comprises:
constructing a target event according to the target test requirement; the target event comprises a target event identification and a changed new verification rule;
and determining a target event script matched with the changed new verification rule in the candidate event script according to the target event identifier based on the corresponding relation between the candidate event identifier and the candidate event script.
4. The method of claim 1, wherein selecting a target event script from the candidate event scripts that matches the changed new validation rule comprises:
If the candidate event script does not have the target event script matched with the changed new verification rule, a script generation interface is displayed to the test demand end;
and generating a target event script matched with the new verification rule according to the input operation of the test requirement end on the script generation interface.
5. The method of claim 1, wherein selecting a target event script from the candidate event scripts that matches the changed new validation rule comprises:
if the candidate event script does not have the target event script matched with the changed new verification rule, updating the universal event script according to the target test requirement in the test request to obtain the target event script matched with the new verification rule.
6. The method according to claim 1, wherein in case the number of new validation rules is at least two, the method further comprises:
summarizing the test results of the test cases according to the execution sequence among the target event scripts corresponding to the new verification rules, and displaying the summarized test results to the test requirement end.
7. A test apparatus for testing a case, the apparatus comprising:
the selection module is used for responding to the test request of the test case, and selecting a target event script matched with the new verification rule after the change from candidate event scripts under the condition that the verification rule of the test case is determined to be changed according to the test request;
the determining module is used for determining a target test script according to the universal test script of the test case and the target event script;
and the operation module is used for operating the target test script so as to test the test case.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311496140.8A 2023-11-09 2023-11-09 Test script calling method, device, computer equipment and storage medium Pending CN117453561A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311496140.8A CN117453561A (en) 2023-11-09 2023-11-09 Test script calling method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311496140.8A CN117453561A (en) 2023-11-09 2023-11-09 Test script calling method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117453561A true CN117453561A (en) 2024-01-26

Family

ID=89588953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311496140.8A Pending CN117453561A (en) 2023-11-09 2023-11-09 Test script calling method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117453561A (en)

Similar Documents

Publication Publication Date Title
WO2020181839A1 (en) Page data testing method, apparatus, computer device, and storage medium
CN109635256B (en) Method and device for verifying data
CN116561003A (en) Test data generation method, device, computer equipment and storage medium
CN117453561A (en) Test script calling method, device, computer equipment and storage medium
CN113590447B (en) Buried point processing method and device
CN112417020B (en) Service expansion realization method, device, computer equipment and storage medium
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN117435185A (en) Code generation method, device, computer equipment and storage medium
CN113806372B (en) New data information construction method, device, computer equipment and storage medium
CN118035095A (en) Method and device for testing business processing object, computer equipment and storage medium
CN116910069A (en) Database updating method, device, computer equipment and storage medium
CN116451965A (en) Service request processing method and device, computer equipment and storage medium
CN117785674A (en) Interface use case generation method, device, computer equipment and storage medium
CN116089296A (en) Service logic testing method, device, computer equipment and storage medium
CN117033172A (en) Test data processing method, apparatus, device, storage medium and program product
CN116011380A (en) Cable connection diagram generation method, device, computer equipment and storage medium
CN117331812A (en) Service code verification method, device, computer equipment, storage medium and product
CN117435651A (en) Test data processing method, device, computer equipment and storage medium
CN117971649A (en) Data processing method, device, computer equipment and storage medium
CN115629958A (en) Universal field level automatic checking method and device for different service interfaces
CN117331956A (en) Task processing method, device, computer equipment and storage medium
CN116450240A (en) Text file loading method, text file loading device, computer equipment and storage medium
CN118096171A (en) Data gray level verification method, device, computer equipment, medium and product
CN116401323A (en) Index data processing method and device and computer equipment
CN116910115A (en) Group query method, device, computer equipment and storage medium

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