Automatic testing method and device, terminal equipment and storage medium
Through automated testing methods, it solves the problems of high labor costs and low testing efficiency when game programs and launchers are frequently modified or updated, achieving rapid testing and efficient development to meet market demand.
Patent Information
- Application Number
- CN202410768390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-23
AI Technical Summary
The existing technology requires a lot of labor costs and low testing efficiency when the game program or launcher is frequently modified or updated. It cannot meet the demand for rapid testing and affects the development process.
Using automated testing methods, by starting the target test program, determining the test object and test type, obtaining the test content, and conducting the test in the target test environment to obtain the test results, reduce labor costs and test time, and improve test efficiency.
It effectively improves the testing efficiency of game programs and launchers, speeds up product launch, improves product quality, meets user and market needs, and reduces labor costs and test environment construction time.
Smart Images

Figure CN118535480A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, terminal device and storage medium for automated testing. Background Art
[0002] The game launcher program is referred to as the launcher. The launcher provides a safe, efficient, and stable gaming environment for the game program. It can also provide installation, downloading, updating, repairing, pre-downloading, pre-updating, and game launching services for the game.
[0003] When providing high-quality game services to players, it is inseparable from the testing of launchers and game programs. In the traditional testing process, it is necessary to manually design test cases according to business needs, and then manually test the game program or launcher based on the test cases to ensure the normal operation of the launcher and game program. However, the above-mentioned testing method will undoubtedly consume a lot of manpower costs when the game program or launcher is frequently modified or frequently updated, and the testing efficiency of the above-mentioned testing method is low, which cannot meet the needs of fast testing of game programs and launchers, thereby affecting the development process of game programs and launchers. Summary of the invention
[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes an automated testing method, apparatus, terminal device, and storage medium, which can reduce the investment in manpower costs and the time for setting up the test environment, thereby effectively improving the testing efficiency of game programs and launchers, speeding up product launch, and improving product quality, thereby better meeting user and market needs.
[0005] In a first aspect, an embodiment of the present application provides a method for automated testing, the method comprising:
[0006] Starting a target test program, and determining a test object and a test type corresponding to the test object according to the target test program;
[0007] Obtaining test content corresponding to the test object;
[0008] Determine the target test environment required by the test object according to the test type, and run the target test environment;
[0009] The test content is tested under the target test environment according to the target test program to obtain a target test result corresponding to the test content under the target test environment.
[0010] In some optional embodiments, the starting the target test program includes:
[0011] Determine the initial test program based on the test cases;
[0012] responding to a test instruction and determining the target test program from the initial test program according to the test instruction;
[0013] The target test program is started according to the test instruction.
[0014] In some optional embodiments, the test type is a special test, and determining the target test environment required by the test object according to the test type includes:
[0015] Determining an initial test environment corresponding to the test object according to the test type;
[0016] Obtaining the environmental configuration parameters corresponding to the test object under the special test from the target test program;
[0017] The initial test environment is adjusted according to the environment configuration parameters to obtain the target test environment corresponding to the test object.
[0018] In some optional embodiments, the test type is a compatibility test, and determining the target test environment required by the test object according to the test type includes:
[0019] Obtaining, from the target test program, a target system type corresponding to the target object under the compatibility test;
[0020] The corresponding target virtual machine is called according to the target system type, and the target test environment required by the test object is determined according to the target virtual machine.
[0021] In some optional embodiments, testing the test content in the target test environment according to the target test program to obtain a target test result corresponding to the test content in the target test environment includes:
[0022] Process the test functions corresponding to the target test program in blocks to obtain multiple module test programs;
[0023] Testing the test content in the target test environment according to the module test program to obtain an initial test result corresponding to the test content in the target test environment;
[0024] All the initial test results are merged to obtain the target test result.
[0025] In some optional embodiments, testing the test content in the target test environment according to the module test program to obtain an initial test result corresponding to the test content in the target test environment includes:
[0026] Determine the image capture condition and the target image corresponding to the image capture condition according to the module test program;
[0027] When the test content is run under the target test environment and the image capture condition is met, an operation image corresponding to the test content is obtained;
[0028] Performing a matching operation on the target image and the running image to obtain a similarity between the target image and the running image;
[0029] Determine the initial test result corresponding to the test content in the target test environment according to the similarity.
[0030] In some optional embodiments, when the test object is a target game package, the target test environment includes a target launcher, and obtaining the target launcher includes:
[0031] Determine an initial launcher, and obtain initial game packages corresponding to different game types, wherein the game type is related to the memory size corresponding to the initial game package;
[0032] Performing an automated test on the initial game package in the initial launcher to obtain an environmental test result corresponding to the initial launcher;
[0033] The target initiator is obtained from the initial initiator according to the environmental test result.
[0034] In some optional embodiments, in the process of obtaining the target test result corresponding to the test content under the target test environment, the method further includes:
[0035] Obtain the test log and test video corresponding to the test content in the target test environment;
[0036] The test log and the test video are stored to obtain storage results.
[0037] In some optional embodiments, after obtaining the target test result corresponding to the test content under the test environment, the method further includes:
[0038] Determine an initial display interface corresponding to the target test program;
[0039] Determine the test status corresponding to the target test program according to the target test result;
[0040] The initial display interface is adjusted according to the test status to obtain a target display interface corresponding to the target test program.
[0041] In a second aspect, an embodiment of the present application provides an automated testing device, including:
[0042] A program starting module is configured to start a target test program and determine a test object and a test type corresponding to the test object according to the target test program;
[0043] A content acquisition module, configured to obtain the test content corresponding to the test object;
[0044] An environment setting module, configured to determine a target test environment required by the test object according to the test type, and run the target test environment;
[0045] The data testing module is configured to test the test content in the target testing environment according to the target testing program, and obtain the target testing result corresponding to the test content in the target testing environment.
[0046] In some optional embodiments, the program startup module is further configured to:
[0047] a program design module configured to determine an initial test program according to the test case;
[0048] an instruction response module, configured to respond to a test instruction and determine the target test program from the initial test programs according to the test instruction;
[0049] The test starting module is configured to start the target test program according to the test instruction.
[0050] In some optional embodiments, the test type is a special test, and the environment setting module is further configured to:
[0051] A first environment preliminary selection module is configured to determine an initial test environment corresponding to the test object according to the test type;
[0052] A parameter determination module is configured to obtain, from the target test program, the corresponding environmental configuration parameters of the test object under the special test;
[0053] The first environment determination module is configured to adjust the initial test environment according to the environment configuration parameters to obtain the target test environment corresponding to the test object.
[0054] In some optional embodiments, the test type is a compatibility test, and the environment setting module is further configured to:
[0055] A second environment preliminary selection module is configured to obtain a target system type corresponding to the target object under the compatibility test from the target test program;
[0056] The second environment determination module is configured to call a corresponding target virtual machine according to the target system type, and determine the target test environment required by the test object according to the target virtual machine.
[0057] In some optional embodiments, the data testing module is further configured to:
[0058] A block processing module is configured to process the test functions corresponding to the target test program in blocks to obtain multiple module test programs;
[0059] A data testing module is configured to test the test content under the target test environment according to the module testing program, and obtain an initial test result corresponding to the test content under the target test environment;
[0060] The result fusion module is configured to fuse all the initial test results to obtain the target test result.
[0061] In some optional embodiments, the data testing module is further configured to:
[0062] A first data acquisition module is configured to determine a picture capture condition and a target image corresponding to the picture capture condition according to the module test program;
[0063] A second data acquisition module is configured to obtain a running image corresponding to the test content when the test content is run in the target test environment and the image capture condition is met;
[0064] an image calculation module, configured to perform a matching operation on the target image and the running image to obtain a similarity between the target image and the running image;
[0065] The result determination module is configured to determine the initial test result corresponding to the test content in the target test environment according to the similarity.
[0066] In some optional embodiments, when the test object is a target game package, the target test environment includes a target launcher, and the automated test apparatus may be further configured as follows:
[0067] An information determination module is configured to determine an initial launcher and obtain initial game packages corresponding to different game types, wherein the game type is related to a memory size corresponding to the initial game package;
[0068] A data testing module is configured to perform an automated test on the initial game package in the initial launcher to obtain an environmental test result corresponding to the initial launcher;
[0069] The target determination module is configured to obtain the target initiator from the initial initiator according to the environmental test result.
[0070] In some optional embodiments, the data testing module may be further configured as follows:
[0071] An information collection module is configured to obtain a test log and a test video corresponding to the test content in the target test environment;
[0072] The information storage module is configured to store the test log and the test video to obtain storage results.
[0073] In some optional embodiments, the automated testing apparatus may be further configured as follows:
[0074] An initial display interface module, configured to determine an initial display interface corresponding to the target test program;
[0075] A state determination module, configured to determine a test state corresponding to the target test program according to the target test result;
[0076] The target display interface module is configured to adjust the initial display interface according to the test state to obtain a target display interface corresponding to the target test program.
[0077] In a third aspect, an embodiment of the present application provides a terminal device comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can perform the automated testing method described in the first aspect above.
[0078] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the automated testing method as described in the first aspect above.
[0079] According to the method of automated testing of the embodiment of the present application, at least the following beneficial effects are achieved: the method includes starting a target test program, and determining a test object and a test type corresponding to the test object according to the target test program; obtaining the test content corresponding to the test object; determining the target test environment required by the test object according to the test type, and running the target test environment; testing the test content in the target test environment according to the target test program, and obtaining the target test result corresponding to the test content in the target test environment. The method can start the target test program at any time after meeting the test requirements, and determine the test object and the corresponding test type according to the target test program, which helps to select appropriate test methods and tools and improve test efficiency and accuracy. Obtaining the test content corresponding to the test object can help formulate detailed test plans and test cases, ensure comprehensive coverage of test requirements, and improve test quality. Determining the target test environment required by the test object according to the test type can ensure the authenticity and effectiveness of the test, and help simulate the actual operating environment for testing. Then, executing the test content in the target test environment can timely discover potential problems and make accurate assessments, thereby improving the stability and quality of the test object. This method can reduce the investment of labor costs and the time of setting up the test environment, thereby effectively improving the testing efficiency of game programs and launchers, accelerating the speed of product launch, and improving product quality, so as to better meet user and market needs. It also solves the problem that the existing testing methods consume a lot of labor costs and have low testing efficiency when the game program or launcher is frequently modified or updated, and cannot meet the needs of rapid testing of game programs and launchers. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 A schematic diagram of a flow chart of an automated testing method provided by an embodiment of the present invention;
[0081] Figure 2 for Figure 1 A schematic flow chart of sub-step S104 of the automated testing method;
[0082] Figure 3 A schematic diagram of a process for obtaining a target test result provided by an embodiment of the present invention;
[0083] Figure 4 A schematic diagram of an initial game package classification result provided by an embodiment of the present invention;
[0084] Figure 5 A schematic diagram of a display effect of a target display interface provided by an embodiment of the present invention;
[0085] Figure 6 A schematic diagram of the module structure of an automated testing device provided by an embodiment of the present invention;
[0086] Figure 7 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0087] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0088] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0089] In the description of this application, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0090] In the description of this application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution.
[0091] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:
[0092] The game launcher program is referred to as the launcher, which provides services such as installation, downloading, updating, repairing, pre-downloading, pre-updating, and launching games. Game developers push games to the service background, and the launcher provides a safe, efficient, and stable gaming environment for games. To ensure the smooth progress of the game, it is necessary not only to ensure the quality and stability of the launcher program itself, but also to ensure the quality of the game package, so as to provide high-quality services to players.
[0093] In the process of providing high-quality services for games, it is necessary to test the program. In the traditional testing process, the program testing process is to test the program manually based on test cases. This testing method is relatively stable in business, but in the process of frequent program modifications and frequent game updates, it is based on manual testing, which will undoubtedly consume a lot of manpower costs, and the testing process is repetitive. Therefore, the existing testing method will consume a lot of manpower costs and have low testing efficiency when the game program or launcher is frequently modified or frequently updated, and cannot meet the needs of fast testing of game programs and launchers.
[0094] According to the above introduction to the prior art, it can be seen that in the prior art, there are problems such as high labor costs and low testing efficiency, which cannot meet the needs of rapid testing of game programs and launchers.
[0095] In view of the problem in the prior art that frequent modification or update of game programs or launchers consumes a lot of manpower costs and has low testing efficiency, which cannot meet the needs of fast testing of game programs and launchers, the embodiments of the present application provide a method, apparatus, terminal device and storage medium for automated testing.
[0096] In the present application, a method, apparatus, terminal device and storage medium for automated testing are provided, which are described in detail one by one in the following embodiments.
[0097] Reference Figure 1 , Figure 1 A flowchart of an automated testing method provided in an embodiment of the present application, the automated testing method includes but is not limited to the following steps:
[0098] Step S101 : starting a target test program, and determining a test object and a test type corresponding to the test object according to the target test program.
[0099] For example, when the user completes the development of the launcher or game version, and uploads the development results corresponding to the launcher or game version to the test service backend, the target test program corresponding to the launcher or game version will be directly started after the upload is completed, thereby starting to test the uploaded content. The target test program is an automated program written by the tester to test the launcher or game version according to the test case.
[0100] Exemplarily, the target test program may include multiple test programs, and different test programs correspond to different test types of test objects, for example, the test types may include functional testing, performance testing, compatibility testing, special testing, etc. Different test types require different test environments and test requirements.
[0101] It should be noted that the test types may include functional testing, performance testing, compatibility testing, special testing, and other test types. This application does not make specific restrictions, and users can limit themselves according to actual needs.
[0102] In some optional embodiments, starting the target test program includes: determining an initial test program according to a test case; responding to a test instruction and determining the target test program from the initial test program according to the test instruction; and starting the target test program according to the test instruction.
[0103] Exemplarily, detailed test cases are written according to the test requirements. The test cases should cover the functions and boundary conditions of the tested object as comprehensively as possible. An initial test program is written according to the test cases to perform test operations and verify test results. The initial test program may include the execution logic and assertion conditions of the test cases. The initial test program is a program corresponding to different test cases corresponding to different test objects.
[0104] Exemplarily, when the user completes the development of the launcher or game version, and uploads the development results corresponding to the launcher or game version to the test service background, the test service background will send a test instruction, and then respond to the test instruction. The test instruction includes but is not limited to starting the test program, executing specific test cases, etc. Then, according to the received test instruction, the target test program to be executed is determined from the initial test program. The target test program may be a specific test case or test process corresponding to the test object. Therefore, according to the determined target test program, the corresponding target test program is started for testing.
[0105] Specifically, the initial test program is determined according to the test case, the target test program is determined in response to the test instruction, and finally the target test program is started for testing. Such a process helps to improve the flexibility and automation of testing, speed up the execution of testing, improve the efficiency of testing and ensure the integrity of testing.
[0106] Step S102: obtaining the test content corresponding to the test object.
[0107] Exemplarily, the test content is the information to be tested corresponding to the test object. For example, when the test object is a launcher, the test content is the information after the launcher is modified or updated; when the test object is a game, the test object is the program package after the game is modified or new functions are added.
[0108] Exemplarily, after the user completes the development of a launcher or a game version, the development result corresponding to the launcher or the game version is uploaded to the testing service backend, and the development result corresponding to the launcher or the game version is determined as the test content.
[0109] Step S103: determining the target test environment required by the test object according to the test type, and running the target test environment.
[0110] Exemplarily, different test types corresponding to the test object require different target test environments. For example, when the test type is compatibility testing, the target test environment needs to include different test environments so that the test content can be tested in different test environments to achieve the purpose of compatibility with different environment tests. When the test type is performance testing, the target test environment needs to perform performance testing of the test content under specified environmental conditions to achieve the purpose of performance testing of the test content.
[0111] Exemplarily, different test environments are set according to the test type, and then a mapping relationship is established between the test type and the test environment corresponding to the test type. After the test type is determined, a query is performed according to the mapping relationship to obtain the target test environment required for the test object determined by the test type, and the target test environment is run after the target test environment is determined.
[0112] For example, during the testing process, testers often need to prepare different test environments according to different test scenarios. For example, if the test type is compatibility testing, several machines with different operating systems need to be prepared. When the test type is special testing, three different high, medium and low configuration environments need to be prepared for each special test. When the test type is functional testing, a corresponding test environment needs to be prepared for the functional test.
[0113] In some optional embodiments, the test type is a special test, and determining the target test environment required for the test object according to the test type includes: determining an initial test environment corresponding to the test object according to the test type; obtaining environmental configuration parameters corresponding to the test object under the special test from the target test program; and adjusting the initial test environment according to the environmental configuration parameters to obtain the target test environment corresponding to the test object.
[0114] For example, when the test type is a special test, first confirm the specific content and requirements of the special test to be performed, and then determine the initial test environment corresponding to the test object. The initial test environment includes but is not limited to hardware equipment, operating system, network configuration, etc.
[0115] For example, the environment configuration parameters corresponding to the test object under the special test are obtained from the target test program. These parameters may include the memory limit of each disk in the operating system, the use of CPU or GPU, the hardware parameters corresponding to the hardware device, and the network speed in the network configuration.
[0116] Exemplarily, according to the acquired environment configuration parameters, the initial test environment is adjusted to obtain a target test environment corresponding to the test object.
[0117] For example, when doing special tests on the launcher, you need to prepare different high, medium and low configuration environments for each special test, such as high, medium and low configuration environments such as cpu, gpu, network, and hard disk. A common scenario is that you need to frequently prepare low-configuration environments to test the program and check the program performance. For example, in the case of poor cpu, poor network, and poor mechanical hard disk, preparing these environments often requires a lot of resources. After preparing the corresponding operating system, write the corresponding control program to control the machine performance, such as cpu, gpu, disk IO, and network. For example, when simulating disk iO is tight and other programs are long in reading and writing, test the performance of the launcher. Check the performance of the launcher when the cpu and memory are tight. When controlling the network, such as a weak network, specify the network speed to check the performance of the launcher downloading games.
[0118] Specifically, when conducting special tests, the target test environment can meet the test requirements and ensure the accuracy and reliability of the test. Such a process helps to adjust the initial test environment to meet the test requirements for different test types and requirements, and improve the effectiveness and coverage of the test. It also effectively reduces the time to prepare the target test environment, and can more efficiently and accurately obtain the target test environment required by the test object for special tests.
[0119] In some optional embodiments, the test type is a compatibility test, and determining the target test environment required for the test object according to the test type includes: obtaining a target system type corresponding to the target object under the compatibility test from the target test program; calling a corresponding target virtual machine according to the target system type, and determining the target test environment required for the test object based on the target virtual machine.
[0120] Exemplarily, the target system type corresponding to the target object under the compatibility test is obtained from the target test program. For example, test content a needs to support windows7, windows8, windows9, and test content b needs to support windows7, windows8, windows9, mac, etc., and then the target system type corresponding to the target object under the compatibility test is obtained in the target test program.
[0121] For example, a machine with good performance is prepared, and virtualization technology is used to simulate different operating systems using virtual machines on the machine with good performance. This can save machine resources and simulate the environments of different operating systems. Thus, the corresponding target virtual machine is called according to the target system type, and the target virtual machine is determined as the target test environment required by the test object.
[0122] It should be noted that the number of virtual machines that can be obtained by building a virtual environment on a machine with good performance is also limited, and multiple machines can be selected according to the performance needs of their own business. For example, if 10 virtual machines with different operating systems are needed now, and if 1 machine can be split into 7 virtual machines, then two machines need to be deployed to achieve the purpose of setting up 10 virtual machines with different operating systems.
[0123] Specifically, by calling the corresponding target virtual machine according to the target system type, a virtual test environment can be created conveniently to avoid affecting the real system, while providing better environmental isolation and management capabilities. By using the target virtual machine to determine the target test environment required by the test object, the consistency and stability of the test environment are ensured, which helps to improve the reliability and repeatability of the test results. In addition, with the help of virtual machine technology, the target system can be quickly deployed and configured, saving time and cost in setting up the test environment and improving test efficiency. It can also reduce the consumption of hardware equipment and resources, reducing the cost and waste of resources in testing.
[0124] Step S104 , testing the test content in the target test environment according to the target test program to obtain a target test result corresponding to the test content in the target test environment.
[0125] Exemplarily, the test content is tested in the target test environment according to the target test program, and the target test program is executed on the test content to ensure that the test is performed in the target test environment. This includes but is not limited to simulating user operations, sending requests, etc. Furthermore, during the test process, detailed information on the test execution is recorded, including input parameters, output results, execution time, etc. The format and content of the target test results are determined according to the requirements of the test content and the target test program. After obtaining the target test results of the test content in the target test environment, the results are analyzed and compared to verify whether the test content meets expectations and discover potential problems and anomalies.
[0126] In some optional embodiments, such as Figure 2 As shown, the test content is tested under the target test environment according to the target test program to obtain the target test result corresponding to the test content under the target test environment, including sub-steps S1041 to S1043.
[0127] Sub-step S1041, dividing the test functions corresponding to the target test program into blocks to obtain multiple module test programs.
[0128] For example, firstly, a comprehensive analysis is performed on the target test program to understand the test functions and logic contained therein, and to determine the specific content that needs to be processed in blocks. Then, according to the functions and logic of the target test program, it is divided into multiple independent modules, each module corresponding to a specific test function, thereby obtaining a multi-module test program.
[0129] Sub-step S1042: testing the test content in the target test environment according to the module test program to obtain an initial test result corresponding to the test content in the target test environment.
[0130] For example, Figure 3 As shown, after obtaining multiple module test programs, the multiple module test programs are executed in parallel to obtain initial test results corresponding to each module test program of the test content under the target test environment.
[0131] Sub-step S1043: fusing all the initial test results to obtain the target test result.
[0132] Exemplarily, after merging the initial test results corresponding to each module test program, a target test result corresponding to the target test program is obtained.
[0133] Specifically, processing test functions in blocks can make the test process more modular and controllable, thereby improving test efficiency and reducing redundant testing work. In addition, through block processing, it is easier to identify which functions have problems, so that these problems can be located and solved more quickly. Processing test functions in blocks can make test cases easier to maintain and update, because each module is relatively independent, and modifying one module will not affect other modules.
[0134] In some optional embodiments, testing the test content under the target test environment according to the module test program to obtain an initial test result corresponding to the test content under the target test environment includes: determining a picture capture condition and a target image corresponding to the picture capture condition according to the module test program; when the test content is run under the target test environment, obtaining a running image corresponding to the test content when the picture capture condition is met; performing a matching operation on the target image and the running image to obtain a similarity between the target image and the running image; and determining the initial test result corresponding to the test content under the target test environment according to the similarity.
[0135] Exemplarily, according to the requirements of the module test program, the required image capture conditions are determined, including but not limited to the capture position, size, format, and the running step in which the image capture is performed, etc. While determining the image capture conditions, the corresponding target image under the image capture conditions is obtained, that is, the image obtained after the module test program is expected to run under the image capture conditions.
[0136] Exemplarily, the test content is run in the target test environment, and when the image capture condition is met, the image is captured to obtain the corresponding running image. Then, the target image and the running image are matched using an image processing algorithm or an image processing library, and the similarity between the target image and the running image is calculated. Finally, based on the calculation result of the similarity, the initial test result corresponding to the test content in the target test environment is determined. The higher the similarity, the more the test content is executed in accordance with expectations.
[0137] For example, the similarity is compared with a preset value. When the similarity is greater than or equal to the preset value, the initial test result is determined to be a test pass; when the similarity is less than the preset value, the initial test result is determined to be a test fail.
[0138] Specifically, the image capture conditions are determined according to the module test program and the target image is obtained. The running image is captured during operation, and the initial test result is determined by similarity matching. This helps to verify the execution of the test content in the target environment and improve the accuracy and reliability of the test. In addition, the initial test result acquisition method not only solves the problem of code intrusion, but also solves the problem that the automated program graphical interface cannot be recognized. The impact of the automated test-related code on the test results of the module test program is reduced, and the accuracy of the test is improved.
[0139] In some optional embodiments, when the test object is a target game package, the target test environment includes a target launcher, and obtaining the target launcher includes: determining an initial launcher and obtaining initial game packages corresponding to different game types, wherein the game type is related to a memory size corresponding to the initial game package; performing automated testing on the initial game package in the initial launcher to obtain an environmental test result corresponding to the initial launcher; and obtaining the target launcher from the initial launcher according to the environmental test result.
[0140] Exemplarily, when the test object is the target game package, that is, when the test object is the game package corresponding to the game, since the target game package needs the help of the target launcher to run, therefore, when the test object is the target game package, the target test environment corresponding to the test object must also include the target launcher, so as to ensure the accuracy of the test results of the test object.
[0141] For example, the required initial launcher is determined according to the requirements, and the initial game packages corresponding to different game types are obtained. Different game types refer to large-scale games and general games, such as Figure 4 As shown in the figure, the schematic diagram of the initial game package, the initial game packages corresponding to different game types occupy different amounts of memory.
[0142] Exemplarily, the initial game packages of different game types are respectively subjected to automated testing in the initial launcher to obtain environmental test results. For example, in the automated testing program process corresponding to the initial launcher, games of different game types are controlled to perform automated testing of core functions (download, update, repair).
[0143] Exemplarily, if the environmental test results of the initial game packages of all game types in the initial launcher are all passed, the initial launcher is determined as the target launcher.
[0144] For example, in terms of download performance, different game types have different download performances. The download performance of large games is different from that of general games. In large games, too many small files will also affect the program download process, such as decompression time, and proofreading after decompression. After the launcher is packaged, running automated tests for different game types is also part of testing the launcher quality.
[0145] Exemplarily, by using the target launcher as the test basis for the target game package and then testing the core functions of the target game package, the test quality of the target game package can be guaranteed.
[0146] Specifically, according to the environmental test results, the target launcher can be determined more accurately to ensure that the target launcher can operate normally under various circumstances, thereby selecting the best target launcher to provide good support for subsequent testing of the target game package.
[0147] In some optional embodiments, in the process of obtaining the target test results corresponding to the test content in the target test environment, the method further includes: obtaining the test log and test video corresponding to the test content in the target test environment; storing the test log and the test video to obtain the storage results.
[0148] Exemplarily, when the test content is run in the target test environment, a test log and a test video generated during the test content run are obtained. The test log is used to record detailed information of the test, while the test video records the actual running process of the test content.
[0149] For example, a suitable storage device or cloud platform is selected to store the obtained test logs and test videos, ensuring that the test logs and test videos are safe and easy to manage and access, thereby obtaining storage results.
[0150] Exemplarily, it is confirmed that the test log and test video have been successfully stored and can be accessed through a specified path or platform. An index or database can be established to record the stored information for quick retrieval and management of data.
[0151] For example, during the test process corresponding to the test content in the target test environment, test videos and test logs are collected, where the test logs also include running images obtained from test screenshots and other information, thereby facilitating subsequent data query and exception handling.
[0152] Specifically, the test logs and test videos corresponding to the test content in the target test environment are obtained and stored effectively. This helps to record detailed information and problems during the test process, facilitating subsequent analysis, backtracking, and optimization. At the same time, storing test data is also an important measure to ensure data integrity and security.
[0153] In some optional embodiments, after obtaining the target test result corresponding to the test content under the test environment, the method also includes: determining an initial display interface corresponding to the target test program; determining a test status corresponding to the target test program according to the target test result; and adjusting the initial display interface according to the test status to obtain a target display interface corresponding to the target test program.
[0154] Exemplarily, when the target test program is started, an initial display interface corresponding to the target test program is generated in the user interface. After the target test program is run and the target test result is obtained, the test status corresponding to the target test program is determined according to the target test result. The test status may include test pass and test fail, or test success and test failure.
[0155] Exemplarily, the initial display interface is adjusted according to the test state to obtain the target display interface. The adjustment includes modifying the element position, style, content, etc. to conform to the specific test state.
[0156] For example, Figure 5 As shown, when the test status is a successful test, the word "success" is displayed at the corresponding position in the target display interface; when the test status is a failed test, the word "failure" is displayed at the corresponding position in the target display interface.
[0157] Exemplarily, the initial display interface is adjusted according to different test states to obtain the target display interface, so that the user can quickly obtain the test status, thereby improving the user experience and test effect.
[0158] It should be noted that this application does not impose any specific restrictions on determining the style of the target display interface based on the test status, and users can choose according to their actual needs.
[0159] Specifically, by determining the initial display interface and adjusting the initial display interface according to the test status to obtain the target display interface, the user experience can be improved, allowing the user to quickly obtain the test results of the target test program through the target display interface, reducing the user's viewing cost.
[0160] In the method of automated testing provided by the embodiment of the present application, the method includes starting a target test program, and determining a test object and a test type corresponding to the test object according to the target test program; obtaining the test content corresponding to the test object; determining the target test environment required by the test object according to the test type, and running the target test environment; testing the test content in the target test environment according to the target test program, and obtaining the target test result corresponding to the test content in the target test environment. The method can start the target test program at any time after meeting the test requirements, and determine the test object and the corresponding test type according to the target test program, which helps to select appropriate test methods and tools, and improve test efficiency and accuracy. Obtaining the test content corresponding to the test object can help formulate detailed test plans and test cases, ensure comprehensive coverage of test requirements, and improve test quality. Determining the target test environment required by the test object according to the test type can ensure the authenticity and effectiveness of the test, and help simulate the actual operating environment for testing. Then, executing the test content in the target test environment can timely discover potential problems and make accurate assessments, thereby improving the stability and quality of the test object. The method can reduce the investment in labor costs, reduce the time for setting up the test environment, and effectively improve the test efficiency of game programs and launchers, speed up product launch, and improve product quality, so as to better meet user and market needs. It also solves the problem that the existing testing methods consume a lot of manpower costs and have low testing efficiency when the game program or launcher is frequently modified or updated, and cannot meet the needs of fast testing of the game program and launcher.
[0161] Corresponding to the above method embodiment, the present application also provides an embodiment of an automated testing device, Figure 6 FIG. 2 is a schematic diagram showing the structure of an automated testing device 200 according to an embodiment of the present application. Figure 6As shown, the automated testing device 200 includes: a program startup module 201, a content acquisition module 202, an environment setting module 203, and a data testing module 204, wherein the program startup module 201 is configured to start a target test program, and determine a test object and a test type corresponding to the test object according to the target test program; the content acquisition module 202 is configured to obtain the test content corresponding to the test object; the environment setting module 203 is configured to determine a target test environment required for the test object according to the test type, and run the target test environment; the data testing module 204 is configured to test the test content under the target test environment according to the target test program, and obtain a target test result corresponding to the test content under the target test environment.
[0162] In some optional embodiments, the program startup module is further configured to:
[0163] a program design module configured to determine an initial test program according to the test case;
[0164] an instruction response module, configured to respond to a test instruction and determine the target test program from the initial test programs according to the test instruction;
[0165] The test starting module is configured to start the target test program according to the test instruction.
[0166] In some optional embodiments, the test type is a special test, and the environment setting module is further configured to:
[0167] A first environment preliminary selection module is configured to determine an initial test environment corresponding to the test object according to the test type;
[0168] A parameter determination module is configured to obtain, from the target test program, the corresponding environmental configuration parameters of the test object under the special test;
[0169] The first environment determination module is configured to adjust the initial test environment according to the environment configuration parameters to obtain the target test environment corresponding to the test object.
[0170] In some optional embodiments, the test type is a compatibility test, and the environment setting module is further configured to:
[0171] A second environment preliminary selection module is configured to obtain a target system type corresponding to the target object under the compatibility test from the target test program;
[0172] The second environment determination module is configured to call a corresponding target virtual machine according to the target system type, and determine the target test environment required by the test object according to the target virtual machine.
[0173] In some optional embodiments, the data testing module is further configured to:
[0174] A block processing module is configured to process the test functions corresponding to the target test program in blocks to obtain multiple module test programs;
[0175] A data testing module is configured to test the test content under the target test environment according to the module testing program, and obtain an initial test result corresponding to the test content under the target test environment;
[0176] The result fusion module is configured to fuse all the initial test results to obtain the target test result.
[0177] In some optional embodiments, the data testing module is further configured to:
[0178] A first data acquisition module is configured to determine a picture capture condition and a target image corresponding to the picture capture condition according to the module test program;
[0179] A second data acquisition module is configured to obtain a running image corresponding to the test content when the test content is run in the target test environment and the image capture condition is met;
[0180] an image calculation module, configured to perform a matching operation on the target image and the running image to obtain a similarity between the target image and the running image;
[0181] The result determination module is configured to determine the initial test result corresponding to the test content in the target test environment according to the similarity.
[0182] In some optional embodiments, when the test object is a target game package, the target test environment includes a target launcher, and the automated test apparatus may be further configured as follows:
[0183] An information determination module is configured to determine an initial launcher and obtain initial game packages corresponding to different game types, wherein the game type is related to a memory size corresponding to the initial game package;
[0184] A data testing module is configured to perform an automated test on the initial game package in the initial launcher to obtain an environmental test result corresponding to the initial launcher;
[0185] The target determination module is configured to obtain the target initiator from the initial initiator according to the environmental test result.
[0186] In some optional embodiments, the data testing module may be further configured as follows:
[0187] An information collection module is configured to obtain a test log and a test video corresponding to the test content in the target test environment;
[0188] The information storage module is configured to store the test log and the test video to obtain storage results.
[0189] In some optional embodiments, the automated testing apparatus may be further configured as follows:
[0190] An initial display interface module, configured to determine an initial display interface corresponding to the target test program;
[0191] A state determination module, configured to determine a test state corresponding to the target test program according to the target test result;
[0192] The target display interface module is configured to adjust the initial display interface according to the test state to obtain a target display interface corresponding to the target test program.
[0193] The above is a schematic scheme of an automated testing device of this embodiment. It should be noted that the technical scheme of the automated testing device and the technical scheme of the automated testing method described above are of the same concept, and the details of the technical scheme of the automated testing device that are not described in detail can be found in the description of the technical scheme of the automated testing method described above.
[0194] like Figure 7 As shown, Figure 7 The structure block diagram of a terminal device 700 provided according to an embodiment of the present application is shown. The components of the terminal device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0195] The terminal device 700 also includes an access device 740, which enables the terminal device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a global interconnection for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0196] In one embodiment of the present application, the above components of the terminal device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7 The electronic device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0197] The terminal device 700 may be any type of stationary or mobile electronic device, including a mobile computer or mobile electronic device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable electronic device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary electronic device such as a desktop computer or a PC. The terminal device 700 may also be a mobile or stationary server.
[0198] The processor 720 is used to execute computer executable instructions of the object processing method.
[0199] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the object processing method described above are of the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the object processing method described above.
[0200] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the above-mentioned automated testing method is implemented.
[0201] As a non-transient computer-readable storage medium, the memory can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and are implemented to be located in one place, or may also be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0202] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0203] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the above implementation mode. Technical personnel familiar with the field can also make various equivalent modifications or substitutions under the shared conditions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A method for automated testing, characterized in that: The method comprises: Starting a target test program, and determining a test object and a test type corresponding to the test object according to the target test program; Obtaining test content corresponding to the test object; Determine the target test environment required by the test object according to the test type, and run the target test environment; The test content is tested under the target test environment according to the target test program to obtain a target test result corresponding to the test content under the target test environment.
2. The method according to claim 1, characterized in that The starting target test program includes: Determine the initial test program based on the test cases; responding to a test instruction and determining the target test program from the initial test program according to the test instruction; The target test program is started according to the test instruction.
3. The method according to claim 1, characterized in that: The test type is a special test, and determining the target test environment required by the test object according to the test type includes: Determining an initial test environment corresponding to the test object according to the test type; Obtaining the environmental configuration parameters corresponding to the test object under the special test from the target test program; The initial test environment is adjusted according to the environment configuration parameters to obtain the target test environment corresponding to the test object.
4. The method according to claim 1, characterized in that: The test type is a compatibility test, and determining the target test environment required by the test object according to the test type includes: Obtaining, from the target test program, a target system type corresponding to the target object under the compatibility test; The corresponding target virtual machine is called according to the target system type, and the target test environment required by the test object is determined according to the target virtual machine.
5. The method according to claim 1, characterized in that The testing the test content under the target test environment according to the target test program to obtain a target test result corresponding to the test content under the target test environment includes: Process the test functions corresponding to the target test program in blocks to obtain multiple module test programs; Testing the test content in the target test environment according to the module test program to obtain an initial test result corresponding to the test content in the target test environment; All the initial test results are merged to obtain the target test result.
6. The method according to claim 5, characterized in that The step of testing the test content under the target test environment according to the module test program to obtain an initial test result corresponding to the test content under the target test environment includes: Determine the image capture condition and the target image corresponding to the image capture condition according to the module test program; When the test content is run under the target test environment and the image capture condition is met, an operation image corresponding to the test content is obtained; Performing a matching operation on the target image and the running image to obtain a similarity between the target image and the running image; Determine the initial test result corresponding to the test content in the target test environment according to the similarity.
7. The method according to claim 1, characterized in that When the test object is a target game package, the target test environment includes a target launcher, and obtaining the target launcher includes: Determine an initial launcher, and obtain initial game packages corresponding to different game types, wherein the game type is related to the memory size corresponding to the initial game package; Performing an automated test on the initial game package in the initial launcher to obtain an environmental test result corresponding to the initial launcher; The target initiator is obtained from the initial initiator according to the environmental test result.
8. The method according to any one of claims 1 to 7, characterized in that In the process of obtaining the target test result corresponding to the test content under the target test environment, the method further includes: Obtain the test log and test video corresponding to the test content in the target test environment; The test log and the test video are stored to obtain storage results.
9. The method according to any one of claims 1 to 7, characterized in that: After obtaining the target test result corresponding to the test content under the test environment, the method further includes: Determine an initial display interface corresponding to the target test program; Determine the test status corresponding to the target test program according to the target test result; The initial display interface is adjusted according to the test status to obtain a target display interface corresponding to the target test program.
10. An automated testing device, characterized in that: include: A program starting module is configured to start a target test program and determine a test object and a test type corresponding to the test object according to the target test program; A content acquisition module, configured to obtain the test content corresponding to the test object; An environment setting module, configured to determine a target test environment required by the test object according to the test type, and run the target test environment; The data testing module is configured to test the test content in the target testing environment according to the target testing program, and obtain the target testing result corresponding to the test content in the target testing environment.
11. A terminal device, characterized in that: The terminal device includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the automated testing method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the steps of the automated testing method according to any one of claims 1 to 9.
