Background
The page stability is an important index of the H5 page. Because different machine types generally adopt different operating systems, each machine type has compatibility problems caused by the reasons of non-standard codes, imperfect system webview support and the like. At present, the compatibility among different models is generally processed by means of manual inspection. However, the method has the disadvantages of large workload, low testing efficiency and easy omission, so that the accuracy and the integrity of the test cannot be guaranteed.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. Therefore, the invention aims to provide a method and a device for testing the stability of an H5 page, a storage medium and electronic equipment, so as to realize the automation of the stability test of the H5 page and improve the test efficiency.
In a first aspect, the invention provides a method for testing the stability of an H5 page, which comprises the following steps: acquiring to-be-tested applications of each test terminal and test cases corresponding to H5 pages of each to-be-tested application; creating a test task according to each test case and each test terminal, wherein the test task comprises a plurality of test subtasks; calling a Jenkins integration tool, and issuing the test tasks to each test terminal through the Jenkins integration tool; controlling each test terminal through the Jenkins integration tool, and executing the plurality of test subtasks according to a set sequence; and receiving the test result of each test subtask returned by each test terminal.
According to an embodiment of the invention, the method further comprises: creating pipeline information for each test subtask through the Jenkins integration tool; and controlling each test terminal to execute a corresponding test subtask according to the pipeline information of the pipeline.
According to an embodiment of the invention, the method further comprises: and analyzing each test result to obtain a stability analysis report of the H5 page of each application to be tested of each test terminal.
According to an embodiment of the invention, the method further comprises: and sending prompt information according to the stability analysis report of the H5 page to prompt a test result.
According to one embodiment of the invention, the prompt message is sent out by way of page display and/or mail.
According to an embodiment of the invention, the method further comprises: in the process of executing the test subtask by the test terminal, if abnormal information is detected, a solution corresponding to the abnormal information is obtained, and the abnormal information is processed according to the solution.
According to an embodiment of the present invention, the test content corresponding to the test case includes: whether the advertisement in the H5 page can be clicked normally, whether the H5 page can be switched normally, whether the H5 page can go to the next step, and whether the H5 page can be connected to one or more of the service pages corresponding to the advertisement.
In a second aspect, the present invention provides an apparatus for testing H5 page stability, including: the acquisition module is used for acquiring the applications to be tested of each test terminal and the test cases corresponding to the H5 pages of each application to be tested; the creating module is used for creating a test task according to each test case and each test terminal, wherein the test task comprises a plurality of test subtasks; the sending module is used for calling a Jenkins integration tool and issuing the test tasks to each test terminal through the Jenkins integration tool; the control module is used for controlling each test terminal through the Jenkins integration tool and executing the plurality of test subtasks according to a set sequence; and the receiving module is used for receiving the test result of each test subtask returned by each test terminal.
In a third aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for testing H5 page stability described above.
In a fourth aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory, and when the computer program is executed by the processor, the computer program implements the method for testing the H5 page stability.
The method and the device for testing the stability of the H5 page, the storage medium and the electronic equipment can realize the automatic execution of a plurality of test subtasks of different test terminals, and improve the testing efficiency of the stability of the H5 page.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a method and an apparatus for testing H5 page stability, a storage medium, and an electronic device according to an embodiment of the present invention with reference to the drawings.
Fig. 1 is a flowchart of a method for testing the stability of the H5 page according to the first embodiment of the present invention.
As shown in fig. 1, the method for testing the page stability of H5 includes the following steps:
and S1, acquiring the applications to be tested of each test terminal and the test cases corresponding to the H5 pages of each application to be tested.
The test terminals may be smart phones, tablet computers, and the like, and the operating systems installed in each test terminal include at least two types, for example, an Android system, an IOS system, and the like. The Application to be tested comprises various APPs (Application programs) installed by various testing terminals, and the APP versions installed by different terminal devices can be different. The test case is an automated test script for testing, and the test content corresponding to the test case may include: whether the advertisement in the H5 page can be clicked normally, whether the H5 page can be switched normally, whether the H5 page can go to the next step, and whether the H5 page can be connected to one or more of the service pages corresponding to the advertisement. Wherein the advertisement may include one or more of a promotional advertisement, a single page advertisement, a landing page, and a stay on single page.
Specifically, the cloud test platform may provide a port for communication connection with the terminal device, through which communication connection between the cloud test platform and the test terminal may be established, and then the cloud test platform may operate the test terminal through a script command, where the cloud test platform may implement communication connection with 50+ test terminals (i.e., more than 50 test terminals). For example, the test terminal interface can be directly opened through the cloud test platform, and the content displayed by the test terminal interface can be viewed. Wherein the script may include: the test terminal APP comprises a key script, a slide-up and slide-down script, a touch script, a praise script, a screenshot script, a reserved report script and the like, and particularly, the script can cover all interfaces on the test terminal APP.
And S2, creating a test task according to each test case and each test terminal, wherein the test task comprises a plurality of test subtasks.
Wherein, different test subtasks may correspond to different APPs.
And S3, calling a Jenkins integration tool, and issuing test tasks to each test terminal through the Jenkins integration tool.
Specifically, Jenkins can be used for communicating with each node through an HTTP (Hyper Text Transfer Protocol) Protocol, and each node can be connected with a test terminal through a wireless routing WIFI communication, a USB (Universal Serial Bus), a data line, a bluetooth communication, an NFC communication, an infrared communication or a zigbee communication. When the test case of the APP is to be executed, the cloud test platform can issue a corresponding test task to the test terminal through Jenkins.
And S4, controlling each test terminal through a Jenkins integration tool, and executing a plurality of test subtasks according to a set sequence.
Specifically, one test subtask can be issued at a time through the Jenkins integration tool, the issuing sequence can be a set sequence, and after the current test subtask is executed, the next test subtask can be issued to test the next to-be-tested APP.
And S5, receiving the test result of each test subtask returned by each test terminal.
In particular, the cloud testing platform may create a persistent integration service query interface that may be used to receive test results. In the process of executing the test subtask, the interface can be queried through polling the continuous integration service, and if the query is successful, the test result can be received so as to analyze the test result; if the query fails, polling continues.
Therefore, the testing method provided by the embodiment of the invention can ensure the coverage rate of the testing environment by accessing the cloud testing platform of various testing terminals, and can realize that the testing tasks corresponding to the same H5 page are issued to different testing terminals. By controlling the test terminal to run the corresponding test script and collecting the data of the key nodes, and further observing the test results of different test terminals, special adaptation is performed on incompatible test terminals, and the compatibility and stability of the test case can be ensured.
As an example, the testing method further comprises: creating pipeline information for each test subtask through a Jenkins integration tool; and controlling each test terminal to execute the corresponding test subtask according to the pipeline information.
Specifically, while a test task is issued to a test terminal by Jenkins, pipeline information of pipeline, that is, a task flow, can be created, including a task creation flow, a task starting flow, a task execution flow, a result collection flow and a result reporting flow, and the task flow is sequentially executed by pipeline scripts.
In an embodiment of the present invention, as shown in fig. 2, after receiving the test result, the test method may further include:
and S6, analyzing the test results to obtain a stability analysis report of the H5 page of each application to be tested of each test terminal.
In this embodiment, after the stability analysis report of the H5 page of each application to be tested of each test terminal is obtained, the test result may be reported to a corresponding storage medium, such as a cloud database, a log, or the like, for subsequent viewing.
In an embodiment of the present invention, as shown in fig. 2, after receiving the stability analysis report of the H5 page, the testing method may further include:
and S7, sending prompt information according to the stability analysis report of the H5 page to prompt the test result.
In this embodiment, the prompt message may be sent by way of a page show and/or email. Therefore, the stability analysis report of the H5 page can be conveniently and timely acquired by a tester.
As an example, in the process of executing the test subtask by the terminal device, if the abnormal information is detected, a solution corresponding to the abnormal information is obtained, and the abnormal information is processed according to the solution.
Specifically, in the process of executing the test subtask by the terminal device, if the abnormal information is detected, it may be determined whether the abnormal information occurs for the first time. If the abnormal information appears for the first time, the abnormal information can be reported first, so that a tester can put forward a corresponding solution according to the abnormal information, and upload the solution to a cloud test platform and store the solution. When the same information as the abnormal information is acquired again, the stored solution can be directly acquired, and the abnormal information is processed according to the solution. Therefore, the testing efficiency can be improved.
For the convenience of understanding, the method for testing the page stability of H5 according to the embodiment of the present invention is described below with reference to fig. 4:
step 1: uploading the test case and the application to be tested to a cloud test platform;
step 2: creating a test project by Jenkins;
and step 3: the method comprises the steps that Jenkins are used for initiating a test task, namely the test task is issued to each test terminal through a corresponding communication mode, such as wireless routing WIFI;
and 4, step 4: calling a task query port polling test task;
and 5: judging whether a test result is returned or not, analyzing the test result to obtain a test report when the test result is returned, and returning to the step 4 when the test result is not returned;
step 6: and reporting a test report.
In summary, the H5 page stability testing method provided by the embodiment of the invention can realize automatic execution of multiple testing subtasks of different testing terminals, and improves the testing efficiency of H5 page stability.
Fig. 5 is a block diagram of a testing apparatus for H5 page stability according to an embodiment of the present invention.
As shown in fig. 5, the testing apparatus 100 for H5 page stability includes: an acquisition module 110, a creation module 120, a transmission module 130, a control module 140, and a reception module 150.
The obtaining module 110 is configured to obtain applications to be tested of each test terminal and test cases corresponding to H5 pages of each application to be tested; the creating module 120 is configured to create a test task according to each test case and each test terminal, where the test task includes a plurality of test subtasks; the sending module 130 is used for calling a Jenkins integration tool and issuing a test task to each test terminal through the Jenkins integration tool; the control module 140 is configured to control each test terminal through a Jenkins integration tool, and execute a plurality of test subtasks according to a set sequence; the receiving module 150 is configured to receive the test result of each test subtask returned by each test terminal.
In this embodiment, the test content corresponding to the test case includes: whether the advertisement in the H5 page can be clicked normally, whether the H5 page can be switched normally, whether the H5 page can go to the next step, and whether the H5 page can be connected to one or more of the service pages corresponding to the advertisement. The communication mode between Jenkins integration tool and each test terminal includes one or more of wireless routing WIFI communication, USB communication, bluetooth communication, NFC communication, infrared communication and purple bee communication.
In one embodiment of the invention, the creation module 120 may also be used to create pipeline information for each test subtask through a Jenkins integration tool. The control module 140 may also be configured to control each test terminal to execute a corresponding test subtask according to pipeline information.
In an embodiment of the present invention, the testing apparatus 100 may further include an analysis module, configured to analyze each test result to obtain a stability analysis report of the H5 page of each application to be tested of each testing terminal.
In an embodiment of the present invention, the testing apparatus 100 may further include a prompting module, configured to send a prompting message according to the stability analysis report of the H5 page, so as to prompt the testing result.
The prompting module can send out prompting information in a page display and/or mail mode.
In one embodiment of the present invention, the H5 page stability testing apparatus 100 further includes a detection module and a processing module. In the process of executing the test subtask by the terminal device, if the detection module detects the abnormal information, the obtaining module 110 further obtains a solution corresponding to the abnormal information, and the processing module processes the abnormal information according to the solution.
It should be noted that, for other specific embodiments of the apparatus for testing page stability in H5 according to the embodiment of the present invention, reference may be made to the specific embodiment of the method for testing page stability in H5 according to the above embodiment of the present invention.
The H5 page stability testing device provided by the embodiment of the invention can realize automatic execution of a plurality of testing subtasks of different testing terminals, and improves the testing efficiency of H5 page stability.
Further, the present invention proposes a computer-readable storage medium.
In this embodiment, a computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the method for testing the H5 page stability of the above embodiment is implemented.
According to the computer-readable storage medium of the embodiment of the invention, when the computer program stored on the computer-readable storage medium is executed by the processor, the automatic execution of a plurality of test subtasks of different test terminals can be realized, and the test efficiency of the H5 page stability is improved.
Further, the invention provides an electronic device.
In this embodiment, the electronic device includes a memory, a processor, and a computer program stored on the memory, wherein the computer program, when executed by the processor, implements the H5 page stability testing method of the above embodiments.
According to the electronic equipment provided by the embodiment of the invention, when the computer program stored on the memory of the electronic equipment is executed by the processor, the automatic execution of a plurality of test subtasks of different test terminals can be realized, and the test efficiency of the H5 page stability is improved.
It should be noted that the logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be considered limiting of the invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.