Automated testing method, device, terminal and storage medium
By configuring test case sets and automated regression testing on the continuous integration platform, the problems of high labor cost and scenario omissions of regression testing are solved, and efficient execution of automated tests is achieved.
Patent Information
- Application Number
- CN202211152343.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-09-21
AI Technical Summary
In the prior art, regression testing requires artificial control, which consumes labor costs and is prone to missed testing scenarios.
Configure test case sets on the continuous integration platform, automatically obtain test environment and code files, trigger regression testing instructions, generate test reports, and implement automated regression testing.
There is no need for manual control of the test process, which avoids omission of test scenarios and saves labor costs.
Smart Images

Figure CN115481030B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an automated testing method, device, terminal, and storage medium. Background Art
[0002] Regression testing refers to retesting old code after modifying it to confirm that the modification has not introduced new errors or caused errors in other codes. Automated regression testing will significantly reduce the cost of system testing, maintenance and upgrades.
[0003] In the existing technology, when performing regression testing, testers need to log in to the platform, select the corresponding regression test case set, and then manually trigger the execution of the case. The entire testing process requires manual control, which consumes a lot of manpower costs. In addition, when the test enters the regression stage and the developer is still changing the code without notifying the tester, it is easy to cause the omission of test scenarios. Summary of the Invention
[0004] The embodiments of the present application provide an automated testing method, device, terminal and storage medium that can be used in financial technology or other related fields to solve the problems existing in the above-mentioned background technology.
[0005] In a first aspect, an embodiment of the present application provides an automated testing method, the method comprising:
[0006] Configuring a test case set for an application requiring automated regression testing in a continuous integration platform, and obtaining at least one associated test environment based on an application identifier of the application;
[0007] determining an application version to be tested of the application program, and determining a target test environment from the test environments based on the application version;
[0008] Determine the source code link address of the application program, and retrieve a branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested;
[0009] Triggering the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calling the test interface corresponding to the test case set;
[0010] Perform regression testing on the test interface based on the target test environment and the branch code file, obtain regression test results of the test interface and generate a regression test report.
[0011] In some embodiments, configuring a test case set for an application requiring automated regression testing in a continuous integration platform, and obtaining at least one associated test environment based on an application identifier of the application, includes:
[0012] Determine the test interfaces to be tested, configure a test case for each of the test interfaces to be tested, and sort all the test cases according to a preset test order;
[0013] According to the sorting results, the test cases are grouped into a test case set.
[0014] In some embodiments, triggering the regression test instruction of the continuous integration platform based on the test case set, wherein the continuous integration platform calls the test interface corresponding to the test case set, includes:
[0015] The continuous integration platform receives a code version sealing message for the application program under the application version;
[0016] Based on the code version closure message, the continuous integration platform is triggered to execute a regression test instruction based on the test case set.
[0017] In some embodiments, the method further comprises:
[0018] Creating a plan on the continuous integration platform, the plan including application information and release information, the application information including at least the application identifier, the application version, the source code link address, and the branch code file, and the release information including at least the release type and release method;
[0019] A plan sheet identification number of the plan sheet is generated, and the plan sheet is published based on the publishing information and the plan sheet identification number.
[0020] In some embodiments, performing regression testing on the test interface based on the target test environment and the branch code file, obtaining regression test results of the test interface and generating a regression test report includes:
[0021] Based on the plan sheet identification number, obtaining the plan sheet;
[0022] Regression testing is performed on the test interface based on the plan and the target test environment.
[0023] In some embodiments, performing regression testing on the test interface based on the target test environment and the branch code file, obtaining regression test results of the test interface and generating a regression test report includes:
[0024] Obtaining a test result of the test interface corresponding to each test case in the test case set, wherein the test result includes a pass or fail;
[0025] Counting the number of all test cases in the test case set as a first number, and counting the number of test cases with passed test results as a second number;
[0026] A regression test report for the test case set is generated based on each of the test results and the ratio of the second number to the first number.
[0027] In some embodiments, after performing regression testing on the test interface based on the target test environment and the branch code file, obtaining regression test results of the test interface, and generating a regression test report, the method further includes:
[0028] Determine the test pass rate of the test case set based on the regression test report, and compare the test pass rate with a preset pass rate;
[0029] When the test pass rate is lower than the preset pass rate, the production release of the application is automatically blocked, and the regression test report is sent to a preset email address.
[0030] In a second aspect, an embodiment of the present application provides an automated testing device, the device comprising:
[0031] A configuration unit, configured to configure a test case set for an application requiring automated regression testing in a continuous integration platform, and to obtain at least one associated test environment according to an application identifier of the application;
[0032] a determining unit, configured to determine an application version to be tested of the application program, and determine a target test environment from the test environments based on the application version;
[0033] a retrieval unit, configured to determine a source code link address of the application program, and retrieve a branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested;
[0034] A triggering unit, configured to trigger the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set;
[0035] The testing unit is used to perform regression testing on the test interface based on the target test environment and the branch code file, obtain the regression test results of the test interface and generate a regression test report.
[0036] In a third aspect, an embodiment of the present application further provides a terminal, comprising a memory and a processor, wherein the memory is used to store instructions and data, and the processor is used to execute the above-mentioned automated testing method.
[0037] In a fourth aspect, an embodiment of the present application further provides a storage medium, wherein a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute the above-mentioned automated testing method.
[0038] The automated testing method in the embodiment of the present application is based on the connection between the continuous integration platform and other platforms, and can obtain the information required for testing configuration, configure the test case set, determine the test environment, and call the test interface on the continuous integration platform. It can also trigger the regression test instructions of the continuous integration platform based on the test case set to perform automated regression testing on the test interface. After the information of the automated regression test is deployed on the continuous integration platform, the regression test is automatically triggered and implemented, without the need for manual control of the test process, avoiding omission of test scenarios and saving labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 This is a schematic diagram of the structure of a platform framework provided by an embodiment of the present application;
[0041] Figure 2 This is a flowchart of an automated testing method provided in an embodiment of the present application.
[0042] Figure 3 This is a structural diagram of an automated testing device provided in an embodiment of the present application.
[0043] Figure 4 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0045] The embodiments of the present application provide an automated testing method, apparatus, terminal, and storage medium. After the information of automated regression testing is deployed on a continuous integration platform, regression testing can be automatically triggered and implemented without manual control of the testing process, thereby avoiding omission of test scenarios and saving labor costs. The automated testing method, apparatus, terminal, and storage medium are described in detail below.
[0046] See also Figure 1 , Figure 1 A structural diagram of a platform framework provided in an embodiment of the present application is used to implement automated testing. The platform framework 100 includes a continuous integration platform 101, an information management platform 102, an application deployment platform 103, and an interface automation platform 104. The information management platform 102, the application deployment platform 103, and the interface automation platform 104 are all connected to the continuous integration platform 101. The continuous integration platform 101 calls the information in the information management platform 102 and the application deployment platform 103 to perform automated testing on the test interface in the interface automation platform 104.
[0047] In the embodiments of the present application, the automated test is mainly aimed at regression testing, that is, the automated test is automated regression testing.
[0048] Among them, the continuous integration platform 101 is equivalent to an intermediate bridge, which opens up the connection between the two platforms. Moreover, after an application is configured once, the system will automatically call the use case set of the corresponding environment and execute it after the deployment is completed based on the deployment information. If there are subsequent use cases to be supplemented, just add the use cases to the configured use case set, and the continuous integration platform does not need to be changed at all.
[0049] The information management platform 102 may be a CMS platform, which manages information including department information, subsystem information, application information, server information, and personnel information. For example, application information managed in the CMS platform includes application ID, IP, and the application environment to which it belongs.
[0050] The application deployment platform 103 is mainly used to deploy the test environment, and the interface automation platform 104 is mainly used to execute a test case set of the automated regression test of the test interface.
[0051] See also Figure 2 , Figure 2 This is a flowchart of an automated testing method provided in an embodiment of the present application, which includes the following contents:
[0052] 201. Configure a test case set for an application requiring automated regression testing in a continuous integration platform, and obtain at least one associated test environment based on an application identifier of the application.
[0053] In an embodiment of the present application, the continuous integration platform is connected to the CMS platform, information related to the application program that needs to undergo automated regression testing in the CMS platform is synchronized, and a test case set is configured for the application program.
[0054] When configuring a test case set, first determine the test interface. The test interface can be an interface on an interface automation platform connected to a continuous integration platform. After determining the test interface, configure corresponding test cases for each test interface to be tested and group them into a test case set.
[0055] Optionally, in some embodiments, the test interfaces to be tested are determined, a test case is configured for each test interface to be tested, and all test cases are sorted according to a preset test order, and the test cases are grouped into a test case set according to the sorting results.
[0056] For example, in the interface case management of the continuous integration platform, click the edit test case button to enter the test case configuration page. On this configuration page, testers can query all applications on the CMS platform, select the application that needs to undergo automated regression testing, and create a configured test case for the test interface to be tested of the application.
[0057] To create and configure a test case for the test interface to be tested of the application, you can enter the name of the use case that has been created and stored in advance, which will bring out the relevant information of the tester and the application recorded in the information management platform, etc., and by selecting, confirming and editing this information, and entering information related to the test interface of the interface automation platform, you can configure the test case corresponding to the test interface.
[0058] After configuring and obtaining the test cases for all the test interfaces of the application to be tested, the interface cases are managed and these test cases are aggregated to obtain the test case set for the application.
[0059] For example, after configuring the test cases for all the test interfaces to be tested of the application, the positions of these test cases in the test case set are set according to the test sequence pre-set by the tester, and these test cases are batch-managed and grouped into a test case set, so that when performing automated regression testing, each test case in the test case set can be automatically tested based on the test sequence.
[0060] After obtaining the test case for each test interface, the corresponding test interface information will be displayed in the display column of the test case, so that the test interface matching the test interface information on the interface automation platform can be automatically called when performing automated regression testing.
[0061] Furthermore, after configuring the test case for each test interface, the display bar of the test case will also display the interface status information, application ID information, test case name information, system information, creator information, modifier information, creation time information and modification time information, etc.
[0062] After the tester selects an application program that requires automated regression testing, at least one test environment associated with the application program can be obtained based on the application identifier of the application program.
[0063] For example, a tester selects an application that requires automated regression testing, obtains an application ID corresponding to the application, and then obtains at least one associated test environment based on the application ID.
[0064] The associated test environments can be divided according to the application version. Each test environment can correspond to each application version, or each test environment can be divided according to the application version and executable file. There is no restriction on the division of test environments, and the tester can select and confirm it based on their testing experience.
[0065] 202. Determine an application version of the application program to be tested, and determine a target test environment from the test environments based on the application version.
[0066] The test environment includes multiple test environments such as FAT test environment, UAT test environment and LPT test environment. The target test environment is the FAT test environment under the application version of the application, or the target test environment is the UAT test environment under the application version of the application, or the target test environment is the LPT test environment under the application version of the application.
[0067] 203. Determine the source code link address of the application program, and retrieve the branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested.
[0068] It can be understood that the source code link address is only a path address for storing branch code files. Each application is set with a source code link address. The path address corresponding to the source code link address stores the branch code files of each application version of the application. Each branch code file corresponds to an application version, and each branch code includes new code and historical old code. Among them, the new code is the code that needs to be tested.
[0069] Usually, when setting the source code link address, it is set for the corresponding application. After obtaining the application identifier of the application, the source code link address corresponding to the application can be called up, and then the application version for automated regression testing can be performed as needed. The branch code file that matches the application version in the source code link address can be automatically obtained.
[0070] Accordingly, if the newly added code in the branch code file of the application version passes the automated regression test and the application version is released normally, the newly added code will be assigned to the historical old code. Alternatively, if the newly added code in the branch code file of the application version passes the automated regression test and the application version is released normally, and after a certain period of time after the test is completed, the newly added code will be assigned to the historical old code.
[0071] Optionally, in some embodiments, after determining the source code link address of the application and retrieving the branch code file under the application version from the source code link address, the time point and trigger conditions for triggering the test are set, and the judgment conditions for the test pass rate and the automated report recipient information, etc. are set.
[0072] Based on the above test case set, target test environment, source code link address, branch code file, trigger time point, trigger condition, test pass rate judgment condition and automated report recipient information, a continuous integration configuration for automated regression testing of the application is obtained. Subsequently, based on the continuous integration configuration, automated regression testing of the application is implemented.
[0073] Optionally, in some embodiments, after determining the source code link address of the application and retrieving the branch code file under the application version from the source code link address, a plan sheet is created on the continuous integration platform, the plan sheet including application information and release information, the application information including at least application identification, application version, source code link address and branch code file, the release information including at least release type and release method, a plan sheet identification number is generated for the plan sheet, and the plan sheet is released based on the release information and the plan sheet identification number.
[0074] Based on the above plan, set the time point and trigger conditions for the test, set the judgment conditions for the test pass rate, and set the recipient information of the automated report, etc.
[0075] Based on the above-mentioned schedule, triggering time point, triggering conditions, test pass rate judgment conditions, and automated report recipient information, a continuous integration configuration for automated regression testing of the application is obtained. Subsequently, based on the continuous integration configuration, automated regression testing of the application is implemented.
[0076] Alternatively, the time point for triggering the test, the judgment condition for the pass rate of the triggering condition test, and the recipient information of the automation report are all set in the release form.
[0077] Based on the above plan, a continuous integration configuration of the automated regression test of the application is obtained. Subsequently, based on the continuous integration configuration, the automated regression test of the application is implemented.
[0078] 204. Trigger the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set.
[0079] Optionally, in some embodiments, the continuous integration platform receives a code version sealing message of the application program under the application version, and based on the code version sealing message, triggers the continuous integration platform to perform regression testing instructions based on the test case set.
[0080] The code version sealing message can be considered as the above-mentioned triggering condition. After the tester triggers the code version sealing on the application deployment platform connected to the continuous integration platform, the system's message queue will send the code version sealing message to the continuous integration platform. After the continuous integration platform receives the code version sealing message, it will trigger the continuous integration platform's regression test instructions based on the test case set, that is, automatically issue the regression test instructions for the test case set, and execute the regression test instructions to realize automated regression testing of the application corresponding to the test case set.
[0081] After triggering the regression test instruction, the continuous integration platform can automatically call the test interface on the connected interface automation platform according to the test interface information in the test case set to perform automated regression testing on the test interface.
[0082] Optionally, in some embodiments, in addition to calling the test interface corresponding to the test case set, the continuous integration platform also obtains the corresponding plan based on the plan identification number of the application.
[0083] 205. Perform regression testing on the test interface based on the target test environment and the branch code file, obtain regression testing results of the test interface, and generate a regression testing report.
[0084] Optionally, in some embodiments, a plan sheet is obtained based on a plan sheet identification number, and regression testing is performed on the test interface based on the plan sheet and a target test environment.
[0085] As explained above, after a plan is created, a corresponding plan identification number is generated. This plan identification number can correspond to the application ID and version of the application, the application ID, the version, and the test case set, or just the test case set. Using this plan identification number, the corresponding plan can be retrieved, allowing regression testing of the called test interface based on the plan and the target test environment.
[0086] After obtaining the plan using the plan identification number, you can use the plan identification number to call the interfaces of other platforms connected to the continuous integration platform to obtain the information required for the test scenario. For example, by calling the Lotus interface, you can obtain specific information about the subsystem and the Chinese name of the tester.
[0087] Optionally, in some embodiments, the test results of the test interface corresponding to each test case in the test case set are obtained, the test results include pass and fail, the number of all test cases in the test case set is counted as a first number, and the number of test cases with pass results is counted as a second number, and a regression test report for the test case set is generated based on each test result and the ratio of the second number to the first number.
[0088] For example, the test case set includes 10 test cases, each test case corresponds to a test interface, among which 8 test cases pass the test and 2 test cases fail the test. Then, the first quantity is 10, the second quantity is 8, and the ratio of the second quantity to the first quantity is 80%. The generated regression test report records the first quantity, the second quantity, the ratio of the second quantity to the first quantity, and the test results of each test case.
[0089] The ratio of the second number to the first number may be considered as the judgment condition of the above-mentioned test pass rate.
[0090] Optionally, in some embodiments, after performing regression testing on the test interface based on the target test environment and branch code file, obtaining the regression test results of the test interface and generating a regression test report, the test pass rate of the test case set is determined based on the regression test report, and the test pass rate is compared with the preset pass rate. When the test pass rate is lower than the preset pass rate, the production release of the application is automatically blocked, and the regression test report is sent to a pre-set email address.
[0091] For example, a test case set includes 10 test cases, each test case corresponds to a test interface, among which 6 test cases pass the test and 4 test cases fail the test. Then, the first quantity is 10, the second quantity is 6, the ratio of the second quantity to the first quantity is 60%, and the preset pass rate is 70%. Then, the ratio of the second quantity to the first quantity is less than the preset pass rate, that is, the test pass rate is less than the preset pass rate, indicating that the test fails. Then, the generated regression test report records the first quantity, the second quantity, the test pass rate, the test results of each test case, and the content marked with test failure.
[0092] Specifically, since the test fails, the test results are asynchronously pushed back to the continuous integration platform, and the system automatically triggers the blocking of the production release of the application under the tested application version. After the regression test report is generated, the regression test report is sent to the recipient based on the automated report recipient information. The pre-set email address can be considered as the automated report recipient information.
[0093] Correspondingly, when the test pass rate is higher than the preset pass rate, the regression test report is directly sent to the preset email address.
[0094] For example, a test case set includes 10 test cases, each test case corresponds to a test interface, among which 8 test cases pass the test and 2 test cases fail the test. Then, the first quantity is 10, the second quantity is 8, the ratio of the second quantity to the first quantity is 80%, and the preset pass rate is 70%. Then, the ratio of the second quantity to the first quantity is greater than the preset pass rate, that is, the test pass rate is greater than the preset pass rate, indicating that the test is passed. Then, the generated regression test report records the first quantity, the second quantity, the test pass rate, the test results of each test case, and the content marked with the test passed.
[0095] Specifically, since the test passes, the test results are asynchronously pushed back to the continuous integration platform, and after the regression test report is generated, the regression test report is sent to the recipient based on the automated report recipient information. The pre-set email address can be considered as the automated report recipient information.
[0096] Optionally, after the test case set is executed, the execution results are pushed back asynchronously. The system automatically determines whether the test passes based on the pass rate configured by the continuous integration platform, and pushes the results back to the Lotus platform connected to the continuous integration platform. The third-party verification interface of the Lotus platform is used to determine whether the production release is blocked. At the same time, a regression test report is sent to a pre-set email address. In addition, the continuous integration platform supports execution result queries.
[0097] Furthermore, an automated testing method provided in an embodiment of the present application includes a continuous integration platform, an information management platform, an application deployment platform and an interface automation platform, wherein the information management platform is a CMS platform, and the information management platform, the application deployment platform and the interface automation platform are all connected to the continuous integration platform.
[0098] After determining the application that needs to undergo automated regression testing, the application information of the application is managed in the information management platform, the test environment is deployed in the application deployment platform, the continuous integration platform queries the application information, and configures the relevant configurations of continuous integration, including the application information, trigger time, test case set, test environment, etc. When the application deployment platform successfully closes the application, it triggers the continuous integration platform to perform automated regression testing, and the interface automation platform executes the test interface automation test case set, and pushes the execution results back to the continuous integration platform. The continuous integration platform determines whether the automated execution results meet the standards based on the preset pass rate. Among them, the automated execution results are also the test results. When the automated execution results meet the standards, they are handed over to the production release to the application deployment platform, and the application deployment platform performs production release on the application version corresponding to the tested application. When the automated execution results do not meet the standards, the production release of the application version corresponding to the tested application is blocked.
[0099] The automated testing method of the embodiment of the present application includes configuring a test case set for an application that needs to undergo automated regression testing in a continuous integration platform, and obtaining at least one associated test environment based on the application identifier of the application; determining the application version to be tested of the application, and determining the target test environment from the test environment based on the application version; determining the source code link address of the application, and retrieving the branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested; triggering the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calling the test interface corresponding to the test case set; performing regression testing on the test interface based on the target test environment and the branch code file, obtaining the regression test results of the test interface and generating a regression test report. Through the above method, after the information of the automated regression test is deployed on the continuous integration platform, the regression test is automatically triggered and implemented, without the need for manual control of the test process, thereby avoiding omission of test scenarios and saving labor costs.
[0100] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an automated testing device provided in an embodiment of the present application. The automated testing device 300 includes the following units:
[0101] The configuration unit 301 is configured to configure a test case set for an application program that requires automated regression testing in a continuous integration platform, and obtain at least one associated test environment according to an application identifier of the application program.
[0102] The determining unit 302 is configured to determine an application version to be tested of the application program, and determine a target test environment from the test environments based on the application version.
[0103] The retrieving unit 303 is configured to determine the source code link address of the application program, and retrieve the branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested.
[0104] The triggering unit 304 is used to trigger the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set.
[0105] The testing unit 305 is used to perform regression testing on the test interface based on the target test environment and the branch code file, obtain the regression test results of the test interface and generate a regression test report.
[0106] Optionally, the automated testing device 300 of the embodiment of the present application further includes the following units:
[0107] The comparison unit is used to determine the test pass rate of the test case set based on the regression test report, and compare the test pass rate with the preset pass rate.
[0108] The sending unit is used to automatically block the production release of the application when the test pass rate is lower than the preset pass rate, and send the regression test report to a preset email address.
[0109] Optionally, the configuration unit 301 includes the following subunits:
[0110] The configuration sorting subunit is used to determine the test interface to be tested, configure a test case for each test interface to be tested, and sort all the test cases according to a preset test order.
[0111] The use case collection subunit is used to group the test cases into test case sets according to the sorting results.
[0112] Optionally, the trigger unit 304 includes the following subunits:
[0113] The message receiving sub-unit is used by the continuous integration platform to receive code version sealing messages of the application under the application version.
[0114] The trigger instruction sub-unit is used to trigger the regression test instructions based on the test case set of the continuous integration platform based on the code version closure message.
[0115] Optionally, the automated testing device 300 of the embodiment of the present application further includes other units and sub-units, which will not be described in detail here.
[0116] The automated testing device 300 of the embodiment of the present application includes a configuration unit 301, which is used to configure a test case set for an application that needs to be subjected to automated regression testing in a continuous integration platform, and obtain at least one associated test environment according to the application identifier of the application; a determination unit 302, which is used to determine the application version to be tested of the application, and determine the target test environment from the test environment based on the application version; a call unit 303, which is used to determine the source code link address of the application, and call the branch code file under the application version from the source code link address, wherein the branch code file includes the new code to be tested; a trigger unit 304, which is used to trigger the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set; a test unit 305, which is used to perform regression testing on the test interface based on the target test environment and the branch code file, obtain the regression test results of the test interface and generate a regression test report. Through the above device, after the information of the automated regression test is deployed on the continuous integration platform, the regression test is automatically triggered and implemented, without the need for manual control of the test process, thereby avoiding omission of test scenarios and saving labor costs.
[0117] See also Figure 4 , Figure 4 The present invention provides a schematic structural diagram of a terminal according to an embodiment of the present invention. The terminal 400 may be a terminal device such as a tablet computer, a laptop computer, a desktop computer, a personal computer (PC), a personal digital assistant (PDA), etc. The terminal 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored in the memory 402 and executable on the processor 401. The processor 401 is electrically connected to the memory 402. It will be understood by those skilled in the art that the terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown, or a combination of certain components, or a different arrangement of components.
[0118] Processor 401 is the control center of terminal 400. It uses various interfaces and lines to connect various parts of the entire terminal 400. By running or loading software programs and / or modules stored in memory 402 and calling data stored in memory 402, it executes various functions of terminal 400 and processes data, thereby monitoring the terminal 400 as a whole.
[0119] In the embodiment of the present application, the processor 401 in the terminal 400 loads instructions corresponding to one or more application processes into the memory 402 according to the following steps, and the processor 401 runs the application stored in the memory 402 to implement various functions:
[0120] Configuring a test case set for an application requiring automated regression testing in a continuous integration platform, and obtaining at least one associated test environment based on an application identifier of the application;
[0121] Determine an application version to be tested of the application program, and determine a target test environment from the test environments based on the application version;
[0122] Determine the source code link address of the application, and retrieve the branch code file under the application version from the source code link address. The branch code file includes the new code to be tested.
[0123] Trigger the regression test instructions of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set;
[0124] Perform regression testing on the test interface based on the target test environment and branch code files, obtain the regression test results of the test interface and generate a regression test report.
[0125] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0126] Optionally, the terminal 400 further includes a touch screen 403, an input unit 404, and a power supply 405, wherein the processor 401 is electrically connected to the touch screen 403, the input unit 404, and the power supply 405. Those skilled in the art will understand that Figure 4 The terminal structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0127] The touch screen 403 can be used for displaying a graphical user interface and receiving the operation instructions generated by the user acting on the graphical user interface. The touch screen 403 can include a display panel and a touch panel. Wherein, the display panel can be used for displaying the information input by the user or the information provided to the user and various graphical user interfaces of the computer device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel can be used for collecting the touch operation of the user thereon or near it (such as the user uses any suitable object or accessory such as a finger, a stylus on the touch panel or near the touch panel), and generates corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 401, and can receive the command sent by the processor 401 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 401 to determine the type of touch event, and then the processor 401 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 403 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 403 can also be used as part of the input unit 404 to realize the input function.
[0128] The input unit 404 may be configured to receive input digital, character information, or user feature information (such as fingerprint, iris, or facial information), and to generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control.
[0129] Power supply 405 is used to supply power to various components of terminal 400. Optionally, power supply 405 can be logically connected to processor 401 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. Power supply 405 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0130] although Figure 4Not shown in the figure, the terminal 400 may further include a mouse, a keyboard, a sensor, a radio frequency module, etc., which will not be described in detail here.
[0131] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0132] As can be seen from the above, the terminal 400 provided in this embodiment configures a test case set for an application that needs to undergo automated regression testing in a continuous integration platform, and obtains at least one associated test environment based on the application identifier of the application, determines the application version to be tested of the application, determines the target test environment from the test environment based on the application version, determines the source code link address of the application, and retrieves the branch code file under the application version from the source code link address. The branch code file includes the new code to be tested, triggers the regression test instructions of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set, performs regression testing on the test interface based on the target test environment and the branch code file, obtains the regression test results of the test interface and generates a regression test report.
[0133] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0134] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of computer programs, which can be loaded by a processor to execute the steps of any of the automated testing methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0135] Configuring a test case set for an application requiring automated regression testing in a continuous integration platform, and obtaining at least one associated test environment based on an application identifier of the application;
[0136] Determine an application version to be tested of the application program, and determine a target test environment from the test environments based on the application version;
[0137] Determine the source code link address of the application, and retrieve the branch code file under the application version from the source code link address. The branch code file includes the new code to be tested.
[0138] Trigger the regression test instructions of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set;
[0139] Perform regression testing on the test interface based on the target test environment and branch code files, obtain the regression test results of the test interface and generate a regression test report.
[0140] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0141] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0142] Since the computer program stored in the storage medium can execute the steps in any one of the automated testing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any one of the automated testing methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0143] The above is a detailed introduction to an automated testing method, device, terminal and storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the contents of this specification should not be understood as limiting the present application.
Claims
1. An automated testing method, characterized in that: The method comprises: Configuring a test case set for an application requiring automated regression testing in a continuous integration platform, and obtaining at least one associated test environment based on an application identifier of the application, wherein the test environment includes a FAT test environment, a UAT test environment, and an LPT test environment; determining an application version to be tested of the application program, and determining a target test environment from the test environments based on the application version; Determine the source code link address of the application program, and retrieve a branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested; Triggering the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calling the test interface corresponding to the test case set; Performing regression testing on the test interface based on the target test environment and the branch code file, obtaining regression test results of the test interface and generating a regression test report; The step of configuring a test case set for an application requiring automated regression testing in a continuous integration platform and obtaining at least one associated test environment based on an application identifier of the application includes: Determine the test interfaces to be tested, configure a test case for each of the test interfaces to be tested, and sort all the test cases according to a preset test order; According to the sorting results, the test cases are grouped into a test case set; The triggering of the regression test instruction of the continuous integration platform based on the test case set, wherein the continuous integration platform calls the test interface corresponding to the test case set, includes: The continuous integration platform receives a code version sealing message for the application program under the application version; Based on the code version closure message, the continuous integration platform is triggered to execute a regression test instruction based on the test case set.
2. The automated testing method according to claim 1, wherein: The method further comprises: Creating a plan on the continuous integration platform, the plan including application information and release information, the application information including at least the application identifier, the application version, the source code link address, and the branch code file, and the release information including at least the release type and release method; A plan sheet identification number of the plan sheet is generated, and the plan sheet is published based on the publishing information and the plan sheet identification number.
3. The automated testing method according to claim 2, wherein: The performing regression testing on the test interface based on the target test environment and the branch code file, obtaining the regression test result of the test interface and generating a regression test report includes: Based on the plan sheet identification number, obtaining the plan sheet; Regression testing is performed on the test interface based on the plan and the target test environment.
4. The automated testing method according to claim 1, wherein: The performing regression testing on the test interface based on the target test environment and the branch code file, obtaining the regression test result of the test interface and generating a regression test report includes: Obtaining a test result of the test interface corresponding to each test case in the test case set, wherein the test result includes a pass or fail; Counting the number of all test cases in the test case set as a first number, and counting the number of test cases with passed test results as a second number; A regression test report for the test case set is generated based on each of the test results and the ratio of the second number to the first number.
5. The automated testing method according to claim 1, wherein: After performing regression testing on the test interface based on the target test environment and the branch code file, obtaining the regression test result of the test interface and generating a regression test report, the method further includes: Determine the test pass rate of the test case set based on the regression test report, and compare the test pass rate with a preset pass rate; When the test pass rate is lower than the preset pass rate, the production release of the application is automatically blocked, and the regression test report is sent to a preset email address.
6. An automated testing device, characterized in that: The device comprises: A configuration unit is configured to configure a test case set for an application requiring automated regression testing in a continuous integration platform, and obtain at least one associated test environment according to an application identifier of the application, wherein the test environment includes a FAT test environment, a UAT test environment, and an LPT test environment; a determining unit, configured to determine an application version to be tested of the application program, and determine a target test environment from the test environments based on the application version; a retrieval unit, configured to determine a source code link address of the application program, and retrieve a branch code file under the application version from the source code link address, wherein the branch code file includes the newly added code to be tested; A triggering unit, configured to trigger the regression test instruction of the continuous integration platform based on the test case set, and the continuous integration platform calls the test interface corresponding to the test case set; A testing unit, configured to perform regression testing on the test interface based on the target test environment and the branch code file, obtain regression test results of the test interface and generate a regression test report; The configuration unit is further configured to determine the test interfaces to be tested, configure a test case for each of the test interfaces to be tested, and sort all the test cases according to a preset test order; and according to the sorting result, group the test cases into a test case set; The trigger unit is further configured to receive a code version closure message of the application program under the application version through the continuous integration platform; and trigger a regression test instruction of the continuous integration platform based on the test case set based on the code version closure message.
7. A terminal, characterized in that: The system comprises a memory and a processor, wherein the memory is used to store instructions and data, and the processor is used to execute the automated testing method according to any one of claims 1 to 5.
8. A storage medium, characterized in that: The storage medium stores a plurality of instructions, which are suitable for being loaded by a processor to execute the automated testing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Interface automation test method, device, storage medium and computer device
CN107748717A
Industrial Internet APP automatic test system and test method
CN111708706A