Test method, device, system and storage medium

By creating listening process and callback components in the automated test framework, listening and calling back the completion status and results of test cases, the problem of waiting for all use cases to complete in the existing technology to obtain the results of a single use case is solved, and the function of quickly obtaining test results is realized.

CN113326195BActive Publication Date: 2025-03-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110650734.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-10
Publication Date
2025-03-21
Estimated Expiration
2041-06-10

AI Technical Summary

Technical Problem

In the automation framework project, you need to wait until all test cases are executed before you can get the test results of a single test case, resulting in a long cumulative time.

Method used

By creating a listening process and callback component, listen to whether the currently executed test case is completed, and test the result information through the callback component after the test case is completed.

Benefits of technology

It realizes that the test results of a single use case can be obtained after the execution of the use case is reduced, and the test efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113326195B_ABST
    Figure CN113326195B_ABST
Patent Text Reader

Abstract

The present disclosure provides a testing method, which is applied to the field of testing technology, including: creating a monitoring process and a callback component, wherein the monitoring process is used to monitor whether the test case currently being executed has been completed, and the callback component is used to call back the test result information of the test case, and through the monitoring process, monitor whether the test case currently being executed has been completed, and when the test case is completed, the test result information of the test case is called back through the callback component. The present disclosure also provides a testing device, a system, and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of testing technology, and more specifically, to a testing method, device, system and storage medium. Background Art

[0002] In the practice of automation framework projects, executing a test case, that is, completing a Cypress test, may be very fast, but a project may contain multiple test cases, and the cumulative time of multiple Cypress tests is longer. In the prior art, it is necessary to wait until all test cases of the project are executed before obtaining the test results of a single test case. Summary of the invention

[0003] In view of this, the present disclosure provides a testing method, device, system and storage medium that can obtain the test result of a single use case after the single use case is executed.

[0004] One aspect of the present disclosure provides a testing method applied to an automated testing framework, the method comprising:

[0005] Create a monitoring process and a callback component, wherein the monitoring process is used to monitor whether the currently executed test case has been tested, and the callback component is used to call back the test result information of the test case;

[0006] Through the monitoring process, monitoring whether the currently executed test case is completed;

[0007] When the test case is tested, the test result information of the test case is called back through the callback component.

[0008] In one embodiment of the present disclosure, the callback component is further used to send the test result information to a test platform, and the method further includes:

[0009] The test result information of the test case is uploaded to the test platform through the callback component.

[0010] In one embodiment of the present disclosure, creating a monitoring process includes:

[0011] Use the native node.service to create the listening process.

[0012] In one embodiment of the present disclosure, creating a callback component includes:

[0013] Create a beforeeach() function and an aftereach() function, wherein the beforeeach() function is used to capture the next test case to be executed, and the aftereach() function is used to call back the test result information of the test case after the next test case to be executed is executed.

[0014] In one embodiment of the present disclosure, calling back the test result information of the test case through the callback component includes:

[0015] Capture the next test case to be executed through the beforeeach() function;

[0016] After the next test case to be executed is executed, the test result information of the test case is called back through the aftereach() function.

[0017] In one of the embodiments of the present disclosure, the callback component runs in a node of the automated testing framework.

[0018] In one of the embodiments of the present disclosure, whenever a test case is completed, the test result information of the test case is sent to the callback component through the cy.task command.

[0019] In one of the embodiments of the present disclosure, the test result information of the test case is transmitted to the callback component through the WebSockets mechanism built into the automated testing framework.

[0020] In one of the embodiments of the present disclosure, the automated testing framework is a Cypress testing framework.

[0021] Another aspect of the present disclosure provides a testing device including a creation module, a monitoring module, and a callback module.

[0022] The creation module is used to create a monitoring process and a callback component. The monitoring process is used to monitor whether the currently executed test case has been completed, and the callback component is used to call back the test result information of the test case.

[0023] The monitoring module is used to monitor whether the currently executed test case has been completed through the monitoring process.

[0024] The callback module is used to call back the test result information of the test case through the callback component after the test case is completed.

[0025] In one embodiment of the present disclosure, the callback component is further used to send the test result information to the test platform, and the device further includes:

[0026] The upload module is used to upload the test result information of the test case to the test platform through the callback component.

[0027] In one embodiment of the present disclosure, the creation module is specifically used to create the listening process using the native node. service.

[0028] In one of the embodiments of the present disclosure, the creation module is specifically used to create a beforeeach() function and an aftereach() function, the beforeeach() function is used to capture the next test case to be executed, and the aftereach() function is used to call back the test result information of the test case after the next test case to be executed is executed.

[0029] In one embodiment of the present disclosure, the callback module includes:

[0030] The capture submodule is used to capture the next test case to be executed through the beforeeach() function;

[0031] The callback submodule is used to call back the test result information of the test case after the next test case to be executed is executed through the aftereach() function.

[0032] In one of the embodiments of the present disclosure, the callback component runs in a node of the automated testing framework.

[0033] In one of the embodiments of the present disclosure, whenever a test case is completed, the test result information of the test case is sent to the callback component through the cy.task command.

[0034] In one of the embodiments of the present disclosure, the test result information of the test case is transmitted to the callback component through the WebSockets mechanism built into the automated testing framework.

[0035] In one of the embodiments of the present disclosure, the automated testing framework is a Cypress testing framework.

[0036] Another aspect of the present disclosure provides a computer system, comprising:

[0037] one or more processors;

[0038] a memory for storing one or more programs,

[0039] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0040] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0041] Another aspect of the present disclosure provides a computer program, which includes computer executable instructions, and the instructions are used to implement the method described above when executed.

[0042] According to an embodiment of the present disclosure, a monitoring process and a callback component are created. The monitoring process is used to monitor whether the test case currently being executed has been completed. The callback component is used to call back the test result information of the test case. Through the monitoring process, it is monitored whether the test case currently being executed has been completed. When the test case is completed, the test result information of the test case is called back through the callback component. After each test case is executed, the test result information of the test case can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0044] Figure 1 An exemplary system architecture to which the testing method according to an embodiment of the present disclosure can be applied is schematically shown;

[0045] Figure 2 A flow chart schematically shows a testing method according to an embodiment of the present disclosure;

[0046] Figure 3 A flow chart schematically shows a testing method according to an embodiment of the present disclosure;

[0047] Figure 4 A block diagram schematically shows a test device according to an embodiment of the present disclosure; and

[0048] Figure 5 The block diagram of a computer system according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0049] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0050] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0051] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0052] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0053] An embodiment of the present disclosure provides a testing method, including creating a listening process and a callback component, wherein the listening process is used to listen to whether the test case currently being executed has been completed, and the callback component is used to call back the test result information of the test case. Through the listening process, it is listened to whether the test case currently being executed has been completed. When the test case is completed, the test result information of the test case is called back through the callback component.

[0054] Figure 1 The exemplary system architecture 100 to which the test method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0055] like Figure 1As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0056] The user can use the terminal device 101 to interact with the server 103 and the server 104 through the network 104 to receive or send messages, etc. Various client applications can be installed on the terminal device 101, such as a web browser application, a search application, and an instant messaging tool (only as an example).

[0057] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, etc. The server 105 may be a server providing various services, such as a background management server providing support for test cases executed by a user using the terminal device 101 (only as an example).

[0058] It should be noted that the test method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the test device provided in the embodiment of the present disclosure can generally be set in the server 105. The test method provided in the embodiment of the present disclosure can also be performed by a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Accordingly, the test device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Alternatively, the test method provided in the embodiment of the present disclosure can also be performed by the terminal device 101, 102, or 103, or it can also be performed by other terminal devices different from the terminal device 101, 102, or 103. Accordingly, the test device provided in the embodiment of the present disclosure can also be set in the terminal device 101, 102, or 103, or it can be set in other terminal devices different from the terminal device 101, 102, or 103.

[0059] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0060] Figure 2 The flowchart of the testing method according to the embodiment of the present disclosure is schematically shown.

[0061] like Figure 2As shown, the method is applied to an automated testing framework, and the method includes operations S201 to S203.

[0062] In operation S201, a monitoring process and a callback component are created. The monitoring process is used to monitor whether the currently executed test case is completed, and the callback component is used to call back the test result information of the test case.

[0063] In operation S202, the monitoring process is used to monitor whether the test case currently being executed is completed.

[0064] In operation S203, after the test case is tested, the test result information of the test case is called back through the callback component.

[0065] A component is a simple encapsulation of data and methods. A component can have its own properties and methods. Properties are simple accessors to component data, and methods are some simple and visible functions of a component.

[0066] A process is a running activity of a program in a computer on a certain data set. It is the basic unit for resource allocation and scheduling in the system and the foundation of the operating system structure. In the early computer structure designed for processes, processes are the basic execution entities of programs; in the contemporary computer structure designed for threads, processes are the containers of threads. A program is a description of instructions, data and their organizational forms, and a process is the entity of a program.

[0067] A test case is a description of a test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special goal, used to verify whether a specific software requirement is met.

[0068] In this disclosure, the automated testing framework takes the Cypress testing framework as an example. The Cypress testing framework is a new generation of end-to-end automated testing framework, which can set up tests, write tests, execute tests, and debug tests. The Cypress testing framework allows writing all types of tests: end-to-end tests, integration tests, unit tests, and the Cypress testing framework can test anything that runs in a browser.

[0069] In the embodiment of the present disclosure, the callback component is generally located in cypress / plugins / index.js, and can also be configured in another directory. The present disclosure does not limit this. In the present disclosure, the callback component is located in cypress / plugins / index.js as an example. Before each test case is run, the Cypress test framework automatically loads the callback component cypress / plugins / index.js.

[0070] In the disclosed embodiment, the monitoring process is run using node on the host. The tester executes multiple test cases from the browser and accesses the tested browser. At this time, the test program is executed, and cypress run will execute the test from the index.js Node script. At the same time, the monitoring process is used to monitor whether the currently executed test case has been completed.

[0071] In the embodiment of the present disclosure, if the test of the currently executed test case is completed, the monitoring process can send a notification message of the completion of the test of the currently executed test case to the callback component. After receiving the notification message of the completion of the test of the currently executed test case, the callback component calls back the test result information of the test case.

[0072] According to the embodiment of the present disclosure, a monitoring process and a callback component are created. The monitoring process is used to monitor whether the test case currently being executed has been completed. The callback component is used to call back the test result information of the test case. Through the monitoring process, it is monitored whether the test case currently being executed has been completed. When the test case is completed, the test result information of the test case is called back through the callback component. After each test case is executed, the test result information of the test case can be obtained.

[0073] Figure 3 The flowchart of the testing method according to the embodiment of the present disclosure is schematically shown.

[0074] like Figure 3 As shown, the method is applied to the Cypress test framework, and the method includes operations S301 to S304.

[0075] In operation S301, a monitoring process and a callback component are created. The monitoring process is used to monitor whether the currently executed test case has been tested. The callback component is used to call back the test result information of the test case and send the test result information to the test platform.

[0076] In operation S302, the monitoring process is used to monitor whether the test case currently being executed is completed.

[0077] In operation S303, after the test case is tested, the test result information of the test case is called back through the callback component.

[0078] In operation S304, the test result information of the test case is uploaded to the test platform through the callback component.

[0079] In the disclosed embodiment, after obtaining the test result information of the currently executed test case, the callback component can also forward the test result information to the test platform, so that after each test case is executed, the user can see the test result information of the test case through the test platform.

[0080] In the disclosed embodiment, after the test result information of the test case is sent to the callback component, a synchronous or asynchronous code can be executed to send the test result information to the external system in real time. For sending to the test platform, a request function can be written to use axios to achieve real-time upload to the test platform.

[0081] In one embodiment of the present disclosure, creating a listening process includes using a native node.service to create a listening process. Creating a callback component includes creating a beforeeach() function and an aftereach() function, wherein the beforeeach() function is used to capture the next test case to be executed, and the aftereach() function is used to call back the test result information of the test case after the next test case to be executed is executed.

[0082] In the disclosed embodiment, the beforeeach() function is executed before the test case is executed, and the aftereach() function is executed after the test case is executed.

[0083] In one of the embodiments of the present disclosure, through the callback component, calling back the test result information of the test case includes: capturing the next test case to be executed through the beforeeach() function; and calling back the test result information of the test case after the next test case to be executed is executed through the aftereach() function.

[0084] In one embodiment of the present disclosure, the callback component runs in the node of the automated test framework. In addition, the callback component runs under the Cypress test framework and can use the IPCemit command to relay the message received from the browser to the test process.

[0085] In one embodiment of the present disclosure, whenever a test case is completed, the test result information of the test case is sent to the callback component through the cy.task command.

[0086] In the disclosed embodiment, the test result information includes information such as test status, test title, test duration, etc. Test status, such as success or failure, and test title, such as logging into the merchant backend.

[0087] In one of the embodiments of the present disclosure, the test result information of the test case is transmitted to the callback component through the WebSockets mechanism built into the cypress test framework.

[0088] In the disclosed embodiments, the WebSockets mechanism is a protocol for full-duplex communication over a single TCP connection. WebSockets makes data exchange between the client and the server much simpler, allowing the server to actively push data to the client. In the WebSocket API, the browser and the server only need to complete a handshake once, and a persistent connection can be directly established between the two, and two-way data transmission can be performed.

[0089] Figure 4 The block diagram of a testing device according to an embodiment of the present disclosure is schematically shown.

[0090] like Figure 4 As shown, the testing device 400 includes a creation module 410 , a monitoring module 420 , and a callback module 430 .

[0091] The creation module 410 is used to create a monitoring process and a callback component. The monitoring process is used to monitor whether the currently executed test case has been completed, and the callback component is used to call back the test result information of the test case.

[0092] The monitoring module 420 is used to monitor whether the currently executed test case has been completed through the monitoring process.

[0093] The callback module 430 is used to call back the test result information of the test case through the callback component after the test of the test case is completed.

[0094] According to the embodiment of the present disclosure, the creation module creates a listening process and a callback component, the listening process is used to listen to whether the test case currently being executed is completed, and the callback component is used to call back the test result information of the test case. The listening module listens to whether the test case currently being executed is completed through the listening process, and the callback module calls back the test result information of the test case through the callback component after the test case is completed. After each test case is executed, the test result information of the test case can be obtained.

[0095] In one embodiment of the present disclosure, the callback component is further used to send the test result information to the test platform, and the device further includes:

[0096] The upload module is used to upload the test result information of the test case to the test platform through the callback component, so that after each test case is executed, the user can see the test result information of the test case through the test platform.

[0097] In one embodiment of the present disclosure, the creation module 410 is specifically used to create the listening process using the native node. service.

[0098] In one of the embodiments of the present disclosure, the creation module 410 is specifically used to create a beforeeach() function and an aftereach() function, the beforeeach() function is used to capture the next test case to be executed, and the aftereach() function is used to call back the test result information of the test case after the next test case to be executed is executed.

[0099] In one embodiment of the present disclosure, the callback module 430 includes:

[0100] The capture submodule is used to capture the next test case to be executed through the beforeeach() function;

[0101] The callback submodule is used to call back the test result information of the test case after the next test case to be executed is executed through the aftereach() function.

[0102] In one of the embodiments of the present disclosure, the callback component runs in a node of the automated testing framework.

[0103] In one of the embodiments of the present disclosure, whenever a test case is completed, the test result information of the test case is sent to the callback component through the cy.task command.

[0104] In one of the embodiments of the present disclosure, the test result information of the test case is transmitted to the callback component through the WebSockets mechanism built into the automated testing framework.

[0105] In one of the embodiments of the present disclosure, the automated testing framework is a Cypress testing framework.

[0106] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0107] For example, any multiple of the creation module 410, the monitoring module 420, and the callback module 430 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more modules / units / sub-units in these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the creation module 410, the monitoring module 420, and the callback module 430 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in a suitable combination of any of them. Alternatively, at least one of the creation module 410 , the monitoring module 420 , and the callback module 430 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.

[0108] It should be noted that the test device part in the embodiments of the present disclosure corresponds to the test method part in the embodiments of the present disclosure. The description of the test device part specifically refers to the test method part and will not be repeated here.

[0109] Figure 5 A block diagram of a computer system suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 5The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0110] like Figure 5 As shown, the computer system 500 according to the embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0111] In RAM 503, various programs and data required for the operation of system 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other through bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0112] According to an embodiment of the present disclosure, the system 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The system 500 may further include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0113] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0114] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0115] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0116] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 502 and / or the RAM 503 described above and / or one or more memories other than the ROM 502 and the RAM 503 .

[0117] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0118] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0119] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A testing method, applied to an automated testing framework, comprising: Create a listening process and a callback component. The listening process is run by a node on the host and is used to monitor whether the test case currently executed in the browser has been completed. The callback component is run in the node of the automated testing framework and is used to forward the test result information received from the browser to the listening process after the test case is completed, and to call back the test result information of the test case; Through the monitoring process, monitoring whether the currently executed test case is completed; When the test case is tested, the test result information of the test case is called back through the callback component.

2. According to the method of claim 1, the callback component is further used to send the test result information to the test platform, and the method further comprises: The test result information of the test case is uploaded to the test platform through the callback component.

3. According to the method of claim 1, the creating a monitoring process comprises: Use the native node.service to create the listening process.

4. The method according to claim 1, wherein creating a callback component comprises: Create a beforeeach() function and an aftereach() function, wherein the beforeeach() function is used to capture the next test case to be executed, and the aftereach() function is used to call back the test result information of the test case after the next test case to be executed is executed.

5. According to the method of claim 4, calling back the test result information of the test case through the callback component comprises: Capture the next test case to be executed through the beforeeach() function; After the next test case to be executed is executed, the test result information of the test case is called back through the aftereach() function.

6. The method according to claim 1, wherein: Whenever a test case is completed, the test result information of the test case is sent to the callback component through the cy.task command.

7. The method according to claim 1, wherein: The test result information of the test case is transmitted to the callback component through the WebSockets mechanism built into the automated testing framework.

8. The method according to any one of claims 1 to 7, wherein: The automated testing framework is the Cypress testing framework.

9. A testing device comprising: A creation module is used to create a listening process and a callback component. The listening process is run by a node on a host and is used to monitor whether the test case currently executed in the browser has been completed. The callback component is run in a node of an automated testing framework and is used to forward the message received from the browser to the listening process after the test case is completed, and to call back the test result information of the test case; A monitoring module is used to monitor whether the currently executed test case has been completed through the monitoring process; The callback module is used to call back the test result information of the test case through the callback component after the test case is completed.

10. A computer system comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • UI automatic test method and device, storage medium and electronic equipment

    CN111488275A

  • Test report generation method and device

    CN112214412A