CN114996121A - Multi-frame compatible test method and device and electronic equipment - Google Patents

Multi-frame compatible test method and device and electronic equipment Download PDF

Info

Publication number
CN114996121A
CN114996121A CN202210437392.2A CN202210437392A CN114996121A CN 114996121 A CN114996121 A CN 114996121A CN 202210437392 A CN202210437392 A CN 202210437392A CN 114996121 A CN114996121 A CN 114996121A
Authority
CN
China
Prior art keywords
test
test case
tested
task
testing
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
CN202210437392.2A
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 Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202210437392.2A priority Critical patent/CN114996121A/en
Publication of CN114996121A publication Critical patent/CN114996121A/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/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

Abstract

The application discloses a testing method compatible with multiple frames, belongs to the technical field of computers, and is beneficial to improving testing efficiency. The method comprises the following steps: responding to the triggering of a test task, and acquiring a test case packet corresponding to the test task; determining an object to be tested corresponding to the test task by analyzing the test case packet; analyzing the annotations of the objects to be tested, and determining a testing frame matched with the testing task and a testing case of each object to be tested; and executing the test case of each object to be tested according to the test framework to complete the test task. The method marks the class or the method to be executed in the test case in the annotation form, and configures the test frame in the annotation form, so that the test case package can be executed on the test platform according to the test requirements of the user, the test case migration cost is low, and the test efficiency is high.

Description

Multi-frame compatible test method and device and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for testing compatibility of multiple frames, an electronic device, and a computer-readable storage medium.
Background
With the wide application of the automated testing technology, more and more open-source testing frameworks are provided for developers to realize automated testing rapidly. In the automatic testing process, developers often select a matched testing framework according to the requirements of a testing program, and build a testing project. When the test case needs to be migrated to other test frames, the test configuration file needs to be modified to adapt to the new test frame, even the test case needs to be modified, and the migration cost of the test environment is high.
It can be seen that the prior art test methods also need improvement.
Disclosure of Invention
The embodiment of the application provides a testing method compatible with multiple frames, which is beneficial to reducing the migration cost of test cases and improving the testing efficiency.
In a first aspect, an embodiment of the present application provides a multi-frame compatible testing method, including:
responding to the triggering of a test task, and acquiring a test case packet corresponding to the test task;
determining an object to be tested corresponding to the test task by analyzing the test case packet;
analyzing the annotations of the objects to be tested, and determining a testing frame matched with the testing task and a testing case of each object to be tested;
and executing the test case of each object to be tested according to the test framework to complete the test task.
In a second aspect, an embodiment of the present application provides a multi-frame compatible testing apparatus, including:
the test case packet acquisition module is used for responding to the triggering of a test task and acquiring a test case packet corresponding to the test task;
the to-be-tested object determining module is used for determining the to-be-tested object corresponding to the test task by analyzing the test case packet;
the test case determining module is used for analyzing the annotations of the objects to be tested and determining a test frame matched with the test task and a test case of each object to be tested;
and the test case execution module is used for executing the test cases of the objects to be tested according to the test framework so as to complete the test task.
In a third aspect, an embodiment of the present application provides a test platform, including: a client, a background test server, and a data management server, wherein,
the data management server is used for storing the test case packet;
the client is used for displaying the test case packet matched with the current user, responding to the triggering of the test task of the test case packet selected by the user, and sending a test task execution request to the background test server, wherein the test task execution request carries: information of a test case packet to be executed;
the background test server is used for responding to the received test task execution request and acquiring a test case packet to be executed by the test task;
the background test server is also used for determining an object to be tested corresponding to the test task by analyzing the test case packet;
the background testing server is also used for analyzing the annotations of the objects to be tested and determining a testing frame matched with the testing task and a testing case of each object to be tested;
the background testing server is further configured to execute the test case of each object to be tested according to the testing framework to complete the testing task.
In a fourth aspect, an embodiment of the present application further discloses an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the multi-frame compatible testing method according to the embodiment of the present application when executing the computer program.
In a fifth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor, and the program includes steps of the multi-frame compatible testing method disclosed in the present application.
According to the test method compatible with the multiple frames, a test case packet corresponding to a test task is obtained by responding to the trigger of the test task; determining an object to be tested corresponding to the test task by analyzing the test case packet; analyzing the annotations of the objects to be tested, and determining a testing frame matched with the testing task and a testing case of each object to be tested; and executing the test case of each object to be tested according to the test framework to complete the test task, thereby being beneficial to improving the test efficiency.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
In order to make the objects, 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 is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is a flowchart of a testing method for multi-frame compatibility according to a first embodiment of the present application;
FIG. 2 is a structural diagram of a multi-frame compliant test platform according to an embodiment;
FIG. 3 is another flowchart of a testing method for multi-frame compatibility according to a first embodiment of the present application;
FIG. 4 is a schematic structural diagram of a multi-frame compatible testing apparatus according to a second embodiment of the present application;
FIG. 5 is a second schematic structural diagram of a multi-frame compatible testing apparatus according to a second embodiment of the present application;
FIG. 6 schematically shows a block diagram of an electronic device for performing a method according to the present application; and
fig. 7 schematically shows a storage unit for holding or carrying program code implementing a method according to the present application.
Detailed Description
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 is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
Example one
As shown in fig. 1, the method for testing compatibility of multiple frames disclosed in the embodiment of the present application includes: step 110 to step 140.
And step 110, responding to the triggering of the test task, and acquiring a test case packet corresponding to the test task.
In some embodiments of the application, the test cases need to be packaged according to a preset rule and uploaded to the test platform, and then the test platform executes the test cases in the test case package.
In the prior art, a test case developer usually performs test case development through a project management tool, and packages the test case through a packaging function or an export function provided by the project management tool.
In some embodiments of the present application, the test case package is packaged by a preset Maven plugin. For example, the Maven plug-in compiles a file of a project to be packaged by running a preset Maven script, and creates a JAR file corresponding to the project.
In some embodiments of the application, the test case package needs to be uploaded to the test platform first, and then the user selects the test case package through the test platform and triggers a test task corresponding to the test case package.
In some embodiments of the present application, a user may trigger a test task through a client page of a test platform.
In the following, the operation process of the test task is described by taking the example that the multi-frame compatible test method is operated in the test platform as shown in fig. 2.
As shown in fig. 2, the test platform includes: client 210, background testing server 220, and data management server 230. The functions and embodiments of the various components of the platform were tested separately below.
The data management server 230 is configured to store the test case package and the test result. The test case package may be uploaded to the data management server 230 after a preset Maven plugin packs a file in a test case project, or uploaded to the data management server 230 by a user through the client 210.
In some embodiments of the present application, the data management server 230 may be one physical device or multiple physical devices. In the case where the data management server 230 is a plurality of physical devices, different kinds of data may be stored in different physical devices.
In some embodiments of the present application, as shown in fig. 2, the test platform further comprises: the user management system 240 is configured to manage user information (such as a user name, an account identifier, an account password, and the like) of the user registered on the test platform, and manage information such as test tasks uploaded by the users, and storage addresses of test case packages corresponding to the test tasks. After the user logs in the test platform through the client 210, the client 210 obtains the test task uploaded by the user through the user management system 240, and displays the test task to the user through the interactive interface of the client 210, so that the user can conveniently select the test task to be executed currently.
In some embodiments of the present application, a user may trigger a test task through the client 210.
The client 210 is configured to display a test case packet matched with a current user, and send a test task execution request to the background test server in response to a test task of the test case packet selected by the user being triggered, where the test task execution request carries: information of the test case package to be executed. For example, a list of selectable test case packages may be displayed on the interactive interface of the client, so that the user can select a test case package to be currently executed, and set a start test key, so that the user can trigger a test task to be executed on the selected test case package. After detecting that a user selects a certain test case package and submits a test task execution request of the test case package, the client acquires information (such as a name or a system identifier of the test case package) of the test case package selected by the user, generates a test task execution request according to the information of the test case package, then sends the generated test task execution request to the background test server 220, and the background test server 220 executes the test task.
In some embodiments of the present application, the client 210 may be a web page or an application. The specific implementation form of the client is not limited in the application.
After receiving the test task execution request, the background test server 220 confirms that the test task is triggered, and further executes a test task matching the test task execution request.
In some embodiments of the present application, the executing, by the background testing server 220, the testing task matched with the testing task execution request further includes:
the background test server 220 is configured to, in response to receiving the test task execution request, obtain a test case packet to be executed by the test task. For example, in response to receiving the test task execution request, the background test server 220 starts a process for executing the test task corresponding to the test task execution request.
In some embodiments of the present application, a task identifier is assigned to each test task in the test platform. The task mark identification is in one-to-one correspondence with the task, and is used for the user to select to finish the test task.
Then, the background test server 220 obtains the test case packet with the matched information through the data management server 230 according to the information of the test case packet carried in the test task execution request through the process.
In some embodiments of the present application, a task identifier is assigned to each test task in the test platform.
In some embodiments of the present application, as shown in fig. 3, before the responding to the triggering of the test task and acquiring the test case package corresponding to the test task, the method further includes: step 100 and step 101.
And step 100, obtaining and displaying the information of the test case packet uploaded by the current login user.
Step 101, responding to a test case package selection operation executed by a user through a test configuration interface, and determining information of a test case package selected by the user.
Wherein, the information of the test case packet comprises: test case package name, estimated running time and other information.
In some embodiments of the present application, the client 210 is further configured to obtain and display information of a test case package uploaded by a current login user.
For example, after the user logs in, the client 210 displays a test task configuration interface to the user, and displays a test case package list uploaded by the currently logged-in user to the user on the test task configuration interface. The client 210 obtains the test case packet uploaded by the user through the user management system 240, and displays information such as the name of the test case packet, the expected execution duration and the like to the user through a test configuration interface of the client 210.
The user can select the test case package through the test configuration interface. The client detects that a user selects a test case package through a test configuration interface, and further obtains the name of the test case package after a certain test case package is selected.
In some embodiments of the present application, the test task configuration interface is further configured to display pre-test parameters of the test task, such as information of a test environment and a test description.
In some embodiments of the present application, the data management server 230 is further configured to store test parameter information of the test task.
And 120, determining the object to be tested corresponding to the test task by analyzing the test case packet.
In some embodiments of the present application, the determining, by analyzing the test case package, an object to be tested corresponding to the test task includes: analyzing the test case package to obtain objects included in the test case package and codes of the objects; traversing the code of the object, and determining the object indicated by the value as the object to be tested corresponding to the test task according to the value of the preset second annotation marked in the code. Wherein the value of the preset second annotation is used for indicating whether the corresponding object needs to be executed.
The objects described in the embodiments of the present application include: classes and methods. The test case package comprises: the test case code comprises a plurality of class codes, code of one or more methods further included under each class, and one or more test case codes of each class. All the packed classes and methods and the codes of the test cases can be obtained by analyzing the test case package.
In some embodiments of the present application, a test platform defines in advance an annotation for marking whether an object in a test case executes, and provides the annotation to a user, and in a process of loading an object (such as a class or a method) by the platform, a value of the annotation is parsed to determine whether the corresponding object executes. In the process of writing the test case, a user marks annotation on each object, and configures whether the object needs to be executed or not by setting different values for the annotation. Furthermore, in the test case execution process, the object marked with the preset second annotation in the code is determined by traversing the code, and the value of the preset second annotation indicates the object to be executed, and the object is used as the object to be tested corresponding to the test task.
In some embodiments of the present application, during the class loading process, the information (e.g., annotation) on the class is analyzed through a reflection mechanism, so as to determine whether to load the class.
For example, with the test platform shown in fig. 2, the background test server 220 is further configured to determine the object to be tested corresponding to the test task by analyzing the test case package.
Further, the background test server 220 is configured to analyze the test case package, and obtain objects included in the test case package and codes of the objects; traversing the code of the object, and determining the object indicated by the value as the object to be tested corresponding to the test task according to the value of the preset second annotation marked in the code. Wherein the value of the preset second annotation is used for indicating whether the corresponding object needs to be executed. For example, the background test server 220 analyzes the test case packet to obtain a class included in the test case packet; and then, further analyzing a preset second annotation value of the class marked with the preset second annotation, and selecting the class which needs to be executed and indicated by the preset second annotation value as a class to be tested.
And step 130, analyzing the annotations of the objects to be tested, and determining a test frame matched with the test task and a test case of each object to be tested.
In some embodiments of the present application, by introducing a label mechanism, a user sets a specific label for a specific class or method when writing a test case class, so as to specify execution information such as a test framework of the corresponding class.
In the prior art, the frameworks such as Hibernate and Spring are widely used as annotations. The annotations are embedded into the program as metadata of the program. The annotations may be parsed by a parsing tool or a compiling tool. In some embodiments of the present application, information such as an execution mode (i.e., a test framework) of a test class may be specified by setting an annotation to the test class when writing a test case.
In some embodiments of the present application, the parsing the annotations of the objects to be tested and determining the test frame matched with the test task and the test case of each object to be tested includes: analyzing the annotation of the object to be tested, and acquiring a value of the annotation used for indicating the type of the testing frame; and determining a test frame adopted for executing the test case of the object to be tested according to the value. The annotation types of different test frames during test case writing are different, and the specific test frame to which the object to be tested belongs can be dynamically judged according to the annotation type of the object to be tested, so that the test frame to be used for execution is determined. For example: the user a uses the junction frame, so that the annotation on the test case is inevitably "org.
Specifically, for the test platform shown in fig. 2, the background test server 220 is further configured to parse the annotation of the object to be tested, and determine the test frame matched with the test task and the test case of each object to be tested. In some embodiments of the present application, the annotation is an annotation marked for a corresponding class according to a preset rule when a user designs a test case.
Step 140, executing the test case of each object to be tested according to the test framework to complete the test task.
After the test frame matched with the current test task and the test case to be executed are determined, the specified execution test case of each object to be tested can be executed according to the execution mode matched with the test frame so as to complete the test task.
Specifically, for the test platform shown in fig. 2, the background test server 220 executes the test case of each object to be tested according to the test framework to complete the test task.
The specific implementation of executing the test case of each class or method to be tested according to the test framework is the prior art, and is not described in detail in this embodiment.
In some embodiments of the application, the executing the test case of each of the objects to be tested according to the test framework includes: in the process of executing the test case of each object to be tested, obtaining an execution result of the test case of each object to be tested according to the test framework, wherein the execution result includes one or more of the following items: data execution result, error stack and test case execution log. For example, in a project for executing a determined test case according to a selected execution mode, the execution result of the executed test case is collected by the test framework. Wherein, the execution result of the test case includes but is not limited to one or more of the following: outputting a data execution result after executing the corresponding test case code based on the given test data; when the test case is executed with errors, stack information is erroneous; and executing the log information such as the execution mode, time and the like of the test case.
The specific implementation of collecting the test case execution result under the specified test framework is the prior art, and is not described herein again.
In some embodiments of the present application, as shown in fig. 3, after executing the test case in each of the objects to be tested according to the test framework, the method further includes: and 150.
150, displaying the execution result of the test case of each object to be tested
In some embodiments of the application, after the test case is executed, a user can visually see description of the executed test case, error stack information, a complete test case execution log and the like on a client page.
As shown in fig. 2, the test platform further includes: a test result collection system 250. In the process that the background test server 220 executes the test cases of the objects to be tested according to the test framework, the test result collection system 250 collects the execution results of the test cases in real time and stores the execution results in sequence. The client 210 may obtain the execution result of the test case stored in the test result collection system 250 in real time, or may check the execution result of the historical test case after the test task is executed.
According to the test method compatible with the multiple frames, a test case packet corresponding to a test task is obtained by responding to the trigger of the test task; determining an object to be tested corresponding to the test task by analyzing the test case packet; analyzing the annotations of the objects to be tested, and determining a testing frame matched with the testing task and a testing case of each object to be tested; and executing the test case of each object to be tested according to the test framework to complete the test task, thereby being beneficial to improving the test efficiency.
According to the test method compatible with the multiple frames, the classes or the methods to be executed are marked in the test cases in the annotation form, and the test frames are configured in the annotation form, so that the test case package can be executed on the test platform according to the test requirements of users, the test case migration cost is low, and the test efficiency is high. In addition, the execution environment of the test case is not required to be locally deployed by the user, so that the test cost of the user is reduced. On the other hand, the test configuration data can be set through a client interactive interface of the test platform and does not need to be written in the test case codes, so that the test case codes and the test data are loosely coupled, and the stability of the test engineering is improved.
Furthermore, the testing method disclosed in the embodiment of the application can realize the white screen configuration of the testing project through the client of the testing platform, and supports the white screen output of the testing result, so that the testing efficiency can be further improved.
Example two
As shown in fig. 4, the device compatible with multiple frames disclosed in the embodiment of the present application includes:
a test case packet obtaining module 410, configured to, in response to a test task being triggered, obtain a test case packet corresponding to the test task;
the to-be-tested object determining module 420 is configured to determine the to-be-tested object corresponding to the test task by analyzing the test case package;
the test case determining module 430 is configured to parse the annotations of the objects to be tested, and determine a test frame matched with the test task and a test case of each object to be tested;
the test case executing module 440 is configured to execute the test case of each object to be tested according to the test framework to complete the test task.
In some embodiments of the present application, the test case execution module 440 is further configured to:
in the process of executing the test case of each object to be tested, obtaining an execution result of the test case of each object to be tested according to the test framework, wherein the execution result includes one or more of the following items: data execution result, error stack and test case execution log;
as shown in fig. 5, the apparatus further includes:
the test case execution result display module 450 is configured to display an execution result of the test case of each object to be tested.
In some embodiments of the present application, the test case package is packaged by a preset Maven plugin.
In some embodiments of the present application, the object to be tested determination module 420 is further configured to:
analyzing the test case package to obtain objects included in the test case package and codes of the objects;
traversing the code of the object, and determining the object indicated by the value as the object to be tested corresponding to the test task according to the value of the preset second annotation marked in the code.
In some embodiments of the present application, the test case determining module 430 is further configured to:
analyzing the annotation of the object to be tested, and acquiring a value of the annotation used for indicating the type of the testing frame;
and determining a test frame adopted for executing the test case of the object to be tested according to the value.
In some embodiments of the application, as shown in fig. 5, before the responding to the triggering of the test task and acquiring the test case package corresponding to the test task, the apparatus further includes:
the test case package display module 400 is used for acquiring and displaying the information of the test case package uploaded by the current login user;
the test case package information determining module 401 is configured to determine, in response to a test case package selection operation performed by a user through a test configuration interface, information of a test case package selected by the user.
The multi-frame compatible testing device disclosed in the embodiment of the present application is used to implement the multi-frame compatible testing method described in the first embodiment of the present application, and specific implementation manners of each module of the device are not described again, and reference may be made to specific implementation manners of corresponding steps in the method embodiment.
The testing device compatible with the multi-frame, disclosed by the embodiment of the application, responds to the triggering of a testing task, and obtains a testing case packet corresponding to the testing task; determining an object to be tested corresponding to the test task by analyzing the test case packet; analyzing the annotations of the objects to be tested, and determining a testing frame matched with the testing task and a testing case of each object to be tested; and executing the test case of each object to be tested according to the test framework to complete the test task, thereby being beneficial to improving the test efficiency.
According to the test device compatible with the multiple frames, the classes or the methods to be executed are marked in the test cases in the annotation form, and the test frames are configured in the annotation form, so that the test case package can be executed on the test platform according to the test requirements of users, the test case migration cost is low, and the test efficiency is high. In addition, the execution environment of the test case is not required to be locally deployed by the user, so that the test cost of the user is reduced. On the other hand, the test configuration data can be set through a client interactive interface of the test platform and does not need to be written in the test case codes, so that the test case codes and the test data are loosely coupled, and the stability of the test engineering is improved.
Furthermore, the testing device disclosed in the embodiment of the application can realize the white screen configuration of the testing project through the client of the testing platform, and support the white screen output of the testing result, so that the testing efficiency can be further improved.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The foregoing describes in detail a multi-frame compatible testing method and apparatus provided in the present application, and specific examples are applied herein to explain the principles and embodiments of the present application, and the descriptions of the foregoing examples are only used to help understand the method and a core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
The above-described embodiments of the apparatus are merely illustrative, and 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The various component embodiments of the present application may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in an electronic device according to embodiments of the present application. The present application may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present application may be stored on a computer readable medium or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 6 illustrates an electronic device that may implement a method according to the present application. The electronic device can be a PC, a mobile terminal, a personal digital assistant, a tablet computer and the like. The electronic device conventionally comprises a processor 610 and a memory 620 and program code 630 stored on said memory 620 and executable on the processor 610, said processor 610 implementing the method described in the above embodiments when executing said program code 630. The memory 620 may be a computer program product or a computer readable medium. The memory 620 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 620 has a storage space 6201 for program code 630 of a computer program for performing any of the method steps described above. For example, the storage space 6201 for the program code 630 may include respective computer programs for implementing the various steps in the above method, respectively. The program code 630 is computer readable code. The computer programs may be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. The computer program comprises computer readable code which, when run on an electronic device, causes the electronic device to perform the method according to the above embodiments.
The embodiment of the present application further discloses a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the multi-frame compatible testing method according to the first embodiment of the present application.
Such a computer program product may be a computer-readable storage medium that may have memory segments, memory spaces, etc. arranged similarly to the memory 620 in the electronic device shown in fig. 6. The program code may be stored in a computer readable storage medium, for example, compressed in a suitable form. The computer readable storage medium is typically a portable or fixed storage unit as described with reference to fig. 7. Typically, the storage unit comprises computer readable code 630 ', said computer readable code 630' being code read by a processor, which when executed by the processor implements the steps of the method described above.
Reference herein to "one embodiment," "an embodiment," or "one or more embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Moreover, it is noted that instances of the word "in one embodiment" are not necessarily all referring to the same embodiment.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The application may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A testing method compatible with multiple frames is characterized by comprising the following steps:
responding to the triggering of a test task, and acquiring a test case packet corresponding to the test task;
determining an object to be tested corresponding to the test task by analyzing the test case packet;
analyzing the annotations of the objects to be tested, and determining a testing frame matched with the testing task and a testing case of each object to be tested;
and executing the test case of each object to be tested according to the test framework to complete the test task.
2. The method of claim 1, wherein the step of executing the test case of each of the objects under test according to the test framework comprises:
in the process of executing the test case of each object to be tested, obtaining an execution result of the test case of each object to be tested according to the test framework, wherein the execution result comprises one or more of the following items: data execution result, error stack and test case execution log;
after the step of executing the test case of each object to be tested according to the test framework, the method further comprises the following steps:
and displaying the execution result of the test case of each object to be tested.
3. The method of claim 1, wherein the test case package is packaged by a default Maven plugin.
4. The method according to any one of claims 1 to 3, wherein the step of determining the object to be tested corresponding to the test task by parsing the test case package comprises:
analyzing the test case package to obtain objects included in the test case package and codes of the objects;
traversing the code of the object, and determining the object indicated by the value as the object to be tested corresponding to the test task according to the value of the preset second annotation marked in the code.
5. The method according to any one of claims 1 to 3, wherein the step of parsing the annotation of the object to be tested and determining the test frame matched with the test task and the test case of each object to be tested comprises:
analyzing the annotation of the object to be tested, and acquiring a value of the annotation used for indicating the type of the testing frame;
and determining a test frame adopted for executing the test case of the object to be tested according to the value.
6. The method according to any one of claims 1 to 3, wherein the step of obtaining the test case package corresponding to the test task in response to the test task being triggered is preceded by:
acquiring and displaying information of a test case packet uploaded by a current login user;
and responding to the test case packet selection operation executed by the user through the test configuration interface, and determining the information of the test case packet selected by the user.
7. A multi-frame compatible test system, comprising: a client, a background test server, and a data management server, wherein,
the data management server is used for storing the test case packet;
the client is used for displaying the test case packet matched with the current user, responding to the triggering of the test task of the test case packet selected by the user, and sending a test task execution request to the background test server, wherein the test task execution request carries: information of a test case package to be executed;
the background test server is used for responding to the received test task execution request and acquiring a test case packet to be executed by the test task;
the background test server is also used for determining an object to be tested corresponding to the test task by analyzing the test case packet;
the background testing server is also used for analyzing the annotations of the objects to be tested and determining a testing frame matched with the testing task and a testing case of each object to be tested;
the background testing server is further configured to execute the test case of each object to be tested according to the testing framework to complete the testing task.
8. A multi-frame compatible testing device, comprising:
the test case packet acquisition module is used for responding to the triggering of a test task and acquiring a test case packet corresponding to the test task;
the to-be-tested object determining module is used for determining the to-be-tested object corresponding to the test task by analyzing the test case packet;
the test case determining module is used for analyzing the annotations of the objects to be tested and determining a test frame matched with the test task and a test case of each object to be tested;
and the test case execution module is used for executing the test cases of the objects to be tested according to the test framework so as to complete the test task.
9. An electronic device comprising a memory, a processor, and program code stored on the memory and executable on the processor, wherein the processor implements the multi-frame compatible testing method of any one of claims 1 to 6 when executing the program code.
10. A computer-readable storage medium having stored thereon program code, characterized in that the program code realizes the steps of the multi-frame compatible testing method of any one of claims 1 to 6 when executed by a processor.
CN202210437392.2A 2022-04-21 2022-04-21 Multi-frame compatible test method and device and electronic equipment Pending CN114996121A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210437392.2A CN114996121A (en) 2022-04-21 2022-04-21 Multi-frame compatible test method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210437392.2A CN114996121A (en) 2022-04-21 2022-04-21 Multi-frame compatible test method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114996121A true CN114996121A (en) 2022-09-02

Family

ID=83024654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210437392.2A Pending CN114996121A (en) 2022-04-21 2022-04-21 Multi-frame compatible test method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114996121A (en)

Similar Documents

Publication Publication Date Title
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
CN109302522B (en) Test method, test device, computer system, and computer medium
CN108595329B (en) Application testing method and device and computer storage medium
CN111045952B (en) Software testing method, flow playback device, terminal equipment and readable storage medium
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN103049371A (en) Testing method and testing device of Android application programs
CN111459495B (en) Unit test code file generation method, electronic device and storage medium
CN103377127A (en) Development testing system, testing method and device for webpage product
CN107133165B (en) Browser compatibility detection method and device
CN113778898B (en) User interface automatic test method and device, electronic equipment and storage medium
CN110647471A (en) Interface test case generation method, electronic device and storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN114546738B (en) Universal test method, system, terminal and storage medium for server
CN112817866A (en) Recording playback method, device, system, computer equipment and storage medium
CN113377667A (en) Scene-based testing method and device, computer equipment and storage medium
CN112115051A (en) Page traversal detection method, device and equipment for application and readable storage medium
CN112650670A (en) Application testing method, device, system, electronic equipment and storage medium
CN115658529A (en) Automatic testing method for user page and related equipment
CN111190791A (en) Application exception reporting method and device and electronic equipment
CN112269697B (en) Equipment storage performance testing method, system and related device
CN112583663B (en) Automatic network performance testing method based on domestic operating system
CN115514677B (en) Method and system for server dial testing
CN107797927B (en) Application automation test method, device, equipment and readable storage medium
CN114996121A (en) Multi-frame compatible test method and device and electronic equipment
CN115934503A (en) Program testing method, device, 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