Test method and device, electronic equipment and storage medium

By loading engineering configuration files containing configuration information of multiple test scenarios and encapsulating the common processing logic, common functions are obtained, and testing failure problems caused by the need to load different test codes in the existing technology in different test scenarios, improving the efficiency of automated testing.

CN119988204APending Publication Date: 2025-05-13BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311477108.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-07
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the field of automotive automation testing, the existing technology requires loading different test codes for different test scenarios, resulting in some test processes being unable to start or configure, affecting the testing efficiency.

Method used

By loading the project configuration file, the file contains the test configuration information corresponding to multiple test scenarios, and encapsulates the common processing logic in the test configuration information to obtain a common function. Use common functions to test the target page to avoid loading different test codes due to different test scenarios.

Benefits of technology

This method effectively avoids test failure problems caused by loading different test codes in different test scenarios, and improves the efficiency of automated testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988204A_ABST
    Figure CN119988204A_ABST
Patent Text Reader

Abstract

The invention discloses a testing method and device, electronic equipment and a storage medium, and relates to the technical field of automatic testing. Comprising the steps of loading an engineering configuration file; the project configuration file comprises test configuration information corresponding to multiple test scenes; packaging common processing logic in the test configuration information to obtain a common function; the common processing logic comprises the same processing logic in the test configuration information; and testing the target page by using the common function. Compared with the prior art, the test configuration information of each scene is set in the project configuration file, and the common processing logic in the test configuration information is packaged to obtain the common function, so that various test scenes can be dealt with, the situation that different test codes need to be loaded due to different test scenes is avoided, and the test efficiency is improved. Therefore, the problem that part of testing processes cannot be started and configured is solved, and the automatic testing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a testing method, device, electronic equipment and storage medium. Background Art

[0002] In the field of automotive automated testing, the existing page configuration tools on the market (such as Da Vinci tools, etc.) are usually used to implement automated testing of the automotive system architecture. However, when using page configuration tools for automated testing, different test codes need to be loaded for different test scenarios, resulting in problems such as inability to start or configure some test processes, which in turn affects test efficiency. Summary of the invention

[0003] In view of this, the present application provides a testing method, device, electronic device and storage medium, which can improve the problem of test failure caused by the need to load different test codes for different test scenarios during current automated testing, and improve the efficiency of automated testing.

[0004] In a first aspect, the present application provides a testing method, comprising:

[0005] Loading a project configuration file, wherein the project configuration file includes test configuration information corresponding to multiple test scenarios;

[0006] Encapsulating the common processing logic in the test configuration information to obtain a common function; the common processing logic includes the same processing logic in a plurality of the test configuration information;

[0007] The target page is tested using the common function.

[0008] Optionally, encapsulating the common processing logic in the test configuration information to obtain a common function includes: determining the same processing logic between each test code in each test code in the multiple test configuration information; and encapsulating the same processing logic to obtain the common function.

[0009] Optionally, testing the target page includes testing a page configuration of the target page;

[0010] The common function is used to perform a page configuration test on the target page, including: combining the common function to record simulation data during the test; and using the simulation data as input data to test the page configuration of the target page.

[0011] Optionally, testing the target page also includes testing configuration code generated for the target page;

[0012] The common function is used to generate a code test for the target page, including: generating a configuration code for the target page; reading a local file and verifying the file content corresponding to the configuration code by using a regular matching method.

[0013] Optionally, testing the target page also includes testing the performance of the target page;

[0014] The common function is used to perform a performance test on the target page, including: detecting whether the current test item of the target page is the target test item; if the current test item is the target test item, generating a configuration code of the target test item by calling a generation interface; and verifying the configuration code.

[0015] Optionally, testing the target page also includes testing configuration logic verification of the target page;

[0016] The common function is used to perform a configuration logic verification test on the target page, including: obtaining page configuration data; verifying the configuration logic of the page configuration data by calling a verification interface to obtain a verification result; writing the verification result into a project configuration file, and reading the verification result in the project configuration file to verify the result by regular matching.

[0017] Optionally, after testing the target page using the common function, the method includes: recording a test log during the testing of the target page.

[0018] In a second aspect, the present application provides a testing device, comprising:

[0019] A loading unit is configured to load a project configuration file; the project configuration file includes test configuration information corresponding to multiple test scenarios;

[0020] An encapsulation unit is configured to encapsulate the common processing logic in the test configuration information to obtain a common function; the common processing logic includes the same processing logic in the test configuration information;

[0021] The testing unit is configured to test the target page using the common function.

[0022] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the testing method described in the first aspect when executed by a processor.

[0023] In a fourth aspect, the present application provides an electronic device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the test method described in the first aspect when executing the computer program.

[0024] The present application provides a test method, device, electronic device and storage medium, which first loads an engineering configuration file including test configuration information corresponding to a variety of test scenarios, that is, all the test configuration information of a variety of test scenarios is loaded into the engineering configuration file, and then the common processing logic in the test configuration information is encapsulated to form a parent class to obtain a common function, so as to be called when the page is automatically tested. Compared with the related art, the present application sets the test configuration information of each scenario in the engineering configuration file, and encapsulates the common processing logic in the test configuration information to obtain a common function, so as to cope with various test scenarios, avoid the problem that some test processes cannot be started or configured due to the need to load different test codes for different test scenarios, and improve the efficiency of automated testing.

[0025] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 A schematic diagram of a testing method provided in an embodiment of the present application is shown;

[0029] Figure 2 A schematic diagram of a process flow of another testing method provided in an embodiment of the present application is shown;

[0030] Figure 3 A schematic structural diagram of a testing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0031] In order to be able to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In addition, in order to be able to understand the characteristics and technical content of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings, and the attached drawings are only for reference purposes and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided by multiple details. However, in the absence of these details, one or more embodiments can still be implemented. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.

[0032] In order to improve the problem that different test codes need to be loaded for different test scenarios during current automated testing, which may lead to test failures, and to improve the efficiency of automated testing, this embodiment proposes a testing method. Figure 1 As shown, the method includes:

[0033] First, the embodiment of the present application is tested by the pytest unit test framework. Pytest is a python test framework. The test method provided in this embodiment is implemented under the AUTOSAR (Auto motive Open System Architecture) architecture by combining the three open source pytest plug-ins pytest-qt, pytest-mock, and pytest-logger. An automated test method for the target page based on the pytest unit test framework and combined with Qt5's self-developed graphic configuration page.

[0034] S101, loading a project configuration file.

[0035] Start the script program based on the pytest unit test framework, load the project configuration file, which includes test configuration information corresponding to various test scenarios. For example, it defines the configuration path config_path of the project, the temporary path template_path and other configuration paths, as well as the arxml files corresponding to each page. In this embodiment, the test configuration information of various test scenarios is all loaded in the project configuration file, so that it only needs to be called in the corresponding scenario, and there is no need to reload different test codes for different test scenarios, thereby avoiding the problem of test failure.

[0036] S102, encapsulating the common processing logic in the test configuration information to obtain a common function.

[0037] The common processing logic includes the same processing logic in the test configuration information. Specifically, the common processing logic is to determine the same processing logic between each test code in the test configuration information, encapsulate it into a class class as a common function, and the common function can be divided into multiple types according to different functions, such as project opening and closing class, calling interface class, log processing class, etc.

[0038] S103, using the common function to test the target page.

[0039] The test proposed in this embodiment includes automated testing, and the test scenarios covered include page configuration testing, code generation testing based on configuration pages, mapping testing, and verification testing. In this embodiment, first start the script program based on the unit test framework of pytest, and then load the engineering configuration file including the test configuration information corresponding to a variety of test scenarios; that is, all the test configuration information of a variety of test scenarios are placed in the engineering configuration file and loaded, and then the common processing logic in the test configuration information is encapsulated to form a parent class, and a common function is obtained, so as to be called when the page is automated tested. Compared with the related art, this embodiment sets the test configuration information of each scenario in the engineering configuration file, and encapsulates the common processing logic in the test configuration information to obtain a common function, so as to cope with various test scenarios, avoid the problem that some test processes cannot be started or configured due to the need to load different test codes for different test scenarios, and improve the efficiency of automated testing.

[0040] Optionally, the common processing logic in the test configuration information is encapsulated to obtain a common function, including: in each test code in multiple test configuration information, determining the same processing logic between each test code; and encapsulating the same processing logic to obtain a common function.

[0041] In this embodiment, the common functions include an open interface function, a close interface function, a call interface function, and a log processing interface function. The common processing logic is to determine the same processing logic between each test code in the test configuration information, and encapsulate it into a class class as a common function. The common function can be divided into multiple types according to different functions, such as project opening and closing classes, calling interface classes, log processing classes, etc. The common function obtained by encapsulation can make subsequent calls more convenient and quick. At the same time, since the project configuration file in this embodiment contains multiple test codes, encapsulation based on the common processing logic in multiple test codes can also optimize the processing speed and ensure the reliability of the implementation of the solution.

[0042] Optionally, testing the target page includes testing a page configuration of the target page;

[0043] The common function is used to perform a page configuration test on the target page, including: combining the common function to record simulation data during the test; and using the simulation data as input data to test the page configuration of the target page.

[0044] In this embodiment, testing the target page includes testing the page configuration. Among them, the mock method can be used to record the simulated data during the test. The mock method means that if the third-party data is unstable or other situations occur in the automated test, it will affect the test progress and it will be inconvenient to locate the problem. At this time, if the mock technology is used to simulate a scenario where other modules are normal and the current module is tested specifically, the interference of this abnormal situation can be reduced and the problem can be located conveniently; and various different data can be created by yourself to cover various test situations conveniently. The obtained mock data is also simulated data, and this method can make the test of page configuration more convenient.

[0045] In addition, Qt controls can be used, and simulated data can be used as input for Qt controls, making it easier to test page configurations. pytest-qt is used to operate Qt controls, including but not limited to: QPushButton-button control, QLineEdit-single-line text box control, QTextEdit-multi-line text box control, QComboBox-drop-down box control, QLabel-label control, QCheckBox-check box control, QRadioButton-radio button control, QTableWidget-table control, QTreeView-tree view control, QListView-list view control, QSpinBox-digital selection box control, QSlider-slider control, QProgressBar-progress bar control, QCalendarWidget-calendar control, QFileDialog-file dialog control, QMessageBox-pop-up dialog control.

[0046] Optionally, testing the target page also includes testing configuration code generated for the target page;

[0047] Using the common function, the target page is tested for code generation, including: generating the configuration code of the target page; reading the local file and verifying the file content corresponding to the configuration code by using regular matching.

[0048] In this embodiment, testing the target page also includes testing the generation of configuration code. By generating the configuration code for the target page and using regular matching, the file content corresponding to the configuration code is verified. Regular matching, also known as regular expression, is a text pattern including common characters and special characters. Regular expression uses a single string to describe and match a series of strings that match a certain syntactic rule, and is usually used to retrieve and replace texts that conform to a certain pattern (rule). By introducing the regular matching method, it can be effectively used to match and operate text and verify the configuration code.

[0049] Optionally, testing the target page also includes testing the performance of the target page;

[0050] The common function is used to perform performance testing on the target page, including: detecting whether the current test item of the target page is the target test item; generating the configuration code of the target test item by calling the generation interface when the current test item is the target test item; and verifying the configuration code.

[0051] In this embodiment, testing the target page also includes performance testing. The target test items include task mapping items, data mapping items, and service mapping items, where the mapping generally refers to a mapping relationship. When the mapping relationship is the above three items, the configuration code of the target test item can be generated for the target test item by calling a generation interface (such as a python interface); the configuration code is verified again to ensure that the final generated code meets expectations.

[0052] Optionally, testing the target page also includes testing configuration logic verification of the target page;

[0053] Use common functions to perform configuration logic verification tests on the target page, including: obtaining page configuration data; verifying the configuration logic of the page configuration data by calling the verification interface to obtain the verification result; writing the verification result into the project configuration file, and reading the verification result in the project configuration file to verify the result by regular matching.

[0054] In this embodiment, testing the target page also includes configuring a logic verification test. The strategy is: first configure the data through the page, then call the Python verification interface, write the verification result (verified_result.log) into the project configuration file, and then read the file and use regular matching to verify that the file content meets expectations, thereby ensuring that the code generated by the verification is correct.

[0055] Optionally, after testing the target page using the common function, the method includes: recording a test log during the testing process of the target page.

[0056] In this embodiment, the test logs during the test of the target page are recorded by the pytest-logger function, and the test logs are saved to facilitate subsequent additions, modifications, deletions, and checks.

[0057] like Figure 2 As shown in the figure, a flow chart of an automated testing method for the target page is proposed based on the pytest unit testing framework and Qt5's self-developed graphical configuration page, using three open source pytest plug-ins: pytest-qt, pytest-mock, and pytest-logger. The method includes:

[0058] S201, start the script program based on the pytest unit test framework.

[0059] This embodiment uses three open source pytest plug-ins, pytest-qt, pytest-mock, and pytest-logger, based on the pytest unit test framework and Qt5's self-developed graphical configuration page to implement an automated testing method for the target page. Start the script program to start testing the page.

[0060] S202, loading UI project configuration file.

[0061] The project configuration file includes test configuration information corresponding to various test scenarios. For example, it defines the project configuration path config_path, temporary path template_path and other configuration paths, as well as the arxml files corresponding to each page. The test configuration information of various test scenarios is loaded in the project configuration file, so that it only needs to be called in the corresponding scenario, and there is no need to reload different test codes for different test scenarios, thus avoiding the problem of test failure.

[0062] S203, load the jinja module through the Common module, set the file path, encapsulate the common processing logic in the test configuration information, and obtain the common function.

[0063] The Common module is actually a common processing module. By loading the jinja module and setting the corresponding file path, the common processing logic is encapsulated to obtain a common function. The common processing logic here refers to the same processing logic between each test code in the test configuration information. For example, there are 5 sections of test code in the test configuration information, all of which contain the same processing logic. This same processing logic is called the common processing logic. Then encapsulating it to obtain a common function can make it more convenient and quick in subsequent calls. At the same time, since the engineering configuration file in this embodiment contains a variety of test codes, encapsulating based on the common processing logic in a variety of test codes can also optimize the processing speed and ensure the reliability of the implementation of the solution.

[0064] S2041, page configuration test.

[0065] The test includes a page configuration test. Specifically, the configurable elements include elements in the operating system, such as OsCore, OsApplication, OsTask, OsAlarm, OsEvent, OsIoc, OsScheduletable, etc., and page operations such as adding, deleting, and modifying physical cores.

[0066] S2042, generated code testing.

[0067] Generate code test according to the configuration page. For example, after calling the widget.button.click() click function of pytest_qt to generate .c files and .h files, read the local files and use regular matching to verify whether the generated file content is consistent with the page configuration. If they are consistent, the test passes.

[0068] S2043, performance test.

[0069] The automated testing method provided in this embodiment can also implement performance testing, and can call mapping interfaces to perform performance stress testing on taskmapping, datamapping, and servicemapping functions. Specifically, SWC components usually use taskmapping, datamapping, and servicemapping functions. The automated testing framework cannot perform full UI operations, and will use the method of calling mapping interfaces to implement automated testing.

[0070] S2044, configure logic verification test.

[0071] Verification of page configuration in AUTOSAR is an important function of UI configuration tool. This automated test framework will read the verification interface and print the verification results to a .log file. It can realize the automated test of page configuration verification by reading the .log file and combining regular matching. In addition, this solution can also use pytest-logger to record all logs in the test process. Saving the test logs will facilitate subsequent additions, modifications, deletions and checks.

[0072] In this embodiment, the script program based on the unit test framework of pytest is first started, and then the project configuration file including the test configuration information corresponding to various test scenarios is loaded; that is, the test configuration information of various test scenarios is all loaded in the project configuration file, and then the common processing logic in the test configuration information is encapsulated to form a parent class, and a common function is obtained, so as to be called when the page is automatically tested. Compared with the related art, this embodiment sets the test configuration information of each scenario in the project configuration file, and encapsulates the common processing logic in the test configuration information to obtain a common function, so as to cope with various test scenarios, avoid the problem that some test processes cannot be started or configured due to the need to load different test codes for different test scenarios, and improve the efficiency of automated testing.

[0073] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in this embodiment provides a testing device, such as Figure 3 As shown, the device includes: a loading unit 301 , a packaging unit 302 and a testing unit 303 .

[0074] The loading unit 301 is configured to load a project configuration file; the project configuration file includes test configuration information corresponding to multiple test scenarios;

[0075] The encapsulation unit 302 is configured to encapsulate the common processing logic in the test configuration information to obtain a common function; the common processing logic includes the same processing logic in the test configuration information;

[0076] The testing unit 303 is configured to test the target page using the common function.

[0077] In a specific application scenario, the encapsulation unit 302 is specifically configured to determine the same processing logic between each test code in the multiple test configuration information; and encapsulate the same processing logic to obtain the common function.

[0078] In a specific application scenario, the testing unit 303 is further configured to record the simulation data in the testing process in combination with the common function; and to test the page configuration of the target page using the simulation data as input data.

[0079] In a specific application scenario, the testing unit 303 is further configured to generate a configuration code for the target page; read a local file, and verify the file content corresponding to the configuration code by using a regular matching method.

[0080] In a specific application scenario, the test unit 303 is further configured to detect whether the current test item of the target page is the target test item; if the current test item is the target test item, generate the configuration code of the target test item by calling the generation interface; and verify the configuration code.

[0081] In a specific application scenario, the test unit 303 is further configured to obtain page configuration data; verify the configuration logic of the page configuration data by calling the verification interface to obtain a verification result; write the verification result into the project configuration file, and verify the result by reading the verification result in the project configuration file through regular matching.

[0082] In a specific application scenario, the testing unit 303 is further configured to record a test log during the testing process of the target page.

[0083] It should be noted that for other corresponding descriptions of the functional units involved in the test device provided in this embodiment, reference can be made to Figure 1 and Figure 2 The corresponding description in will not be repeated here.

[0084] Based on the above Figure 1 and Figure 2 The method shown in the embodiment also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned Figure 1 and Figure 2 The method shown.

[0085] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of the present application.

[0086] Based on the above Figure 1 and Figure 2The method shown, and Figure 3 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides an electronic device, which can be configured on a computer side or a vehicle side, etc. The device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 and Figure 2 The method shown.

[0087] Optionally, the above-mentioned physical device may also include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0088] Those skilled in the art will appreciate that the above-mentioned physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different arrangements of components.

[0089] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned physical device, and supports the operation of the information processing program and other software and / or programs. The network communication module is used to realize the communication between the components inside the storage medium, and the communication with other hardware and software in the information processing physical device.

[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware platforms, or by hardware. Applying the scheme of this embodiment, first start the script program based on the unit test framework of pytest, and then load the engineering configuration file including the test configuration information corresponding to a variety of test scenarios; that is, all the test configuration information of a variety of test scenarios are placed in the engineering configuration file and loaded, and then the common processing logic in the test configuration information is encapsulated to form a parent class, and a common function is obtained, so as to be called when the page is automatically tested. Compared with the related art, the present application is to set the test configuration information of each scene in the engineering configuration file, and to obtain a common function by encapsulating the common processing logic in the test configuration information, so as to cope with various test scenarios, avoid the need to load different test codes due to different test scenarios, resulting in the problem that some test processes cannot be started or configured, and improve the efficiency of automated testing.

[0091] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0092] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features of the present application.

[0093] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or including (comprising) refer to the existence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or these groups. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method or device including the elements. In this document, each embodiment may focus on the differences from other embodiments, and the same or similar parts between the embodiments may refer to each other. For the methods, devices, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts may refer to the description of the method part.

[0094] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0095] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.

[0096] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. 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 consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

Claims

1. A testing method, characterized in that: include: Loading a project configuration file, wherein the project configuration file includes test configuration information corresponding to multiple test scenarios; Encapsulating the common processing logic in the test configuration information to obtain a common function; the common processing logic includes the same processing logic in a plurality of the test configuration information; The target page is tested using the common function.

2. The method according to claim 1, characterized in that The encapsulating the common processing logic in the test configuration information to obtain a common function includes: In each test code in the plurality of test configuration information, determining the same processing logic between each test code; The same processing logic is encapsulated to obtain the common function.

3. The method according to claim 1, characterized in that: Testing the target page includes testing the page configuration of the target page; Using the common function, a page configuration test is performed on the target page, including: In combination with the common function, recording simulation data during the test; The page configuration of the target page is tested using the simulation data as input data.

4. The method according to claim 1, characterized in that: Testing the target page also includes testing the configuration code generated for the target page; Using the common function, a code generation test is performed on the target page, including: Generate configuration code for the target page; Read the local file and verify the file content corresponding to the configuration code by using regular matching.

5. The method according to claim 1, characterized in that Testing the target page also includes testing the performance of the target page; Using the common function, a performance test is performed on the target page, including: Check whether the current test item of the target page is the target test item; In the case where the current test item is the target test item, generating the configuration code of the target test item by calling a generation interface; The configuration code is verified.

6. The method according to claim 1, characterized in that Testing the target page also includes testing the configuration logic verification of the target page; Using the common function, a configuration logic verification test is performed on the target page, including: Get page configuration data; Verify the configuration logic of the page configuration data by calling the verification interface to obtain a verification result; The verification result is written into the project configuration file, and the verification result in the project configuration file is read and the result is verified by regular matching.

7. The method according to any one of claims 1 to 6, characterized in that After testing the target page using the common function, the method includes: A test log is recorded during the test of the target page.

8. A testing device, characterized in that: include: A loading unit is configured to load a project configuration file; the project configuration file includes test configuration information corresponding to multiple test scenarios; An encapsulation unit is configured to encapsulate the common processing logic in the test configuration information to obtain a common function; the common processing logic includes the same processing logic in the test configuration information; The testing unit is configured to test the target page using the common function.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.