A method, apparatus, electronic device, and storage medium for testing mini-programs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-01-19
- Publication Date
- 2026-05-26
AI Technical Summary
Existing mini-program debugging tools only allow developers to manually switch accounts or log in to different devices to conduct tests, which seriously affects testing efficiency and accuracy.
This paper provides a method for testing mini-programs. By determining the attribute information of the test users, it automatically triggers the corresponding interface combination to form a test user scenario, calls the matching user data for testing, and reduces manual intervention.
It improved the testing efficiency of mini-programs, increased the accuracy of testing, reduced development costs, and improved development efficiency.
Smart Images

Figure CN114816970B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to mini-program testing technology, and more particularly to mini-program testing methods, apparatus, electronic devices, and storage media. Background Technology
[0002] A mini program is an application that can be used without downloading or installation, and it can run on cross-platform clients. The biggest advantage of mini programs is their ease of use; users can open the application simply by scanning a QR code or searching, without manually installing it on their device's operating system, thus solving the problem of installing too many applications on a single device. However, when developers use multiple accounts to debug mini programs, the debugging tools provided by the relevant technologies only allow developers to manually switch accounts or switch devices logged into different accounts for testing, which severely impacts testing efficiency and accuracy. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for testing mini-programs, which can automatically respond to the mini-program testing process, trigger different interfaces to combine, form corresponding test user scenarios, and call matching user data to test the mini-program in the corresponding test user scenario. This can effectively improve the testing efficiency of mini-programs, reduce the manual testing process, improve the accuracy of testing, reduce development costs, and improve the development efficiency of mini-programs.
[0004] The technical solution of this invention is implemented as follows:
[0005] This invention provides a method for testing mini-programs, including:
[0006] Determine the attribute information of test users in the mini-program testing environment;
[0007] Based on the test user attribute information, a matching interface is determined, wherein each interface corresponds to a unique test user attribute information;
[0008] In response to the mini-program testing process, different interfaces are triggered and combined to form corresponding test user scenarios;
[0009] Based on the different interfaces triggered, the matching user data is called to test the mini-program in the corresponding test user scenario.
[0010] This invention also provides a mini-program testing device, the device comprising:
[0011] The information processing module is used to determine the attribute information of test users in the mini-program testing environment;
[0012] The information processing module is used to determine the matching interface based on the test user attribute information, wherein each interface corresponds to a unique test user attribute information.
[0013] The information processing module is used to respond to the mini-program testing process, trigger different interfaces to combine and form corresponding test user scenarios;
[0014] The testing module is used to call matching user data to test the mini-program in the corresponding test user scenario based on different triggered interfaces.
[0015] In the above scheme,
[0016] The information processing module is used to determine test user attribute information that matches the type of the mini-program based on the type of the mini-program.
[0017] The information processing module is used to determine the interface that matches each type of test user attribute based on the test user attribute information that matches the type of the mini-program.
[0018] In the above scheme,
[0019] The information processing module is used to respond to the mini-program testing process, trigger at least one interface, and form a single test scenario.
[0020] The information processing module is used to respond to the mini-program testing process, trigger at least two interfaces to form different test scenarios, and adjust the order of the different test scenarios to adapt to the test user attribute information.
[0021] In the above scheme,
[0022] The information processing module is used to call matching user data based on the different interfaces triggered.
[0023] The information processing module is used to execute the corresponding mini-program test cases based on the user data invoked, and to obtain the execution results of the mini-program test cases;
[0024] The information processing module is used to present the execution results of the mini-program test cases in the corresponding test user scenarios in the interactive interface through test scripts.
[0025] In the above scheme,
[0026] The information processing module is used to obtain a virtual test account for logging into the mini-program server and to present the virtual test account in the interactive interface of the mini-program test.
[0027] The information processing module is used to respond to the selection operation for the virtual test account, log in to the mini-program server based on each selected virtual test account, and display the mini-program window in the login state in the interactive interface.
[0028] The information processing module is used to respond to a test request for the mini-program and display the debugging information output when the test cases are executed in the mini-program window.
[0029] In the above scheme,
[0030] The information processing module is used to present an automated test status component in the interactive interface, so as to respond to test requests for the mini-program through the automated test status component.
[0031] The information processing module is used to present a login status component in the interactive interface, so as to control the login and logout of testers and detect login information through the target verification method through the login status component;
[0032] The information processing module is used to present a message notification component in the interactive interface, so as to control the transmission of the mini-program test results through the message notification component.
[0033] In the above scheme,
[0034] The information processing module is used to obtain the virtual test account used to log in to the mini-program server during the mini-program testing process;
[0035] The information processing module is used to obtain historical debugging data of the mini-program from the mini-program server, and determine a virtual test account for logging into the mini-program server based on the historical debugging data of the mini-program.
[0036] In the above scheme,
[0037] The information processing module is used to monitor the testing process of the mini-program in the corresponding test user scenario;
[0038] The information processing module is used to send test results to the instant messaging client when abnormal information is detected in the mini-program, and to continuously test the mini-program.
[0039] In the above scheme,
[0040] The information processing module is used to determine a test failure handling strategy that matches the type of the mini-program based on the type of the mini-program.
[0041] The testing module is used to trigger a corresponding test failure handling strategy when abnormal information is detected in the mini-program, and to adjust the testing process of the mini-program so as to continuously execute the corresponding mini-program test cases.
[0042] In the above scheme,
[0043] The information processing module is used to generate a test report for the mini-program based on the test results of the mini-program.
[0044] The information processing module is used to send the test report to at least one preset address that matches the mini-program test process, based on the configuration information of the mini-program test process.
[0045] In the above scheme,
[0046] The information processing module is used to determine the activity list that matches the reading application mini-program when the mini-program is a reading application mini-program;
[0047] The information processing module is used to adjust the corresponding test user attribute information according to the activity list;
[0048] The information processing module is used to trigger the message interface and general interface corresponding to the reading application mini-program based on the test user attribute information, so as to receive interactive messages from the target user through the message interface and obtain the target user's historical data through the general interface.
[0049] In the above scheme,
[0050] The information processing module is used to monitor the execution results of the test cases of the reading application mini-program;
[0051] The information processing module is used to adjust the display content of the reading application mini-program presented in the interactive interface based on the execution results of the test cases of the reading application mini-program.
[0052] The information processing module is used to acquire the target user's historical data and adjust the display order of the reading application mini-program based on the target user's historical data.
[0053] In the above scheme,
[0054] The information processing module is used to configure a payment link that matches the reading application mini-program based on the activity list that matches the reading application mini-program.
[0055] The information processing module is used to make payments for the corresponding activities in the activity list through a payment link that matches the reading application mini-program when the payment control component of the reading application mini-program is triggered.
[0056] This invention also provides an electronic device, the electronic device comprising:
[0057] Memory, used to store executable instructions;
[0058] The processor, when running executable instructions stored in the memory, implements a preceding small program testing method.
[0059] This invention also provides a computer-readable storage medium storing executable instructions, characterized in that the executable instructions, when executed by a processor, implement a preceding small program testing method.
[0060] The embodiments of the present invention have the following beneficial effects:
[0061] By determining the test user attribute information in the mini-program testing environment; based on the test user attribute information, determining the matching interface, wherein each interface corresponds to a unique test user attribute information; responding to the mini-program testing process, triggering different interfaces to combine and form corresponding test user scenarios; based on the different triggered interfaces, calling the matching user data to test the mini-program in the corresponding test user scenario, the testing efficiency of mini-programs can be effectively improved, the manual testing process can be reduced, the accuracy of testing can be improved, the development cost can be reduced, and the development efficiency of mini-programs can be increased. Attached Figure Description
[0062] Figure 1 This is a schematic diagram illustrating a usage scenario of the mini-program testing method provided in this embodiment of the invention;
[0063] Figure 2 A schematic diagram of the composition structure of an electronic device provided in an embodiment of the present invention;
[0064] Figure 3 A schematic diagram of an optional process for the mini-program testing method provided in this embodiment of the invention;
[0065] Figure 4 A schematic diagram of an optional process for the mini-program testing method provided in this embodiment of the invention;
[0066] Figure 5 A schematic diagram of an optional process for the mini-program testing method provided in this embodiment of the invention;
[0067] Figure 6 This is a schematic diagram of the data structure representing a lexical unit in an embodiment of the present invention;
[0068] Figure 7 This is a schematic diagram of the syntax parsing unit processing flow in an embodiment of the present invention;
[0069] Figure 8 This is a schematic diagram of the data structure of the mini-program testing module in an embodiment of the present invention;
[0070] Figure 9 A schematic diagram of an optional process for the mini-program testing method provided in this embodiment of the invention;
[0071] Figure 10 This is a schematic diagram illustrating the display effect of the mini-program testing method in an embodiment of the present invention;
[0072] Figure 11 This is a schematic diagram illustrating the display effect of the mini-program testing method in an embodiment of the present invention;
[0073] Figure 12 This is a schematic diagram illustrating the display effect of the mini-program testing method in an embodiment of the present invention. Detailed Implementation
[0074] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0075] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0076] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.
[0077] 1) In response to, used to indicate the conditions or states on which the operation performed depends. When the conditions or states on which it depends are met, one or more operations performed may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0078] 2) Test Case: A test case is used to execute a test function. For example, in a game, purchasing specific equipment or releasing a specific skill can be used as a test case.
[0079] 3) Test script: Test scripts can automatically execute all or part of the test process. For example, the logical order of the tests can be written in the test script, and the tests will be executed in the written order when the test is executed automatically.
[0080] 4) A Mini Program is a program developed using a front-end-oriented language (such as JavaScript) and implemented within a Hyper Text Markup Language (HTML) page. It is downloaded by a client (such as a browser or any client with an embedded browser engine) via a network (such as the Internet) and interpreted and executed within the client's browser environment, saving the step of installation on the client side. For example, a Mini Program can be activated via voice command on a terminal, enabling the download and execution of various services such as airline ticket purchase, task processing and creation, and data display on a social network client.
[0081] 5) Virtual Test Accounts / Real Test Accounts: Virtual test accounts are maintained by the operations and maintenance team of the mini-program server; that is, they are accounts specifically for testing opened in the mini-program backend. Real test accounts, on the other hand, are accounts held by individuals that can log in to the mini-program client (i.e., the client that downloads and runs the mini-program after its launch, such as an instant messaging client) in the mini-program backend. Virtual test accounts can have the same attributes and permissions as real test accounts. Of course, for certain needs (such as security), some restrictions can be imposed. For example, virtual test accounts cannot log in to the instant messaging client, but real test accounts can.
[0082] 6) Integrated Development Environment (IDE): A type of application software that assists in developing computer programs, generally including tools such as code editors, compilers, debuggers, and graphical user interfaces. It integrates code writing, analysis, compilation, and debugging functions into a single development software service. All software or software suites possessing this characteristic can be called an IDE. For example, Microsoft's Visual Studio series, Borland's C++Builder and Delphi series are all IDEs. An IDE program can run independently or in conjunction with other programs. This embodiment of the invention mainly refers to a small program debugging tool.
[0083] Figure 1 This is a schematic diagram illustrating a usage scenario of the mini-program testing method provided in this embodiment of the invention. (See attached image.) Figure 1The terminals (including terminals 10-1 and 10-2) are equipped with corresponding clients capable of performing different functions. Each client (including terminals 10-1 and 10-2) downloads the corresponding target code from the corresponding server 200 via network 300. The terminals connect to the server 200 via network 300, which can be a wide area network (WAN), a local area network (LAN), or a combination of both, using a wireless link for data transmission. The software source code can be program code written in one or more programming languages. The software source code may include program files that execute business logic and test program files that test the program entities executing the business logic. The server 200 can extract the code objects to be tested from the test program files. Additionally, the server 200 can also extract a set of code objects from the program files that execute business logic. Thus, the server 200 can use the code objects to be tested as positive samples and the code objects not to be tested as negative samples. In some embodiments of the present invention, before software testing, testers need to analyze each code object in the software code to filter out the code objects to be tested and those not to be tested. Here, a code object refers to a testable functional module in software. In software code across different programming languages, a code object can be different types of code entities. For example, in C language software code, a code object can be a function. In Java language software code, a code object can be a class, and in iOS Objective-C, it can be a piece of object code. In C++ language software code, a code object can be a class or a function. This application does not further distinguish the specific type of the code (object code) object.
[0084] Before sending the corresponding mini-program to the terminals (terminal 10-1 and / or terminal 10-2) via network 300, server 200 needs to perform corresponding test analyses on various types of mini-programs. As an example, server 200 determines the test user attribute information in the mini-program testing environment; based on the test user attribute information, it determines matching interfaces, where each interface corresponds to unique test user attribute information; in response to the mini-program testing process, it triggers different interfaces to combine and form corresponding test user scenarios; based on the triggered different interfaces, it calls matching user data to test the mini-program in the corresponding test user scenario.
[0085] The structure of the mini-program testing device according to an embodiment of the present invention will be described in detail below. The mini-program testing device can be implemented in various forms, such as a dedicated terminal with mini-program testing device processing function, or an electronic device (mobile phone or tablet computer) with mini-program testing device processing function, for example, the aforementioned Figure 1 Terminal 10-1 or Terminal 10-2. Figure 2 This is a schematic diagram of the composition structure of the mini-program testing device provided in an embodiment of the present invention. It can be understood that... Figure 2 This is only an exemplary structure of the mini-program testing device, not the entire structure; it can be implemented as needed. Figure 2 The structure shown may be part or all of the structure.
[0086] The mini-program testing device provided in this embodiment of the invention includes: at least one processor 201, a memory 202, a user interface 203, and at least one network interface 204. The various components in the mini-program testing device are coupled together via a bus system 205. It can be understood that the bus system 205 is used to implement communication between these components. In addition to a data bus, the bus system 205 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 2 The general labeled all buses as Bus System 205.
[0087] The user interface 203 may include a monitor, keyboard, mouse, trackball, click wheel, buttons, touchpad, or touch screen.
[0088] It is understood that memory 202 can be volatile memory or non-volatile memory, or both. In this embodiment of the invention, memory 202 is capable of storing data to support the operation of a terminal (such as 10-1). Examples of this data include any computer programs used to operate on the terminal (such as 10-1), such as operating systems and applications. The operating system includes various system programs, such as the framework layer, core library layer, driver layer, etc., used to implement various basic services and handle hardware-based tasks. Applications can include various applications.
[0089] In some embodiments, the applet testing device provided in this invention can be implemented using a combination of hardware and software. For example, the applet testing device provided in this invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the applet testing method provided in this invention. For instance, the hardware decoding processor can employ one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0090] As an example of the implementation of the mini-program testing device provided in this embodiment of the invention using a combination of software and hardware, the mini-program testing device provided in this embodiment of the invention can be directly embodied as a combination of software modules executed by the processor 201. The software modules can be located in a storage medium, which is located in the memory 202. The processor 201 reads the executable instructions included in the software modules in the memory 202 and combines them with necessary hardware (e.g., including the processor 201 and other components connected to the bus 205) to complete the mini-program testing method provided in this embodiment of the invention.
[0091] As an example, processor 201 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0092] As an example of the hardware implementation of the applet testing device provided in this embodiment of the invention, the device provided in this embodiment of the invention can be directly executed by a processor 201 in the form of a hardware decoding processor. For example, it can be executed by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components to implement the applet testing method provided in this embodiment of the invention.
[0093] In this embodiment of the invention, the memory 202 is used to store various types of data to support the operation of the mini-program testing device. Examples of such data include: any executable instructions for operation on the mini-program testing device, such as executable instructions, where a program implementing the mini-program testing method of this embodiment of the invention may be included in the executable instructions.
[0094] In other embodiments, the mini-program testing device provided in this invention can be implemented in software. Figure 2A mini-program testing device stored in memory 202 is shown. This device can be software in the form of programs and plugins, and includes a series of modules. As an example of a program stored in memory 202, it may include a mini-program testing device. The mini-program testing device includes the following software modules: an information processing module 2081 and a testing module 2082. When the software modules in the mini-program testing device are read into RAM and executed by processor 201, the mini-program testing method provided in this embodiment of the invention will be implemented. The functions of each software module in the mini-program testing device include:
[0095] Information processing module 2081 determines the attribute information of test users in the mini-program test environment.
[0096] The information processing module 2081 is used to determine the matching interface based on the test user attribute information, wherein each interface corresponds to a unique test user attribute information.
[0097] The information processing module 2081 is used to determine event parameters that match the target game.
[0098] The information processing module 2081 is used to respond to the mini-program testing process by triggering different interfaces to combine and form corresponding test user scenarios.
[0099] Test module 2082 is used to call matching user data to test the mini-program in the corresponding test user scenario based on different triggered interfaces.
[0100] according to Figure 2 The electronic device shown, in one aspect of this application, also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform various alternative implementations of the above-described applet testing method, including different embodiments and combinations thereof.
[0101] Combination Figure 2 The server 20 shown illustrates the applet testing method provided in this embodiment of the invention. See also: Figure 3 , Figure 3 This is an optional flowchart illustrating the mini-program testing method provided in this embodiment of the invention. It can be understood that... Figure 3 The steps shown can be performed by various servers running the mini-program testing device, such as dedicated terminals, servers, or server clusters with mini-program testing capabilities. The following section addresses... Figure 3 The steps shown are explained.
[0102] Step 301: Determine the test user attribute information in the mini-program test environment.
[0103] For different types of mini-programs, various test user attribute information can be separated into their own independent interfaces, such as login data interface, welfare collection data interface, and other types of interfaces. By combining and calling specific interfaces to adjust user data, different user scenarios can be formed. During mini-program memory testing, multiple rounds of automated testing are carried out by calling interfaces to switch user data, ultimately achieving a test path that covers different user scenarios.
[0104] Step 302: Based on the test user attribute information, determine the matching interface.
[0105] Each interface corresponds to a unique set of test user attribute information.
[0106] Step 303: In response to the mini-program testing process, different interfaces are triggered and combined to form corresponding test user scenarios.
[0107] Specifically, it can respond to the mini-program testing process by triggering at least one interface to form a single test scenario; or it can respond to the mini-program testing process by triggering at least two interfaces to form different test scenarios, and the order of the different test scenarios can be adjusted to adapt to the test user attribute information. Taking a reading mini-program that is an instant messaging client as an example, the reading mini-program project of the instant messaging client includes an H5 project with a large number of e-books (e.g., e-books, e-novels). Each e-book in these H5 projects can correspond to a URL (Uniform Resource Locator) address. Each URL address can be used to access the target page (i.e., H5 page) of a specific e-book. In the development and testing of a reading mini-program on an instant messaging client, to test the compatibility of the target pages corresponding to these URLs on different devices, it is necessary to test the reading mini-program on the instant messaging client. In response to the mini-program testing process, an interface is triggered to simulate a test scenario where the user is a new reader, and the reading mini-program on the instant messaging client is tested through corresponding test cases. Of course, at least two interfaces can also be triggered to form different test scenarios, simulating test scenarios for new readers, old users, and guest users, respectively.
[0108] Step 304: Based on the different interfaces triggered, call the matching user data to test the mini-program in the corresponding test user scenario.
[0109] In some embodiments of the present invention, based on different triggered interfaces, matching user data is invoked to test the mini-program in the corresponding test user scenario. This can be achieved in the following ways:
[0110] Based on the different triggered interfaces, matching user data is invoked; using the invoked user data, corresponding mini-program test cases are executed, and the execution results of the mini-program test cases are obtained; through test scripts, the execution results of the mini-program test cases in the corresponding test user scenario are presented in the interactive interface. Specifically, when obtaining test cases, the terminal can send corresponding download requests to the server to obtain different target codes, whereby the target code can be encapsulated in different test cases, and the server obtains the corresponding test cases based on the different download requests from the terminal.
[0111] Step 305: Monitor the testing process of the mini-program in the corresponding test user scenario.
[0112] Step 306: When an abnormal message is detected in the mini-program, send the test result to the instant messaging client and continue to test the mini-program.
[0113] refer to Figure 4 During the testing of a mini-program, the testing process can be monitored in the corresponding test user scenarios; when an abnormal message is detected in the mini-program, the test result is sent to the instant messaging client, such as... Figure 4As shown, test results corresponding to different test scenarios can be presented in the instant messaging client, such as: new user automated test passed, App active user automated test passed, and mini-program active user automated test passed. In some embodiments of the present invention, test results sent after the mini-program executes the mini-program test process can be obtained, wherein the test results at least characterize the startup characteristics of the mini-program in the online running environment; based on the test results, the startup characteristics of the mini-program are analyzed and processed to obtain startup analysis results; adjustment instructions for the startup analysis results are received through the instant messaging client; according to the adjustment instructions for the startup analysis results, the mini-program is continuously tested until the adjustment instructions for the startup analysis results are stopped being received through the instant messaging client. In this test, the mini-program executes a preset test process without requiring user interface operations. Instead, it directly performs a cold start of the instant messaging application and executes the mini-program's startup command. Therefore, compared to testing by simulating UI operations, the testing process is simpler, requires less waiting time, and can accurately obtain the startup characteristics corresponding to the startup command. This avoids errors caused by other irrelevant operations (such as triggering splash screen ads or pop-ups in the mini-program on the instant messaging client during the testing phase), improving the accuracy of the test results. Simultaneously, it automatically batches opening and closing mini-programs, collecting startup characteristics during the startup process, obtaining startup analysis results, and continuously testing the mini-program until adjustments based on the startup analysis results are no longer received through the instant messaging client. This ensures the accuracy of the mini-program deployed on the instant messaging client and avoids abnormal information during mini-program promotion due to incomplete testing.
[0114] refer to Figure 5Furthermore, a test report for the mini-program can be generated based on the test results. Based on the configuration information of the mini-program's test process, the test report is sent to at least one preset address matching the mini-program's test process. When the server receives the test report, it can determine the fault tolerance level of the abnormal information in the test within the current version of the mini-program, and determine whether to fix the abnormal information in the current version. It can also predict the fault tolerance level of the abnormal information in other version mini-programs, and accordingly determine whether to fix the abnormal information in other version mini-programs. For example, if the instant messaging client uses a reading mini-program with version number 001, based on the mini-program test report uploaded by the instant messaging client, it can determine whether to fix the mini-program with version number 001 (e.g., by updating the code to version number 002). This can save users the number of times they need to update the mini-program in their instant messaging client, avoiding disruption to normal use due to frequent updates.
[0115] refer to Figure 6 During the testing of a mini-program, a test failure handling strategy matching the mini-program's type can be determined. When an exception is detected in the mini-program, the corresponding test failure handling strategy is triggered, adjusting the testing process to continuously execute the corresponding mini-program test cases. Therefore, manual inspection is unnecessary during mini-program testing, effectively improving testing efficiency. For example... Figure 6 As shown, when interface requests fluctuate, the test failure handling strategy can be configured to automatically retry requests; when the developer tools are unresponsive or the page status is abnormal, the test failure handling strategy can be configured to record the current progress, forcibly close the developer tools, and then reopen them; when the developer tools login status expires, the test failure handling strategy can be configured to send a notification to the test group to log in to the management interface; when the development machine iOA login status expires, the test failure handling strategy can be configured to send a notification to the person in charge of the development machine to log in to iOA.
[0116] refer to Figure 7 In some embodiments of the present invention, during the testing process, a virtual test account for logging into the mini-program server is obtained and presented in the interactive interface of the mini-program test; in response to the selection operation for the virtual test account, the mini-program server is logged in based on each selected virtual test account, and a mini-program window in the logged-in state is displayed in the interactive interface; in response to a test request for the mini-program, debugging information output when the test cases are executed is displayed in the mini-program window. Wherein, as... Figure 7As shown, the interactive interface presents an automated testing status component to respond to test requests for the mini-program; a login status component to control tester login and logout, and to verify login information via target authentication; and a message notification component to control the transmission of mini-program test results. Therefore, during mini-program testing, to facilitate observation of test logs and management of test status such as login and network status of the development machine, the following can be achieved: Figure 7 The web-based visual interface shown allows for remote management. The web interface includes a "Run Test" button; by clicking this button, testers can send commands to the development machine to control it to run tests, log into developer tools, and enable test result notifications. This is achieved through triggering... Figure 7 The login status component in the system can be like... Figure 8 As shown, login information is verified using a QR code.
[0117] The following uses a reading application mini-program (such as a reading mini-program in an instant messaging client) as an example to illustrate the mini-program testing method provided by this invention. (Refer to...) Figure 9 , Figure 9 This is an optional flowchart illustrating the mini-program testing method provided in this embodiment of the invention. It can be understood that... Figure 9 The steps shown can be executed by various servers running the mini-program testing device, such as dedicated terminals, servers, or server clusters with mini-program testing capabilities. During the testing process, the instant messaging client's reading mini-program is configured with over 50 independent pages and multiple global modules. These global modules, interspersed across multiple pages, are frequently modified passively due to business changes, making it difficult for developers to perceive the impact on these modules. Furthermore, mini-programs themselves have frequent version iterations. Therefore, traditional manual testing of mini-programs is not only time-consuming but also prone to missing test points. Simulating different usage scenarios, manual testing, and account switching rely heavily on the testers' experience and familiarity with the business. For a given scenario, determining the differences between different accounts based solely on manual judgment is prone to errors and struggles to cover all user paths. The following section addresses... Figure 9 The steps shown are explained.
[0118] Step 901: Start the automated testing process through the management interface or by running the script directly.
[0119] Among them, reference Figure 10 , Figure 10This is a schematic diagram illustrating the display effect of the mini-program testing method in this embodiment of the invention. When the mini-program is a reading application mini-program, a list of activities matching the reading application mini-program can be determined; based on the activity list, the corresponding test user attribute information is adjusted; based on the test user attribute information, the message interface and general interface corresponding to the reading application mini-program are triggered, for example... Figure 10 The activity list shown includes three activities: "Daily Q&A", "Reading Team", and "Double". Interactive messages from target users can be received through the message interface, and historical data of target users can be obtained through the general interface to enable testing of each of the three activities in the activity list.
[0120] Step 902: Check if the test cases are written in accordance with the specifications. If yes, proceed to step 903; otherwise, proceed to step 904.
[0121] Step 903: Present the problem and end the mini-program testing process.
[0122] Step 904: Set the current user's scenario.
[0123] In use, requests can be sent to modify user attributes. For different types of mini-program tests, there are multiple preset user scenarios, which are executed sequentially.
[0124] Step 905: Determine whether the user scenario has been set successfully. If yes, proceed to step 906; otherwise, proceed to step 907.
[0125] Step 906: Enter the testing process.
[0126] The testing process can be implemented using the Jest framework. For details, refer to... Figure 11 and Figure 12 , Figure 11 This is a schematic diagram illustrating the display effect of the mini-program testing method in an embodiment of the present invention; Figure 12 This is a schematic diagram illustrating the display effect of the mini-program testing method in this embodiment of the invention; wherein, the execution results of the test cases of the reading application mini-program can be monitored; based on the execution results of the test cases of the reading application mini-program, the display content of the reading application mini-program presented in the interactive interface is adjusted; historical data of the target user is obtained, and the display order of the reading application mini-program is adjusted according to the historical data of the target user. For example, for target user A, the display content and display order of the reading application mini-program ( Figure 11 The content and order of the display results of the application mini-program read by user A are compared. Figure 12The display effects of the mini-programs are different from those of the reading app, allowing users to experience a display effect more suited to their own usage habits. Furthermore, since users of the reading app mini-program may have a need to purchase e-books, a payment link matching the reading app mini-program can be configured based on the activity list. When the payment control component of the reading app mini-program is triggered, payment is made for the corresponding activity in the activity list through the payment link matching the reading app mini-program, providing users with a better user experience.
[0127] Step 907: Configure the test to terminate directly upon failure, output test information to the console, and send a notification message.
[0128] Step 908: Launch the Mini Program developer tools for testing.
[0129] The startup and operation of the mini-program developer tool are supported by automator. After starting the mini-program developer tool, you can use the mini-program simulator inside to perform specific testing operations.
[0130] Step 909: Listen to the logs output by the developer tools. If a global exception is detected, send a notification and keep the test process running.
[0131] Step 910: Run the test cases one by one.
[0132] Step 911: Determine if there are any failed test cases and output the test results.
[0133] Thus, the 8 hours of manual testing are effectively reduced to 0.6 hours using the mini-program testing method provided in this application.
[0134] Beneficial technical effects:
[0135] By determining the test user attribute information in the mini-program testing environment; based on the test user attribute information, determining the matching interface, wherein each interface corresponds to a unique test user attribute information; responding to the mini-program testing process, triggering different interfaces to combine and form corresponding test user scenarios; based on the different triggered interfaces, calling the matching user data to test the mini-program in the corresponding test user scenario, the testing efficiency of mini-programs can be effectively improved, the manual testing process can be reduced, the accuracy of testing can be improved, the development cost can be reduced, and the development efficiency of mini-programs can be increased.
[0136] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for testing WeChat Mini Programs, characterized in that, The method includes: Determine the attribute information of test users in the mini-program testing environment; Based on the type of the mini-program, determine the test user attribute information that matches the type of the mini-program; based on the test user attribute information that matches the type of the mini-program, determine the interface that matches each test user attribute, wherein each interface corresponds to unique test user attribute information; In response to the mini-program testing process, at least one interface is triggered to form a single test scenario; or In response to the mini-program testing process, at least two interfaces are triggered to form different test scenarios, and the order of the different test scenarios is adjusted to adapt to the test user attribute information; Based on the different interfaces triggered, the matching user data is called to test the mini-program in the corresponding test user scenario.
2. The method according to claim 1, characterized in that, The process of calling matching user data based on different triggered interfaces to test the mini-program in the corresponding test user scenario includes: Based on the different interfaces triggered, retrieve the corresponding user data; Using the user data that is invoked, the corresponding mini-program test cases are executed, and the execution results of the mini-program test cases are obtained; The test scripts are used to present the execution results of the mini-program test cases in the corresponding test user scenarios in the interactive interface.
3. The method according to claim 1, characterized in that, The method further includes: Obtain a virtual test account for logging into the mini-program server, and present the virtual test account in the interactive interface of the mini-program test; In response to the selection operation for the virtual test account, the mini-program server is logged in based on each selected virtual test account, and a mini-program window in the logged-in state is displayed in the interactive interface. In response to a test request for the mini-program, the debugging information output when the test case is executed is displayed in the mini-program window.
4. The method according to claim 3, characterized in that, The method further includes: An automated test status component is presented in the interactive interface to enable the automated test status component to respond to test requests for the mini-program. The interactive interface presents a login status component to enable control of testers' login and logout, as well as detection of login information through target verification. A message notification component is presented in the interactive interface to control the transmission of mini-program test results.
5. The method according to claim 3, characterized in that, The method further includes: Obtain the virtual test account used to log in to the mini-program server during the mini-program testing process; or, Obtain historical debugging data of the mini-program from the mini-program server, and determine the virtual test account used to log in to the mini-program server based on the historical debugging data of the mini-program.
6. The method according to claim 1, characterized in that, The method further includes: Monitor the testing process of the mini-program in the corresponding test user scenarios; When an error is detected in the mini-program, the test results are sent to the instant messaging client, and the mini-program is continuously tested.
7. The method according to claim 1, characterized in that, The method further includes: Based on the type of the mini-program, determine a test failure handling strategy that matches the type of the mini-program; When an error is detected in the mini-program, the corresponding test failure handling strategy is triggered to adjust the test process of the mini-program so as to continue to execute the corresponding mini-program test cases.
8. The method according to claim 1, characterized in that, The method further includes: Obtain the test results sent after the mini-program executes the mini-program test process, wherein the test results at least characterize the startup features of the mini-program in the online running environment; Based on the test results, the startup characteristics of the mini-program are analyzed and processed to obtain startup analysis results; Receive adjustment instructions based on the startup analysis results via an instant messaging client; Based on the adjustment instructions for the startup analysis results, the mini-program is continuously tested until the adjustment instructions for the startup analysis results are no longer received through the instant messaging client.
9. The method according to claim 1, characterized in that, The method further includes: When the mini-program is a reading application mini-program, determine the list of activities that match the reading application mini-program; Based on the activity list, adjust the corresponding test user attribute information; Based on the test user's attribute information, the message interface and general interface corresponding to the reading application mini-program are triggered to receive interactive messages from the target user through the message interface and obtain the target user's historical data through the general interface.
10. The method according to claim 9, characterized in that, The method further includes: Monitor the execution results of the test cases for the aforementioned reading application mini-program; Based on the execution results of the test cases of the reading application mini-program, the display content of the reading application mini-program presented in the interactive interface is adjusted; Obtain historical data of the target user, and adjust the display order of the reading application mini-program based on the historical data of the target user.
11. The method according to claim 9, characterized in that, The method further includes: Configure a payment link that matches the reading app mini-program based on the list of activities that match the reading app mini-program; When the payment control component of the reading application mini-program is triggered, payment is made for the corresponding activity in the activity list through the payment link that matches the reading application mini-program.
12. A mini-program testing device, characterized in that, The device includes: The information processing module is used to determine the attribute information of test users in the mini-program testing environment; The information processing module is used to determine test user attribute information that matches the type of the mini-program based on the type of the mini-program; and to determine the interface that matches each type of test user attribute based on the test user attribute information that matches the type of the mini-program, wherein each interface corresponds to unique test user attribute information. The information processing module is used to respond to the mini-program testing process, trigger at least one interface, and form a single test scenario. The information processing module is used to respond to the mini-program testing process, trigger at least two interfaces to form different test scenarios, and adjust the order of the different test scenarios to adapt to the test user attribute information. The testing module is used to call matching user data to test the mini-program in the corresponding test user scenario based on different triggered interfaces.
13. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; The processor, when executing executable instructions stored in the memory, implements the applet testing method according to any one of claims 1 to 11.
14. A computer-readable storage medium storing executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the applet testing method according to any one of claims 1 to 11.
15. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the applet testing method according to any one of claims 1 to 11.