CN112597028A - Method and device for displaying case test result and readable storage medium - Google Patents

Method and device for displaying case test result and readable storage medium Download PDF

Info

Publication number
CN112597028A
CN112597028A CN202011566602.5A CN202011566602A CN112597028A CN 112597028 A CN112597028 A CN 112597028A CN 202011566602 A CN202011566602 A CN 202011566602A CN 112597028 A CN112597028 A CN 112597028A
Authority
CN
China
Prior art keywords
test
case
result
verified
script
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
CN202011566602.5A
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.)
Beijing Zhiyin Intelligent Technology Co ltd
Original Assignee
Beijing Zhiyin Intelligent 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 Beijing Zhiyin Intelligent Technology Co ltd filed Critical Beijing Zhiyin Intelligent Technology Co ltd
Priority to CN202011566602.5A priority Critical patent/CN112597028A/en
Publication of CN112597028A publication Critical patent/CN112597028A/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
    • 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 provides a method and a device for displaying a case test result and a readable storage medium, wherein the method comprises the steps of obtaining label information to be verified input by a user, generating expected execution codes corresponding to the label information to be verified based on the label information to be verified, generating a test case corresponding to the label information to be verified according to a preset case template based on the label information to be verified, the expected execution codes and the obtained actual execution codes, executing a case test script of the test case to obtain the test result of the test case, generating a case test report based on the test result, and displaying the case test report. Therefore, the automatic test of the label information to be verified is completed by executing the case test script corresponding to the case test, and the case test result is displayed in a report form, so that the efficiency of the case test and the accuracy of the test effect can be improved.

Description

Method and device for displaying case test result and readable storage medium
Technical Field
The present application relates to the field of display of example test results, and in particular, to a method and an apparatus for displaying example test results, and a readable storage medium.
Background
The test case is a group of data which is composed of preconditions, input conditions, execution conditions, expected results and the like, is used for completing the test of a certain specific requirement or target, embodies the documents of a test scheme, a method, a technology and a strategy, can scientifically and effectively organize and plan the test steps, and is convenient to manage and record.
At present, in a data visualization system taking industry big data and labels as supports, the correctness of label values in test cases is particularly important, in daily manual label processing and testing work, because relatively mature label testing theories and methods do not exist and source code rule verification needs to be carried out on labels one by one, the manual test case label testing not only has complex verification process, small testing coverage and high error rate, and no way for storing test results, but also needs repeated verification after the label rule is changed, and no way for carrying out rapid regression testing further influences the efficiency of case testing.
Disclosure of Invention
In view of this, an object of the present application is to provide a method and an apparatus for displaying a case test result, and a readable storage medium, in which an automatic test of tag information to be verified is completed by executing a case test script corresponding to a case test, and the case test result is displayed in a report form, so that efficiency of the case test and accuracy of a test effect can be improved.
The application mainly comprises the following aspects:
in a first aspect, an embodiment of the present application provides a method for displaying a case test result, where the method includes:
acquiring information of a tag to be verified input by a user;
generating an expected execution code corresponding to the tag information to be verified based on the tag information to be verified;
generating a test case corresponding to the label information to be verified according to a preset case template based on the label information to be verified, the expected execution code and the obtained actual execution code;
executing the case test script of the test case to obtain the test result of the test case;
and generating a case test report based on the test result, and displaying the case test report.
In some embodiments, a use case test script for the test case is generated by:
a preset case template identified from the loaded case test script library;
and reading the test data in the test cases one by one according to the preset case template to generate a case test script of the test cases.
In some embodiments, the executing the use case test script of the test case to obtain the test result of the test case includes:
executing the case test script, and determining a predicted execution result and an actual execution result of the test case;
and determining the test result of the test case based on the predicted execution result and the actual execution result of the test case.
In some embodiments, the executing the use case test script determining the predicted execution result and the actual execution result of the test case includes:
and running an entry file corresponding to the use case test script, executing the expected execution code and the actual execution code in the use case test script based on a test framework in the entry file, and determining an expected execution result and an actual execution result of the test case.
In some embodiments, the determining the test result of the test case based on the predicted execution result and the actual execution result of the test case includes:
judging whether the predicted execution result is consistent with the actual execution result;
if the predicted execution result is consistent with the actual execution result, determining that the test result of the test case is passed;
and if the predicted execution result is inconsistent with the actual execution result, determining that the test result of the test case is not passed.
In a second aspect, an embodiment of the present application further provides a device for displaying a case test result, where the device includes:
the acquisition module is used for acquiring the information of the tag to be verified input by a user;
the first generation module is used for generating an expected execution code corresponding to the tag information to be verified based on the tag information to be verified;
the second generation module is used for generating a test case corresponding to the to-be-verified label information according to a preset case template based on the to-be-verified label information, the expected execution code and the obtained actual execution code;
the execution module is used for executing the case test script of the test case to obtain the test result of the test case;
and the display module is used for generating a case test report based on the test result and displaying the case test report.
In some embodiments, the second generation module, when configured to generate a use case test script of the test use case by:
a preset case template identified from the loaded test case script library;
and reading the test data in the test cases one by one according to the preset case template to generate a case test script of the test cases.
In some embodiments, when the execution module is configured to execute a use case test script of the test case to obtain a test result of the test case, the execution module is configured to:
executing the case test script, and determining a predicted execution result and an actual execution result of the test case;
and determining the test result of the test case based on the predicted execution result and the actual execution result of the test case.
In a third aspect, an embodiment of the present application further provides an electronic device, including: the electronic device comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the memory communicate through the bus, and when the processor runs, the machine-readable instructions perform the steps of the method for presenting the use case test result in any one of the possible implementation manners of the first aspect or the first aspect.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method for presenting a use case test result in the first aspect or any one of the possible implementation manners of the first aspect is executed.
The embodiment of the application provides a method and a device for displaying a case test result, a readable storage medium and electronic equipment, wherein the method comprises the steps of obtaining to-be-verified label information input by a user, generating an expected execution code corresponding to the to-be-verified label information based on the to-be-verified label information, generating a test case corresponding to the to-be-verified label information based on the to-be-verified label information, the expected execution code and an obtained actual execution code according to a preset case template, executing a case test script of the test case to obtain the test result of the test case, generating a case test report based on the test result, and displaying the case test report.
Therefore, the automatic test of the label information to be verified is completed by executing the case test script corresponding to the case test, and the case test result is displayed in a report form, so that the efficiency of the case test and the accuracy of the test effect can be improved.
In order to make the aforementioned and other objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flowchart of a method for displaying a test result of a use case according to an embodiment of the present disclosure;
FIG. 2 is a flowchart of another example test result displaying method according to an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a device for displaying test results of use cases according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
To enable those skilled in the art to use the present disclosure, the following embodiments are given in conjunction with a specific application scenario "generating a test case corresponding to tag information to be verified according to the tag information to be verified, executing a case test script of the test case, and generating a test result", and it will be apparent to those skilled in the art that the general principles defined herein may be applied to other embodiments and application scenarios without departing from the spirit and scope of the present disclosure.
The method, the apparatus, the electronic device, or the computer-readable storage medium described in the embodiments of the present application may be applied to any scenario in which a case test result needs to be displayed, and the embodiments of the present application do not limit a specific application scenario.
It is worth noting that in the current stage, in the process of testing the labels in the test case, a relatively immature label testing theory and method are not needed to perform source code rule verification one by one, the manual test case label testing is not only tedious in verification process, small in testing coverage, high in error rate, and incapable of storing the test result, but also needs to be repeatedly verified after the label rule is changed, and a quick regression test is not performed, so that the test efficiency is influenced, and the test efficiency of the test case is low.
In view of the above, an aspect of the present application provides a method for displaying a case test result, which can obtain a test case by obtaining tag information input by a user, complete an automated test of a tag by executing a case test case script, and display the case test result in a report form, so that efficiency of case test can be improved, and the case test result can be displayed in a visual manner.
For the convenience of understanding of the present application, the technical solutions provided in the present application will be described in detail below with reference to specific embodiments.
Fig. 1 is a flowchart of a method for displaying a case test result according to an embodiment of the present application, and as shown in fig. 1, the method includes:
s101: and acquiring the information of the tag to be verified input by the user.
In the step, after receiving an instruction of the tag information to be verified input by the user, the tag information to be verified input by the user is acquired.
The tag information to be verified input by the user may include a "tag code", a "tag name", an "enterprise id", a "source data table", a "data field", an "operator", a "result table", a "result field", and the like.
In specific implementation, a tester configures the acquired tag information to be verified according to a tag processing document rule, and sequentially inputs the tag information to be verified according to the tag processing document rule. When the label rule configuration is carried out, all parameters of the label information are input on a rule configuration engine platform according to the label processing document rule. If there is an associated relationship between the labels, an associated type can be selected on the rule configuration engine platform, and the associated type selection relationship can be pulled down, such as left join (left join), right join (right join), inner join (inner join), all join (all join), and the like.
S102: and generating an expected execution code corresponding to the tag information to be verified based on the tag information to be verified.
In this step, an expected execution code corresponding to the tag information to be verified is generated according to the tag information to be verified in step S101.
The expected execution code is an expected execution code which is an expected execution code of a test result predicted by the label information to be verified and can be automatically tested and generated according to the label information on the rule configuration engine platform after the rule configuration engine platform completes configuration of the label information to be verified.
In specific implementation, after the tag information to be verified is successfully configured on the rule configuration engine platform according to the tag processing document, an expected execution code is generated through automatic testing. If the configuration of the tag information to be verified fails on the rule configuration engine platform, the expected execution code is not generated.
S103: and generating a test case corresponding to the label information to be verified according to a preset case template based on the label information to be verified, the expected execution code and the obtained actual execution code.
In the step, the acquired tag information to be verified, the expected execution code and the acquired actual execution code are written into a preset case template, and a test case corresponding to the tag information to be verified is generated in the preset case template.
The actual execution code is an actual execution code obtained according to the expected execution code, and the actual execution code is an actual execution code of the tag verification information to be verified, which generates an actual test result.
The use case template is a preset use case template in an EXCEL form and is used for writing the acquired tag information to be verified, the expected execution code, the acquired actual execution code and the like.
In the specific implementation, the parameter information corresponding to the tag information to be verified is configured on the configuration engine platform according to the tag processing document rule, and after the tag information to be verified is successfully configured on the configuration engine platform, generating an expected execution code of the tag information to be verified in a right visualization area of the rule engine configuration platform, and when the expected execution code of the tag information to be verified is acquired, acquiring an actual execution code of the tag information to be verified according to an expected execution code of the tag information to be verified, displaying the actual execution code of the tag information to be verified in the right visual area of the rule engine configuration platform, after the actual execution code of the tag information to be verified is obtained, writing the information of the tag to be verified, the expected execution code and the actual execution code into a fixed Excel case template, and generating a test case corresponding to the tag information to be verified.
S104: and executing the case test script of the test case to obtain the test result of the test case.
In the step, a case test script of the test case corresponding to the to-be-verified label information is obtained, and the case test script corresponding to the test case is executed to obtain a test result of the test case of the to-be-verified label information.
The purpose of the execution case test script is to execute expected execution code and actual execution code in the test case.
Here, the test result is a test result of the tag information to be verified, and the test result includes use case number information, use case pass information, use case fail information, start time information, run time information, number information, tag name information, tag description information, result information, and the like.
In the specific implementation, after the rule configuration engine platform successfully configures the information about the tag to be verified, Excel version test data and test cases are generated in files under a data directory under a test project to which the test cases belong, and each time the rule configuration engine system stores the test cases, one test case is generated, wherein the test cases comprise tag basic information, a data source table and field information, a result table and result field information, expected execution codes and actual execution code information. And executing the expected execution code and the actual execution code in the test script of the test case to obtain the test result of the test case.
In the step S104, the executing the use case test script of the test case to obtain the test result of the test case includes:
(1) and executing the case test script, and determining a predicted execution result and an actual execution result of the test case.
The predicted execution result is an execution result corresponding to the expected execution code, and the actual execution result is an execution result corresponding to the actual execution code.
Here, the executing the use case test script determining the predicted execution result and the actual execution result of the test case includes:
and running an entry file corresponding to the use case test script, executing the expected execution code and the actual execution code in the use case test script based on a test framework in the entry file, and determining an expected execution result and an actual execution result of the test case.
The entry file is used for executing the test script, and a unit test-based automated test framework (unit test, which is a built-in unit test framework and has conditions of automated frameworks such as writing cases, organizing cases, executing cases, outputting reports and the like) is packaged in the entry file, and is automatically loaded and subjected to automated operation tests.
Here, the TestLoader (loader under unittest automatically adds test cases through TestLoader) loads test cases beginning with test generated under a data directory under a test case item into a TestSuite test suite (test case set used for creating the test suite under unittest framework), then the TestSuite is run by a testtesttestrunner (driver class for running test cases), and expected execution codes and actual execution codes in the executed test cases obtain expected execution codes and expected execution results and actual execution results corresponding to the actual execution codes.
(2) And determining the test result of the test case based on the predicted execution result and the actual execution result of the test case.
The test result of the test case comprises case quantity information, case passing information, case failure information, starting time information, running time information, number information, label name information, label description information, result information and the like.
Determining the test result of the test case based on the predicted execution result and the actual execution result of the test case, wherein the determining comprises the following steps: and judging whether the predicted execution result is consistent with the actual execution result, if so, determining that the test result of the test case passes, and if not, determining that the test result of the test case does not pass.
Here, whether the predicted execution result is consistent with the actual execution result is determined by the following two methods, if the predicted execution result is consistent with the actual execution result, the test result of the test case passes, and if the predicted execution result is consistent with the actual execution result, the test result of the test case does not pass.
Assertion method one (assertEqual) (arg1, arg2, msg)), arg1 is an expected result test value, arg2 is an actual result test value, whether the expected result test value arg1 and the actual result test value arg2 are equal is judged, if the expected result test value arg1 and the actual result test value arg2 are equal, the result is True, and if msg information appears, the msg information is returned as failure error information, for example: and if the expected result test value of the label obtained by the test code is 1, and the value of the label in the actual result test table is 1, judging that the test case passes.
Asserting method two assert true (arg2), judging whether actual result test value arg2 is true, if true, the actual result test value is true, otherwise, the actual result test value is false, for example: the expected condition in the case test code is >0, and if the actual result test value is also >0 data, the test case is broken to pass. If the expected condition in the use case test code is <0, the use case test is aborted if the actual result test value is also >0 data.
S105: and generating a case test report based on the test result, and displaying the case test report.
Here, the use case test report is a report form in which the label information is visually displayed.
The test report includes label number, label name, label description, operation duration, operation result, operation and other information.
In the step, the obtained test results are integrated into a visual report/report through the Beautifurport, and the use case test report can be displayed on a terminal interface of a user, so that the user can view the visual use case test report.
In specific implementation, the test result of the test case is displayed through the visual test report, and the label number, the label name, the label description, the running time, the running result and the operation of each case can be very visually seen in the test report. And the use case test report can be regularly run automatic tests every day in the form of a mail template and the test report mail is sent to the corresponding responsible person.
The application provides a method for displaying a case test result, which comprises the steps of obtaining information of a label to be verified input by a user, generating an expected execution code corresponding to the information of the label to be verified based on the information of the label to be verified, generating a test case corresponding to the information of the label to be verified according to a preset case template based on the information of the label to be verified, the expected execution code and the obtained actual execution code, executing a case test script of the test case to obtain the test result of the test case, generating a case test report based on the test result, and displaying the case test report in a terminal interface of the user.
Therefore, the automatic test of the label information to be verified is completed by executing the case test script corresponding to the case test, and the case test result is displayed in a report form, so that the efficiency of the case test and the accuracy of the test effect can be improved.
As shown in fig. 2, fig. 2 is a flowchart of another method for displaying a use case test result according to an embodiment of the present application, and as shown in fig. 2, the method includes:
s201: and acquiring the information of the tag to be verified input by the user.
S202: and generating an expected execution code corresponding to the tag information to be verified based on the tag information to be verified.
S203: generating a test case corresponding to the label information to be verified according to a preset case template based on the label information to be verified, the expected execution code and the obtained actual execution code;
s204: and identifying a preset use case template from the loaded use case test script library.
The test case script library stores a large number of test case scripts, and the test case scripts store the test case templates of the preset character string types.
In the step, a test case script library is loaded firstly, and a case template is identified through the type of a preset character string in the test script.
S205: and reading the test data in the test cases one by one according to the preset case template to generate a case test script of the test cases.
The test data is information about the tag to be verified in the test case.
In the step, according to a preset test case template, calling a related method through an instantiation load _ workbook (function of built-in operation Excel) class object to read each line of data in an Excel case template file one by one, formatting each line of data, and then generating a corresponding case test script under data of a specified test case project in sequence.
In specific implementation, the automated test engine loads a test case script library, the script generating the test case is stored in the test case script library, a case template of a character string type is preset in the case script, and each line of data in the test case is read to format the data. And generating a corresponding use case test script under the specified path, wherein the generated script is the test case name beginning with test.
S206: and executing the case test script of the test case to obtain the test result of the test case.
S207: and generating a case test report based on the test result, and displaying the case test report.
The descriptions of S201 to S203 and S206 to S207 may refer to the descriptions of S101 to S103 and S104 to S105, and the same technical effects can be achieved, which is not described in detail herein.
The application provides a method for displaying a case test result, which comprises the steps of acquiring information of a label to be verified input by a user, generating an expected execution code corresponding to the information of the label to be verified based on the information of the label to be verified, the expected execution code and an acquired actual execution code, generating a test case corresponding to the to-be-verified label information according to a preset case template, identifying the preset test case template from the loaded case test script library, reading the test data in the test cases one by one according to the preset case template, generating a case test script of the test case, executing the case test script of the test case to obtain a test result of the test case, generating a case test report based on the test result, and displaying the case test report in a terminal interface of the user.
Therefore, the automatic test of the label information to be verified is completed by executing the case test script corresponding to the case test, and the case test result is displayed in a report form, so that the efficiency of the case test and the accuracy of the test effect can be improved.
Based on the same application concept, the embodiment of the present application further provides a device for displaying a use case test result corresponding to the method for displaying a use case test result provided by the above embodiment, and as the principle of solving the problem of the device in the embodiment of the present application is similar to the method for desensitizing data in the above embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a device for displaying a case test result according to an embodiment of the present application.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a device for displaying a case test result according to an embodiment of the present application. As shown in fig. 3, the display apparatus 300 includes:
the obtaining module 301 is configured to obtain tag information to be verified, which is input by a user;
a first generating module 302, configured to generate an expected execution code corresponding to the tag information to be verified based on the tag information to be verified;
a second generating module 303, configured to generate a test case corresponding to the tag information to be verified according to a preset case template based on the tag information to be verified, the expected execution code, and the obtained actual execution code;
the execution module 304 is configured to execute the case test script of the test case to obtain a test result of the test case;
and a display module 305, configured to generate a use case test report based on the test result, and display the use case test report.
Optionally, when the second generating module 303 is configured to generate a use case test script of the test use case through the following steps, the second generating module 303 is configured to:
a preset case template identified from the loaded test case script library;
and reading the test data in the test cases one by one according to the preset case template to generate a case test script of the test cases.
Optionally, when the execution module 304 is configured to execute the use case test script of the test case to obtain the test result of the test case, the execution module 304:
executing the case test script, and determining a predicted execution result and an actual execution result of the test case;
and determining the test result of the test case based on the predicted execution result and the actual execution result of the test case.
Optionally, when the execution module 304 is configured to execute the use case test script and determine the predicted execution result and the actual execution result of the test use case, the execution module 304 is configured to:
and running an entry file corresponding to the use case test script, executing the expected execution code and the actual execution code in the use case test script based on a test framework in the entry file, and determining an expected execution result and an actual execution result of the test case.
Optionally, when the execution module 304 is configured to determine the test result of the test case based on the predicted execution result and the actual execution result of the test case, the execution module 304 is configured to:
judging whether the predicted execution result is consistent with the actual execution result;
if the predicted execution result is consistent with the actual execution result, determining that the test result of the test case is passed;
and if the predicted execution result is inconsistent with the actual execution result, determining that the test result of the test case is not passed.
The application provides a display device of use case test result, the acquisition module for acquire the label information that awaits verifying of user's input, first generation module for based on the label information that awaits verifying generates the anticipated execution code that awaits verifying the label information correspondence, the second generation module for based on await verifying the label information anticipated execution code and the actual execution code that acquires, according to predetermined use case template, generate the test case that awaits verifying the label information corresponds, execution module for the execution the use case test script of test case obtains the test result of test case, display module for based on the test result generates the use case test report, and will the use case test report is shown in user's terminal interface.
Therefore, the automatic test of the label information to be verified is completed by executing the case test script corresponding to the case test, and the case test result is displayed in a report form, so that the efficiency of the case test and the accuracy of the test effect can be improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 4, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.
The memory 420 stores machine-readable instructions executable by the processor 410, when the electronic device 400 runs, the processor 410 communicates with the memory 420 through the bus 430, and when the machine-readable instructions are executed by the processor 410, the steps of the method for displaying the use case test result in the method embodiments shown in fig. 1 and fig. 2 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for displaying a use case test result in the embodiments shown in fig. 1 and fig. 2 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for displaying a case test result is characterized by comprising the following steps:
acquiring information of a tag to be verified input by a user;
generating an expected execution code corresponding to the tag information to be verified based on the tag information to be verified;
generating a test case corresponding to the label information to be verified according to a preset case template based on the label information to be verified, the expected execution code and the obtained actual execution code;
executing the case test script of the test case to obtain the test result of the test case;
and generating a case test report based on the test result, and displaying the case test report.
2. The demonstration method according to claim 1, wherein a use case test script of the test case is generated by:
a preset case template identified from the loaded case test script library;
and reading the test data in the test cases one by one according to the preset case template to generate a case test script of the test cases.
3. The method according to claim 1, wherein the executing the use case test script of the test case to obtain the test result of the test case comprises:
executing the case test script, and determining a predicted execution result and an actual execution result of the test case;
and determining the test result of the test case based on the predicted execution result and the actual execution result of the test case.
4. The method according to claim 3, wherein the determining the predicted execution result and the actual execution result of the test case by the use case test script comprises:
and running an entry file corresponding to the use case test script, executing the expected execution code and the actual execution code in the use case test script based on a test framework in the entry file, and determining an expected execution result and an actual execution result of the test case.
5. The method according to claim 3, wherein the determining the test result of the test case based on the predicted execution result and the actual execution result of the test case comprises:
judging whether the predicted execution result is consistent with the actual execution result;
if the predicted execution result is consistent with the actual execution result, determining that the test result of the test case is passed;
and if the predicted execution result is inconsistent with the actual execution result, determining that the test result of the test case is not passed.
6. A device for displaying use case test results, the device comprising:
the acquisition module is used for acquiring the information of the tag to be verified input by a user;
the first generation module is used for generating an expected execution code corresponding to the tag information to be verified based on the tag information to be verified;
the second generation module is used for generating a test case corresponding to the to-be-verified label information according to a preset case template based on the to-be-verified label information, the expected execution code and the obtained actual execution code;
the execution module is used for executing the case test script of the test case to obtain the test result of the test case;
and the display module is used for generating a case test report based on the test result and displaying the case test report.
7. The demonstration apparatus according to claim 6, wherein the second generation module, when being configured to generate the use case test script of the test case, is configured to:
a preset case template identified from the loaded test case script library;
and reading the test data in the test cases one by one according to the preset case template to generate a case test script of the test cases.
8. The apparatus according to claim 6, wherein when the execution module is configured to execute a use case test script of the test case to obtain a test result of the test case, the execution module is configured to:
and running an entry file corresponding to the use case test script, executing the expected execution code and the actual execution code in the use case test script based on a test framework in the entry file, and determining an expected execution result and an actual execution result of the test case.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine readable instructions executable by the processor, the processor and the memory communicating via the bus when an electronic device is running, the machine readable instructions when executed by the processor performing the steps of the method for demonstrating use case test results as claimed in any one of claims 1 to 5.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method for presenting use case test results according to any one of claims 1 to 5.
CN202011566602.5A 2020-12-25 2020-12-25 Method and device for displaying case test result and readable storage medium Pending CN112597028A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011566602.5A CN112597028A (en) 2020-12-25 2020-12-25 Method and device for displaying case test result and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011566602.5A CN112597028A (en) 2020-12-25 2020-12-25 Method and device for displaying case test result and readable storage medium

Publications (1)

Publication Number Publication Date
CN112597028A true CN112597028A (en) 2021-04-02

Family

ID=75202692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011566602.5A Pending CN112597028A (en) 2020-12-25 2020-12-25 Method and device for displaying case test result and readable storage medium

Country Status (1)

Country Link
CN (1) CN112597028A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110998A (en) * 2021-04-23 2021-07-13 中国邮政储蓄银行股份有限公司 Interface test report generation method and generation device
CN113220595A (en) * 2021-06-11 2021-08-06 中国农业银行股份有限公司 Test method and device
CN113485882A (en) * 2021-07-21 2021-10-08 鹏城实验室 Chip verification method and device and computer readable storage medium
CN113656320A (en) * 2021-08-26 2021-11-16 国网电子商务有限公司 Test case generation method and device
CN114116503A (en) * 2021-12-01 2022-03-01 中科新松有限公司 Test method, test device, electronic equipment and storage medium
CN114443501A (en) * 2022-02-11 2022-05-06 广州导远电子科技有限公司 Product testing method, device, system, electronic equipment and storage medium
CN115118643A (en) * 2022-06-17 2022-09-27 深圳供电局有限公司 Intelligent network closing ring test method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7347376B1 (en) * 2003-09-17 2008-03-25 Hand Held Products, Inc. Apparatus and method for verifying print quality of an encoded indicium
CN102012859A (en) * 2010-08-31 2011-04-13 中山大学 Browser label test method
CN108491331A (en) * 2018-04-13 2018-09-04 平安普惠企业管理有限公司 Method for testing software, device, equipment and computer storage media
CN110287095A (en) * 2019-05-20 2019-09-27 深圳壹账通智能科技有限公司 A kind of automated testing method, device and storage medium
CN110399293A (en) * 2019-06-21 2019-11-01 平安科技(深圳)有限公司 System detection method, device, computer equipment and storage medium
CN110941562A (en) * 2019-12-16 2020-03-31 卡斯柯信号(北京)有限公司 Test case verification method and device and electronic equipment
CN111259403A (en) * 2020-01-09 2020-06-09 深圳壹账通智能科技有限公司 Penetration testing method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7347376B1 (en) * 2003-09-17 2008-03-25 Hand Held Products, Inc. Apparatus and method for verifying print quality of an encoded indicium
CN102012859A (en) * 2010-08-31 2011-04-13 中山大学 Browser label test method
CN108491331A (en) * 2018-04-13 2018-09-04 平安普惠企业管理有限公司 Method for testing software, device, equipment and computer storage media
CN110287095A (en) * 2019-05-20 2019-09-27 深圳壹账通智能科技有限公司 A kind of automated testing method, device and storage medium
CN110399293A (en) * 2019-06-21 2019-11-01 平安科技(深圳)有限公司 System detection method, device, computer equipment and storage medium
CN110941562A (en) * 2019-12-16 2020-03-31 卡斯柯信号(北京)有限公司 Test case verification method and device and electronic equipment
CN111259403A (en) * 2020-01-09 2020-06-09 深圳壹账通智能科技有限公司 Penetration testing method and device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
R ANBUNATHAN等: "Automation framework for test script generation for Android mobile", 《2017 2ND IEEE INTERNATIONAL CONFERENCE ON RECENT TRENDS IN ELECTRONICS, INFORMATION & COMMUNICATION TECHNOLOGY (RTEICT)》, 15 January 2018 (2018-01-15), pages 1914 - 1918 *
刘浩: "HF RFID标签自动测试系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 May 2010 (2010-05-15), pages 138 - 641 *
王庆武: "基于OpenStack的自动化测试框架的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, 15 February 2019 (2019-02-15), pages 138 - 459 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110998A (en) * 2021-04-23 2021-07-13 中国邮政储蓄银行股份有限公司 Interface test report generation method and generation device
CN113220595A (en) * 2021-06-11 2021-08-06 中国农业银行股份有限公司 Test method and device
CN113220595B (en) * 2021-06-11 2023-10-03 中国农业银行股份有限公司 Test method and test equipment
CN113485882A (en) * 2021-07-21 2021-10-08 鹏城实验室 Chip verification method and device and computer readable storage medium
CN113656320A (en) * 2021-08-26 2021-11-16 国网电子商务有限公司 Test case generation method and device
CN114116503A (en) * 2021-12-01 2022-03-01 中科新松有限公司 Test method, test device, electronic equipment and storage medium
CN114443501A (en) * 2022-02-11 2022-05-06 广州导远电子科技有限公司 Product testing method, device, system, electronic equipment and storage medium
CN115118643A (en) * 2022-06-17 2022-09-27 深圳供电局有限公司 Intelligent network closing ring test method and system

Similar Documents

Publication Publication Date Title
CN112597028A (en) Method and device for displaying case test result and readable storage medium
US8694958B1 (en) Marking up objects in code generation
US8627290B2 (en) Test case pattern matching
CN104050078B (en) Test script generates system
CN105446874B (en) A kind of detection method and device of resource distribution file
CN111459495B (en) Unit test code file generation method, electronic device and storage medium
CN111797006B (en) Method, device and equipment for testing thread and storage medium
CN111522741A (en) Interface test code generation method and device, electronic equipment and readable storage medium
CN111966580A (en) Automatic testing method, device, equipment and storage medium based on artificial intelligence
CN110908915A (en) Test coverage rate display method and device and computer system
CN112306495A (en) Picture verification method and device, computer equipment and computer-readable storage medium
US20130339798A1 (en) Methods for automated software testing and devices thereof
CN114141302A (en) Test method of solid state disk and electronic equipment
JP2018073054A (en) Object analyzing device, object analyzing method, and program
CN106294109B (en) Method and device for acquiring defect code
JP2013218492A (en) Software test automatic evaluation device and method
CN112131111A (en) Method, device and storage medium for automatically testing page
CN111159028A (en) Webpage testing method and device
CN116719736A (en) Test case generation method and device for testing software interface
US20240118994A1 (en) Test method, system, and device based on excel file loading
CN115563008A (en) Code coverage rate detection system, method, device and storage medium
CN110941830B (en) Vulnerability data processing method and device
CN110704252A (en) Automatic testing device and testing method based on cloud dynamic management
CN111008140B (en) Cross-platform UI (user interface) automatic testing method and device
CN113986749A (en) Display method and display device of front-end test information 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