CN111639030A - Page testing method, device, equipment and storage medium - Google Patents

Page testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN111639030A
CN111639030A CN202010475449.9A CN202010475449A CN111639030A CN 111639030 A CN111639030 A CN 111639030A CN 202010475449 A CN202010475449 A CN 202010475449A CN 111639030 A CN111639030 A CN 111639030A
Authority
CN
China
Prior art keywords
page
test
tested
file
plug
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
CN202010475449.9A
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010475449.9A priority Critical patent/CN111639030A/en
Publication of CN111639030A publication Critical patent/CN111639030A/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a page testing method, a page testing device, page testing equipment and a storage medium, relates to the technical field of computers, and can improve the efficiency of page testing. The method comprises the following steps: displaying a test plug-in on a test interface, wherein a page test script based on a preset test frame is packaged in the test plug-in; responding to a page test request triggered based on the test plug-in, wherein the page test request carries component identification information; determining various page components corresponding to the page to be detected based on the identification information of the page, and determining JSON files of the various page components; and in the test plug-in, executing the JSON file to test various page components of the page to be tested.

Description

Page testing method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page testing method, apparatus, device, and storage medium.
Background
In the traditional page test, a professional tester is generally required to compile test cases from a code level, but due to different contents displayed on different pages and different corresponding test cases, the tester is required to continuously re-compile or modify background programs, the workload is huge, modification is inconvenient, and the page test efficiency is low.
Disclosure of Invention
The embodiment of the application provides a page testing method, a page testing device and a storage medium, wherein script files required in the page testing process are displayed in a testing plug-in mode through a testing interface, so that the complexity of the page testing process is simplified, and the page testing efficiency is improved.
In a first aspect, the present application provides a page testing method, including:
displaying a test plug-in on a test interface, wherein a page test script generated based on a preset test frame is packaged in the test plug-in;
after a page test request triggered by the test plug-in is detected, determining each page component contained in a page to be tested and a JSON file corresponding to each page component of the page to be tested;
and in the test plug-in, executing the JSON file to test the page to be tested.
In an optional implementation manner, before displaying the test plug-in on the test interface, the method further includes:
generating a test script required in page testing into a test code under a preset frame based on an end-to-end test standard;
and registering the test code to a preset plug-in a JSON file format to obtain the test plug-in.
In an optional implementation manner, the generating a test script required in the page test into test code under a preset framework based on the end-to-end test standard includes:
reading an end-to-end test script file for page testing under the preset test frame, and generating a test code file according to the test script file, wherein the test code file comprises the test code.
In an optional implementation manner, reading an end-to-end test script file for page testing under the preset test framework, and generating a test code file according to the test script file includes:
reading a test script file for end-to-end testing under a preset test framework template, and storing the test script file in an appointed directory;
running the test script file through a predetermined running tool, and determining fields and attribute values required by the test script file for page testing through a reflection mechanism;
and obtaining the test code file according to the field and attribute values required by the test script file.
In an optional implementation manner, after the displaying the test plug-in on the test interface, the method further includes:
componentizing page content of a page to be tested to obtain each page component of the page to be tested, wherein each page component is configured with a preset test frame;
the page identification information of the page to be tested and each page component of the page to be tested are stored in an associated mode;
determining a configuration file of each page component through the preset test frame configured for each page component;
and generating JSON files corresponding to the page components according to the configuration files, and performing associated storage on the page components of the page to be tested and the JSON files corresponding to the page components.
In an optional implementation manner, the page test request carries page identification information of a page to be tested;
the determining of each page component contained in the page to be tested and the JSON file corresponding to each page component of the page to be tested includes:
determining each page component contained in the page to be tested according to the page identification information;
and determining the JSON file corresponding to each page component contained in the page to be tested according to the incidence relation between each page component and the JSON file.
In an optional implementation manner, in the test plug-in, executing the JSON file to test each page component of the page to be tested includes:
in the test plug-in, acquiring the JSON file required in the test of the page to be tested;
and executing the JSON file to test each page component of the page to be tested.
In a second aspect, the present application provides a page testing apparatus, including:
the display module is used for displaying a test plug-in on a test interface, and a page test script generated based on a preset test frame is packaged in the test plug-in;
the first determining module is used for determining each page component contained in a page to be tested and a JSON file corresponding to each page component of the page to be tested after detecting a page testing request triggered based on the testing plug-in;
and the execution module is used for executing the JSON file to test the page to be tested in the test plug-in.
In an optional implementation manner, the method further includes:
the generating module is used for generating a test script required in the page test into a test code under a preset framework based on an end-to-end test standard;
and the composition module is used for registering the test code to a preset plug-in a JSON file format to obtain the test plug-in.
In an optional implementation manner, the generating module is specifically configured to:
reading an end-to-end test script file for page testing under the preset test frame, and generating a test code file according to the test script file, wherein the test code file comprises the test code.
In an optional implementation manner, the generating module includes:
the system comprises a storage unit, a test framework template setting unit and a test script file setting unit, wherein the storage unit is used for reading a test script file for end-to-end test under a preset test framework template and storing the test script file in a specified directory;
the determining unit is used for operating the test script file through a predetermined operating tool and determining fields and attribute values required by the test script file for page testing through a reflection mechanism;
and the obtaining unit is used for obtaining the test code file according to the field and the attribute value required by the test script file.
In an optional implementation manner, the method further includes:
the componentization module is used for componentizing the page content of the page to be tested to obtain each page component of the page to be tested, and each page component is configured with a preset test frame;
the first associated storage module is used for storing the page identification information of the page to be tested and each page component of the page to be tested in an associated manner;
the second determining module is used for determining the configuration file of each page component through the preset test frame configured for each page component;
and the second associated storage module is used for generating a JSON file corresponding to each page component according to the configuration file and performing associated storage on each page component of the page to be tested and the JSON file corresponding to each page component.
In an optional implementation manner, the page test request carries page identification information of a page to be tested;
the first determining module includes:
the first determining unit is used for determining each page component contained in the page to be tested according to the page identification information;
and the second determining unit is used for determining the JSON file corresponding to each page component contained in the page to be tested according to the incidence relation between each page component and the JSON file.
In an optional implementation manner, the execution module includes:
the acquisition unit is used for acquiring the JSON file required in the test of the page to be tested in the test plug-in;
and the execution unit is used for executing the JSON file to test each page assembly of the page to be tested.
In a third aspect, the present application provides a page testing device, including: a processor, a memory and a computer program stored in the memory and executable on the processor, the processor when executing the computer program implementing the method according to the first aspect or any alternative of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements a method as set forth in the first aspect or any alternative of the first aspect.
According to the page testing method provided by the first aspect of the application, a testing plug-in is displayed on a testing interface, and a page testing script based on a preset testing frame is packaged in the testing plug-in; responding to a page test request triggered based on the test plug-in, wherein the page test request carries component identification information; determining various page components corresponding to the page to be detected based on the identification information of the page, and determining JSON files of the various page components; and in the test plug-in, executing the JSON file to test various page components of the page to be tested. The script file required by the page test is packaged based on the preset test frame and is displayed in the form of the test plug-in through the test interface, so that a common user can independently complete the page test, the page test efficiency is improved, and the test cost is reduced.
It is understood that the beneficial effects of the second to fourth aspects can be seen from the description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram of a page testing method provided in a first embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a page testing method provided in a second embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of S201 in FIG. 2;
FIG. 4 is a schematic diagram of a page testing apparatus according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a page testing device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items. Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
It should also be appreciated that reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Before explaining the page testing method provided by the present application, an exemplary explanation is first given to the principle of the current page testing and the related concepts in the page testing.
Currently, for front-end page testing, the main test contents include whether forms, animations, page jumps, dom rendering, Ajax, and the like are performed as desired. Compared with the common unit test, the highest-level test of the page function can be ensured based on the end-to-end test, and the test code based on the end-to-end test has the advantages of higher quality, better performance, stronger readability and expansibility, and the grammar and the framework of the code and even the programming paradigm can be thoroughly changed without rewriting test cases and the like, so that the method is widely applied to the front-end page test. However, end-to-end testing requires professional intervention in the process of script writing and page testing configuration, and it is difficult for an ordinary user to independently complete the testing of a page.
The following describes an exemplary page testing method provided by the present application with specific embodiments.
Referring to fig. 1, fig. 1 is a schematic flow chart of a page testing method according to a first embodiment of the present application. The main execution body of the page testing method in this embodiment is a page testing device, including but not limited to a mobile terminal such as a smart phone, a tablet computer, and a wearable device, and may also be a server, a PC, and the like in various application scenarios. The page test method as shown in fig. 1 may include:
s101, displaying a test plug-in on a test interface, wherein a page test script generated based on a preset test framework is packaged in the test plug-in.
It should be noted that the plug-in is a program written by an application program interface conforming to a preset specification, and may be displayed on the test interface in a control form of a preset shape, for example, in a control form of a square form, where when the plug-in is displayed in the control form, the control includes a control name, for example, in this embodiment, when the test plug-in is displayed in the control form, the control name is a page test. Illustratively, the test plug-in is a plug-in generated based on an end-to-end (e2e) automatic test script, and comprises a preset test framework of various page components of the page to be tested; illustratively, the pre-set test framework is a Night Watch test framework.
It should be noted that, in the current page testing process, common testing frames include, for example, jquery frame, yui frame, vue frame, Rebot frame, etc., in the process of generating the test script, the frames need to modify the test script correspondingly according to the adjustment and variation of the front-end architecture, for example, the vue frame uses llitest to modify the automation script, the yui frame uses yui to modify the automation script, and the like, and the end-to-end based automation test script does not need to know the front-end architecture, the method generates a test script required in page test into a preset test frame through an end-to-end test standard, e.g., the test code under the Night Watch test framework, and registers the test code in the form of a JSON file to the selected plug-in, to create a test plug-in that, in the embodiment of the present application, is displayed on the test interface.
Illustratively, the process of generating the test code under the NightWatch test framework from the test script required in the page test through the end-to-end test standard comprises the following steps: reading an end-to-end test script file for page testing under a night watch test framework template, and generating a test code file according to the script file, wherein the test code file comprises the test code; in an optional implementation manner, a script file for end-to-end testing under a night watch testing framework template is read, the script file is stored in a specified directory and is run through a Selenium tool, the script file under the specified template is automatically read, a field and an attribute value required by the script file are determined through a reflection mechanism, a test code or a test code file is obtained according to the field and the attribute value required by the script file, and the test code file comprises a test code, parameters required by a test method and an expected result. By way of example and not limitation, the test code file is an encrypted file, which prevents abnormal changes, and in the following operations applied to the test code file, a decryption operation needs to be performed on the test code file to obtain a required code frame.
S102, after detecting a page test request triggered by the test plug-in, determining each page component contained in a page to be tested and a JSON file corresponding to each page component of the page to be tested.
In this embodiment, the page test request is triggered by a user through the test plug-in, the test plug-in is provided with an input box or a selection item, the input box is used for inputting the identification information of the page to be tested, or the selection item is used for selecting the identification information of the page to be tested; and each page to be tested corresponds to unique component identification information, and after a user selects or inputs the corresponding page identification information through the test interface, the user clicks to generate the page test request.
In an optional implementation manner, before determining each page component included in a page to be tested and a JSON file corresponding to each page component of the page to be tested, the method further includes:
a1, componentizing the page content of the page to be tested to obtain each page component of the page to be tested, wherein each page component is configured with a preset test frame.
A2, storing the page identification information of the page to be tested in association with each page component of the page to be tested.
A3, determining the configuration file of each page component through the preset test framework configured by each page component.
A4, generating JSON files corresponding to the page components according to the configuration files, and storing the page components of the page to be tested in association with the JSON files.
In an optional implementation manner, the page test request carries page identification information of a page to be tested; the determining of each page component contained in the page to be tested and the JSON file corresponding to each page component of the page to be tested includes:
and determining each page component contained in the page to be tested according to the page identification information.
Illustratively, all display contents of the page to be tested are abstracted into independent page components, and each page component has a component name and is provided with a unique component ID; the display content of the page to be detected comprises any content displayed on the page, such as a page foot, a page head, pictures, characters, buttons, a form and animation in the page, and any operation performed on the page in page skipping, dom rendering and Ajax.
And determining the JSON file corresponding to each page component contained in the page to be tested according to the incidence relation between each page component and the JSON file.
It can be understood that, since each component of the page to be tested is configured with a preset test frame, such as a Night Watch test frame, the Night Watch preset test frame generates a JSON file according to the configuration file of the respective corresponding component, and associates and stores the JSON file with various page components; after determining various page components corresponding to the page to be detected based on the page identification information, determining the JSON file of each page component according to the association relation between the JSON file stored in association and each page component, and acquiring the JSON file;
it can be understood that the configuration file of the component includes configuration information of the page content of the page to be tested represented by the component, in this embodiment, the configuration information of the page content includes position information, layout structure information, and the like, and in this embodiment, the JSON file is obtained by parsing the configuration information of the page content into data in the JSON format. The JSON file is used for controlling data in a JSON format.
S103, in the test plug-in, the JSON file is executed to test the page to be tested.
It can be understood that the test plug-in stores in advance a test code generated by a test script required in a page test, and the test code is registered in the test plug-in the form of a JSON file, so that after determining the JSON file corresponding to each component of a test page, the JSON file can be directly acquired in the test plug-in.
Exemplarily, determining fields needing parameterization in the JSON file according to the functional requirements of various page components; the parameterized field is saved as a text table of the JSON file; creating a test project such as attributeEquals and creating test classes; loading a JSON file by using a JSON.Load method in the test class to obtain a JSON object, and performing specific parameterized replication on JSON in a test case by using a dictionary access mode; and the test case executes the test script through execrer to complete the test of various page components of the page to be tested.
Illustratively, in the test plug-in, executing the JSON file to test each page component of the page to be tested includes:
in the test plug-in, acquiring the JSON file required in the test of the page to be tested;
and executing the JSON file to test each page component of the page to be tested.
According to the analysis, the page testing method provided by the implementation includes displaying a test plug-in on a test interface, wherein a page testing script based on a preset testing frame is packaged in the test plug-in; responding to a page test request triggered based on the test plug-in, wherein the page test request carries component identification information; determining various page components corresponding to the page to be detected based on the identification information of the page, and determining JSON files of the various page components; and in the test plug-in, executing the JSON file to test various page components of the page to be tested. The script file required by the page test is packaged based on the preset test frame and is displayed in the form of the test plug-in through the test interface, so that a common user can independently complete the page test, the page test efficiency is improved, and the test cost is reduced. Fig. 2 is a schematic flow chart of a page testing method according to a second embodiment of the present application. As can be seen from fig. 2, in this embodiment, compared with the embodiment shown in fig. 1, the specific implementation processes of S203 to S205 are the same as those of S101 to S103, but the difference is that S201 to S202 are further included before S203, and the following details are provided:
s201, generating a test code under a preset framework by using a test script required in the page test based on an end-to-end test standard.
In this embodiment, an end-to-end test script file for page testing under the preset test frame is read, and a test code file is generated according to the test script file, where the test code file includes the test code.
Illustratively, as shown in fig. 3, it is a flowchart of a specific implementation of S201 in fig. 2. As can be seen from fig. 3, S201 includes:
and S2011, reading a test script file for end-to-end test under a preset test frame template, and storing the test script file in an appointed directory.
In this embodiment, the preset test framework template is a general framework template under a preset test framework, for example, a general framework template in a Night Watch test framework, where the Night Watch test framework includes a test script file for an end-to-end test, and in this embodiment, the specified directory is a predetermined test directory.
S2012, the test script file is run through a predetermined running tool, and the fields and attribute values required by the test script file for the page test are determined through a reflection mechanism.
For example, the predetermined running tool is a Selenium tool, and in this embodiment, the Selenium tool automatically reads the test script file, and determines fields and attribute values required by the script file through a reflection mechanism.
S2013, obtaining the test code file according to the field and attribute values required by the test script file.
In this embodiment, the test code or the test code file is obtained according to the field and the attribute value required by the script file, and the test code file includes the test code, the parameter required by the test method, and the expected result. By way of example and not limitation, the test code file is an encrypted file, which prevents abnormal changes, and in the subsequent operation applied to the test code file, the test code file is actually decrypted to obtain the code frame.
S202, registering the test code to a preset plug-in a JSON file format to obtain the test plug-in.
S203, displaying a test plug-in on the test interface, wherein a page test script generated based on a preset test frame is packaged in the test plug-in.
S204, after detecting the page test request triggered by the test plug-in, determining each page component contained in the page to be tested and the JSON file corresponding to each page component of the page to be tested.
S205, in the test plug-in, the JSON file is executed to test the page to be tested.
In summary, by using the page testing method provided by the application, the test plug-in is displayed on the test interface, the various page components corresponding to the page to be tested are determined based on the identification information of the page to be tested, and after the JSON files of the various page components are determined, the JSON files are executed in the test plug-in to test the various page components of the page to be tested. The script file required by the page test is packaged based on the preset test frame and is displayed in the form of the test plug-in through the test interface, so that a common user can independently complete the page test, the page test efficiency is improved, and the test cost is reduced.
Based on the page testing method provided by the embodiment, the embodiment of the invention further provides an embodiment of a device for realizing the embodiment of the method.
Referring to fig. 4, fig. 4 is a schematic view of a page testing apparatus according to an embodiment of the present disclosure. The modules are included for performing the steps in the corresponding embodiments of fig. 1 or fig. 2. Please refer to the description of the embodiment corresponding to fig. 1 and fig. 2. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, the page test apparatus 400 includes:
the display module 401 is configured to display a test plug-in on a test interface, where a page test script generated based on a preset test frame is encapsulated in the test plug-in;
a first determining module 402, configured to determine, after detecting a page test request triggered based on the test plug-in, each page component included in a page to be tested and a JSON file corresponding to each page component of the page to be tested;
and the execution module 403 is configured to execute the JSON file to test the page to be tested in the test plug-in.
In an optional implementation manner, the method further includes:
the generating module is used for generating a test script required in the page test into a test code under a preset framework based on an end-to-end test standard;
and the composition module is used for registering the test code to a preset plug-in a JSON file format to obtain the test plug-in.
In an optional implementation manner, the generating module is specifically configured to:
reading an end-to-end test script file for page testing under the preset test frame, and generating a test code file according to the test script file, wherein the test code file comprises the test code.
In an optional implementation manner, the generating module includes:
the system comprises a storage unit, a test framework template setting unit and a test script file setting unit, wherein the storage unit is used for reading a test script file for end-to-end test under a preset test framework template and storing the test script file in a specified directory;
the determining unit is used for operating the test script file through a predetermined operating tool and determining fields and attribute values required by the test script file for page testing through a reflection mechanism;
and the obtaining unit is used for obtaining the test code file according to the field and the attribute value required by the test script file.
In an optional implementation manner, the method further includes:
the componentization module is used for componentizing the page content of the page to be tested to obtain each page component of the page to be tested, and each page component is configured with a preset test frame;
the first associated storage module is used for storing the page identification information of the page to be tested and each page component of the page to be tested in an associated manner;
the second determining module is used for determining the configuration file of each page component through the preset test frame configured for each page component;
and the second associated storage module is used for generating a JSON file corresponding to each page component according to the configuration file and performing associated storage on each page component of the page to be tested and the JSON file corresponding to each page component.
In an optional implementation manner, the page test request carries page identification information of a page to be tested;
the first determining module 402, comprising:
the first determining unit is used for determining each page component contained in the page to be tested according to the page identification information;
and the second determining unit is used for determining the JSON file corresponding to each page component contained in the page to be tested according to the incidence relation between each page component and the JSON file.
In an optional implementation manner, the execution module includes:
the acquisition unit is used for acquiring the JSON file required in the test of the page to be tested in the test plug-in;
and the execution unit is used for executing the JSON file to test each page assembly of the page to be tested.
FIG. 5 is a schematic diagram of a page testing device according to an embodiment of the present application. As shown in fig. 5, the page test apparatus 50 of this embodiment includes: a processor 500, a memory 501 and a computer program 502, such as a page test program, stored in the memory 501 and executable on the processor 500. The processor 500 executes the computer program 502 to implement the steps in the above-described embodiments of the page testing method, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 500 implements the functions of the modules/units in the above device embodiments, for example, the functions of the units 401 to 403 shown in fig. 4, when executing the computer program 502.
Illustratively, the computer program 502 may be partitioned into one or more modules/units that are stored in the memory 501 and executed by the processor 500 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 502 in the page test apparatus 50. For example, the computer program 502 may be divided into a display module, a first determining module, and an executing module, and specific functions of each module are described in the embodiment corresponding to fig. 4, which is not described herein again.
The page test equipment may include, but is not limited to, a processor 500, a memory 501. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the page testing device 5 and does not constitute a limitation of the page testing device 5 and may include more or less components than those shown, or some components may be combined, or different components, for example the video processing device may also include input output devices, network access devices, buses, etc.
The Processor 500 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 501 may be an internal storage unit of the page testing device 50, such as a hard disk or a memory of the page testing device 5. The memory 501 may also be an external storage device of the page testing device 50, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the page testing device 50. Further, the memory 501 may also include both an internal storage unit and an external storage device of the page test apparatus 50. The memory 501 is used for storing the computer programs and other programs and data required by the video processing device. The memory 501 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the page testing method can be implemented.
The embodiment of the application provides a computer program product, and when the computer program product runs on video processing equipment, the page testing method can be realized when the page testing equipment is executed.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting 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; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A page testing method is characterized by comprising the following steps:
displaying a test plug-in on a test interface, wherein a page test script generated based on a preset test frame is packaged in the test plug-in;
after a page test request triggered by the test plug-in is detected, determining each page component contained in a page to be tested and a JSON file corresponding to each page component of the page to be tested;
and in the test plug-in, executing the JSON file to test the page to be tested.
2. The method of claim 1, prior to displaying the test plug-in on the test interface, further comprising:
generating a test script required in page testing into a test code under a preset frame based on an end-to-end test standard;
and registering the test code to a preset plug-in a JSON file format to obtain the test plug-in.
3. The method of claim 2, wherein the generating test code under a preset framework from test scripts required in page testing based on end-to-end test standards comprises:
reading an end-to-end test script file for page testing under the preset test frame, and generating a test code file according to the test script file, wherein the test code file comprises the test code.
4. The method of claim 3, wherein reading an end-to-end test script file for page testing under the preset test framework, and generating a test code file according to the test script file comprises:
reading a test script file for end-to-end testing under a preset test framework template, and storing the test script file in an appointed directory;
running the test script file through a predetermined running tool, and determining fields and attribute values required by the test script file for page testing through a reflection mechanism;
and obtaining the test code file according to the field and attribute values required by the test script file.
5. The method of any of claims 1-4, further comprising, after displaying the test plug-in on the test interface:
componentizing page content of a page to be tested to obtain each page component of the page to be tested, wherein each page component is configured with a preset test frame;
the page identification information of the page to be tested and each page component of the page to be tested are stored in an associated mode;
determining a configuration file of each page component through the preset test frame configured for each page component;
and generating JSON files corresponding to the page components according to the configuration files, and performing associated storage on the page components of the page to be tested and the JSON files corresponding to the page components.
6. The method of claim 5, wherein the page test request carries page identification information of a page to be tested;
the determining of each page component contained in the page to be tested and the JSON file corresponding to each page component of the page to be tested includes:
determining each page component contained in the page to be tested according to the page identification information;
and determining the JSON file corresponding to each page component contained in the page to be tested according to the incidence relation between each page component and the JSON file.
7. The method according to claim 5 or 6, wherein executing the JSON file in the test plug-in tests each page component of the page to be tested, comprises:
in the test plug-in, acquiring the JSON file required in the test of the page to be tested;
and executing the JSON file to test each page component of the page to be tested.
8. A page testing apparatus, comprising:
the display module is used for displaying a test plug-in on a test interface, and a page test script generated based on a preset test framework is packaged in the plug-in on the vehicle;
the determining module is used for determining each page component contained in the page to be tested and the JSON file corresponding to each page component of the page to be tested after detecting the page testing request triggered by the testing plug-in;
and the execution module is used for executing the JSON file to test the page to be tested in the test plug-in.
9. A page testing apparatus, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202010475449.9A 2020-05-29 2020-05-29 Page testing method, device, equipment and storage medium Pending CN111639030A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010475449.9A CN111639030A (en) 2020-05-29 2020-05-29 Page testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010475449.9A CN111639030A (en) 2020-05-29 2020-05-29 Page testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111639030A true CN111639030A (en) 2020-09-08

Family

ID=72329406

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010475449.9A Pending CN111639030A (en) 2020-05-29 2020-05-29 Page testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111639030A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612563A (en) * 2020-12-16 2021-04-06 上海哔哩哔哩科技有限公司 Page test data generation method and device and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612563A (en) * 2020-12-16 2021-04-06 上海哔哩哔哩科技有限公司 Page test data generation method and device and computer equipment

Similar Documents

Publication Publication Date Title
CN109976761B (en) Software development kit generation method and device and terminal equipment
CN107729246B (en) Auxiliary test method, device and equipment for target application and storage medium
CN111190825A (en) Automatic test method, system and robot
CN111880813B (en) Method for realizing android card UI (user interface) and storage medium
CN110990274A (en) Data processing method, device and system for generating test case
CN114168114A (en) Operator registration method, device and equipment
CN113885935A (en) Resource packaging method and device, electronic equipment and computer readable storage medium
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN111639030A (en) Page testing method, device, equipment and storage medium
CN114185874A (en) Big data based modeling method and device, development framework and equipment
CN111538667A (en) Page testing method and device
CN112825033A (en) Interface code generation method, device, equipment and storage medium
US8745587B2 (en) System and method for testing computer programs
CN116151199A (en) Method, device and equipment for generating network-connected vehicle test report
CN110704742B (en) Feature extraction method and device
US20150220425A1 (en) Test context generation
CN115599401A (en) Publishing method, device, equipment and medium of user-defined model
CN115292196A (en) User interface testing method and device, electronic equipment and readable storage medium
CN114791885A (en) Interface test method, device, equipment and medium
CN115687310A (en) Data cleaning method and device
CN113641594A (en) Cross-terminal automatic testing method and related device
US9146720B1 (en) Binary file application processing
CN113448576A (en) File conversion method, device and related equipment
CN107179990B (en) Method and device for realizing test verification
CN111399932A (en) Method and system for calling D LL, browser processing method and browser

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