Disclosure of Invention
The invention mainly aims to provide a test method, a test system, terminal equipment and a computer storage medium of an application program, and aims to solve the technical problems that the conventional method for switching test of different server environments aiming at the application program is complex in operation and long in time consumption, so that the test efficiency of the application program is low.
In order to achieve the above object, the present invention provides a method for testing an application program, where the method for testing an application program is applied to a terminal device, and an application program to be tested is installed on the terminal device, and the method for testing an application program includes:
outputting a testing tool interface of the application program according to an interface calling instruction, wherein an environment switching control is configured on the testing tool interface and is associated with other server environments different from the current server environment;
And acquiring a server environment switching instruction triggered based on the environment switching control, and switching the current server environment to the other server environments according to the server environment switching instruction so as to test the application program under the other server environments.
Optionally, the step of acquiring a server environment switching instruction triggered based on the environment switching control includes:
Monitoring an instruction triggering event input based on the environment switching control, and analyzing instruction content carried by the instruction triggering event;
And packaging the instruction content and environment identifiers of other server environments associated with the environment switching control to generate a server environment switching instruction, and acquiring the server environment switching instruction.
Optionally, the instruction content includes a switching time of a server environment, and the step of switching the current server environment to the other server environments according to the server environment switching instruction further includes:
and when the current time is detected to reach the switching time, switching the current server environment to other server environments corresponding to the environment identifier.
Optionally, the terminal device is configured with a testing tool for assisting in testing the application program, and before the step of outputting the testing tool interface of the application program according to the interface calling instruction, the method further includes:
and triggering an interface calling instruction of the testing tool when an instruction triggering event input based on the calling control of the testing tool is monitored.
Optionally, the method for testing an application program further includes:
and displaying the service request parameters of the application program on the test tool interface.
Optionally, the test tool interface is further configured with a view control of service request parameters, where the service request parameters include a request interface and parameter content corresponding to the request interface, and the step of displaying the service request parameters of the application program on the test tool interface includes:
when an instruction triggering event input based on the check control is monitored, extracting all request interfaces of the application program and respective parameter contents of all request interfaces;
and generating a parameter display list on the test tool interface, and filling all the request interfaces and the parameter content into the parameter display list for associated display.
Optionally, after the step of filling all the requests and the parameter contents in the parameter presentation list for associated presentation, the method further includes:
And outputting detailed interface return data of the request interface pointed by the selection instruction when the selection instruction triggered based on the parameter display list is detected.
In addition, in order to achieve the above object, the present invention further provides a test system for an application program, where the test system for an application program is applied to a terminal device, and an application program to be tested is installed on the terminal device, and the test system for an application program includes:
The interface output module is used for outputting a test tool interface of the application program according to an interface calling instruction, wherein an environment switching control is configured on the test tool interface and is associated with other server environments different from the current server environment;
And the test environment switching module is used for acquiring a server environment switching instruction triggered based on the environment switching control, and switching the current server environment to the other server environments according to the server environment switching instruction so as to test the application program under the other server environments.
The invention also provides the steps of the method for testing the application program, which are realized by each functional module of the system for testing the application program when the functional module runs.
In addition, to achieve the above object, the present invention also provides a terminal device including: the system comprises a memory, a processor and a test program of an application program stored on the memory and capable of running on the processor, wherein the test program of the application program is executed by the processor to realize the steps of the test method of the application program.
In addition, in order to achieve the above object, the present invention also provides a computer storage medium having stored thereon a test program of an application program, which when executed by a processor, implements the steps of the test method of an application program as described above.
The invention provides a testing method, a testing system, terminal equipment and a computer storage medium of an application program, wherein a testing tool interface of the application program is output according to an interface calling instruction through the terminal equipment of the application program to be tested, and an environment switching control is configured on the testing tool interface and is associated with other server environments different from the current server environment; and acquiring a server environment switching instruction triggered based on the environment switching control, and switching the current server environment to the other server environments according to the server environment switching instruction so as to test the application program under the other server environments.
Under the condition that a server environment needs to be switched to test an application program before the application program is on line, a terminal device provided with the application program to be tested outputs a test tool interface for assisting in testing the application program according to an interface calling instruction, the test tool interface is provided with environment switching controls for controlling the switching of the application program to test the server environment, the environment switching controls are respectively associated with other server environments which are different from the current server environment in which the application program is tested at the current moment, finally, the terminal device obtains a server environment switching instruction triggered by an application program development staff based on the environment switching controls, and correspondingly switches the current server environment of the application program to other server environments associated with the environment switching controls according to the server environment switching instruction, so that the application program can continue testing under the other server environments.
Compared with the traditional mode of switching the server environment based on modifying codes, compiling programs, packing and uploading programs and downloading programs to test the application programs, the method and the device can be used for realizing switching the server environment to test the application programs based on the simple command control and the different server environments and then according to the server environment switching command triggered based on the command control, so that the processes of code modification, program compiling, packing, uploading programs and downloading and installing programs are not needed, the operation of switching the server environment to test the application programs is simplified to a great extent, the environment switching time is shortened, and the testing efficiency of the application programs is improved.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware running environment according to an embodiment of the present invention.
The terminal device of the embodiment of the invention can be a device which is specially used by application program development staff to install an online application program to perform functional test on the application program, and the device can be a smart phone, a PC (Personal Computer ), a tablet computer, a portable computer and the like.
As shown in fig. 1, the terminal device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the terminal device structure shown in fig. 1 is not limiting of the terminal device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a test program for an application program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client and communicating data with the client; and the processor 1001 may be used to call a test program of the application program stored in the memory 1005 and perform the following operations:
outputting a testing tool interface of the application program according to an interface calling instruction, wherein an environment switching control is configured on the testing tool interface and is associated with other server environments different from the current server environment;
And acquiring a server environment switching instruction triggered based on the environment switching control, and switching the current server environment to the other server environments according to the server environment switching instruction so as to test the application program under the other server environments.
Further, the processor 1001 may call a test program of the application program stored in the memory 1005, and further perform the following operations:
Monitoring an instruction triggering event input based on the environment switching control, and analyzing instruction content carried by the instruction triggering event;
And packaging the instruction content and environment identifiers of other server environments associated with the environment switching control to generate a server environment switching instruction, and acquiring the server environment switching instruction.
Further, the instruction content includes a switching time of the server environment, and the processor 1001 may call a test program of the application program stored in the memory 1005, and further perform the following operations:
and when the current time is detected to reach the switching time, switching the current server environment to other server environments corresponding to the environment identifier.
Further, the terminal device is provided with a test tool for assisting in testing the application program, and the processor 1001 may call the test program of the application program stored in the memory 1005, and before executing the step of outputting the test tool interface of the application program according to the interface call instruction, further execute the following operations:
and triggering an interface calling instruction of the testing tool when an instruction triggering event input based on the calling control of the testing tool is monitored.
Further, the processor 1001 may call a test program of the application program stored in the memory 1005, and further perform the following operations:
and displaying the service request parameters of the application program on the test tool interface.
Further, the test tool interface is further configured with a view control of service request parameters, where the service request parameters include a request interface and parameter content corresponding to the request interface, and the processor 1001 may call a test program of the application program stored in the memory 1005, and further perform the following operations:
when an instruction triggering event input based on the check control is monitored, extracting all request interfaces of the application program and respective parameter contents of all request interfaces;
and generating a parameter display list on the test tool interface, and filling all the request interfaces and the parameter content into the parameter display list for associated display.
Further, the processor 1001 may call the test program of the application program stored in the memory 1005, and after performing the step of filling all the requests and the parameter contents in the parameter presentation list for association presentation, further perform the following operations:
And outputting detailed interface return data of the request interface pointed by the selection instruction when the selection instruction triggered based on the parameter display list is detected.
Based on the above hardware structure, various embodiments of the test method of the application program of the present invention are presented.
It should be noted that, the application program is a main means of installing on the terminal device, improving the deficiency and individuation of the original system of the terminal device, so that the terminal device improves its functions and provides a richer use experience for the user. Currently, before an application program is formally released to a user, a functional test must be performed to ensure that a problem does not exist after the function of the application program is formally released, and in the process of performing the functional test on the application program, various server environments such as development, test and formally switching test are often required.
When the switching test of different server environments is carried out on application programs, the code is modified to compile the application programs in the current server environment into program packages, then the program packages are downloaded to the target server environment needing the switching test for reinstallation, and then the test is started, so that the switching test process of the whole server environment at least needs to be subjected to the processes of code modification, program compiling, program packing, uploading, downloading and installation, and the operation is complex and the switching time is long.
In summary, the existing switching test for different server environments is performed on an application program, which is complex in operation and long in time consumption, resulting in low testing efficiency of the application program.
Aiming at the phenomenon, the invention provides a testing method of an application program to solve the technical problems of low testing efficiency of the application program caused by complex operation and long time consumption in the prior art of switching testing of different server environments aiming at the application program. Referring to fig. 2, fig. 2 is a flowchart illustrating a testing method of an application program according to a first embodiment of the present invention.
In this embodiment, the method for testing an application program includes:
Step S10, outputting a test tool interface of the application program according to an interface calling instruction, wherein an environment switching control is configured on the test tool interface and is associated with other server environments different from the current server environment;
The terminal equipment provided with the application program to be tested outputs a test tool interface for carrying out test assistance on the application program according to an interface calling instruction, wherein an environment switching control for controlling the switching of the application program test server environment is configured on the test tool interface, and the environment switching control is respectively associated with other server environments which are different from the current server environment of the application program to be tested at the current moment.
In this embodiment, the server environment may specifically include a development server, a test server, and a formal server, which each provide an interface for an application to be tested to serve its normal running environment (hereinafter, simply referred to as a development server environment, a test server environment, and a formal server environment, respectively). In addition, the plurality of environment switching controls can be configured on the test tool interface, and each environment switching control respectively establishes a one-to-one association relationship with one other server environment. Specifically, for example, when the terminal device provides an interface service for an application to be tested with respect to a development server connected at the current moment, on a test tool interface for performing test assistance on the application, which is output according to an interface calling instruction, the terminal device may be configured with two environment switching controls, namely, an environment switching control 1 and an environment switching control 2, for controlling and switching an application test server environment, where the environment switching control 1 may establish a one-to-one association relationship with the test server environment (or a formal server environment), and the environment switching control 2 may establish a one-to-one association relationship with the formal server environment (or the test server environment).
Further, it should be noted that, in this embodiment, the environment switching control may be specifically configured on the test tool interface by a developer of the application program through a code form, and an association relationship between the environment switching control and the server environment in a one-to-one correspondence manner is established. It should be understood that, based on different design requirements of practical applications, in different possible embodiments, a developer may, of course, use different code modes to configure an environment switching control and establish an association relationship between the environment switching control and a server environment.
Further, in a possible embodiment, in the step S10, a test tool interface of the application program is output according to an interface calling instruction, where the test tool interface is configured with an environment switching control, and before the environment switching control is associated with another server environment different from the current server environment, the test method of the application program of the present invention may further include:
and step S30, triggering an interface calling instruction of the test tool when a command triggering event input based on the calling control of the test tool is monitored.
It should be noted that, in this embodiment, the terminal device on which the application program to be tested is already installed is preconfigured with a testing tool for assisting in testing the application program, where the testing tool may be specifically developed by a developer separately and installed on the terminal device, so as to assist the developer in performing service environment switching, recording service request parameters of the application program, and the like in a process of testing the application program before being online, and the testing tool may be configured to run continuously during the whole testing process of the application program based on development. It should be understood that, based on different design requirements of practical applications, in different possible embodiments, a developer may specifically develop different types of testing tools to assist in performing a testing process on an application program before being online, and the testing method of the application program of the present invention is not limited to the specific development process of the testing tools and the specific implementation principle for assisting in testing the application program before being online.
In addition, it should be noted that, in this embodiment, the instruction triggering event may be specifically a touch point pressing instruction control or a voice content triggered by inputting control to select the instruction control, etc., it should be understood that, based on different design requirements of practical application, in different feasible embodiments, the terminal device may of course use different instruction triggering events based on the instruction control to trigger the corresponding instruction, and the test method of the application program of the present invention is not limited to the specific type of the instruction triggering event.
After the terminal equipment provided with the application program to be tested is provided with the test tool for assisting in testing the application program, the terminal equipment continuously runs in the whole test process of the application program and generates a calling control for calling the interface of the test tool, so that when the terminal equipment monitors an instruction triggering event input based on the calling control, the terminal equipment immediately triggers the interface calling instruction of the test tool to output the interface of the test tool which is provided with the environment switching control and is used for assisting in testing the application program according to the interface calling instruction.
Specifically, for example, after the terminal device installs the test tool, in the process of starting the application program before the online operation to test the application program, continuously operating the test tool and generating and displaying a call control for calling the test tool interface in a floating window form on any display interface of the application program, thereby, when receiving an instruction triggering event that a developer clicks the call control based on the touch input by the call control, immediately triggering an interface call instruction for calling the test tool interface for interaction of the developer by the test tool, and then, the terminal device can output and display the test tool interface in a floating window form on any application interface of the application program which is displayed at the current moment based on the interface call instruction, so that the developer can utilize the preset environment switching control on the test tool interface to perform the test process after the application program switches different server environments.
And step S20, acquiring a server environment switching instruction triggered based on the environment switching control, and switching the current server environment to the other server environments according to the server environment switching instruction so as to test the application program under the other server environments.
After outputting a testing tool interface configured with an environment switching control according to an interface calling instruction, the terminal equipment starts to monitor development staff of an application program to be tested, acquires a server environment switching instruction triggered based on the time when the instruction triggering event is monitored based on an instruction triggering event input by the environment switching control, correspondingly switches the current server environment of the application program tested at the current moment to other server environments associated with the environment switching control according to the server environment switching instruction, and enables the application program to continue testing under the other server environments.
Further, in a possible embodiment, in the step S20, the step of "obtaining the server environment switching instruction triggered by the environment switching control" may include:
Step S201, monitoring an instruction triggering event input based on the environment switching control, and analyzing instruction content carried by the instruction triggering event;
it should be noted that, in this embodiment, when the developer inputs the command triggering event based on the environment switching control, the developer may synchronously input the command content for controlling the server environment switching based on the event triggering server environment switching command, and it should be understood that, based on different design needs of the actual application, in different possible embodiments, the developer may naturally input different command content to control the server environment switching, and the test method of the application program of the present invention is not specifically limited to the specific implementation of the command content.
After outputting a testing tool interface configured with an environment switching control according to an interface invoking instruction, the terminal equipment starts to monitor a developer of an application program to be tested, based on an instruction triggering event input by the environment switching control, and immediately analyzes the instruction triggering event when the instruction triggering event is monitored to obtain instruction content which is synchronously input by the developer when the instruction triggering event is input and is used for controlling the server environment switching based on the event triggering server environment switching instruction.
Specifically, for example, after the terminal device outputs a test tool interface for performing test assistance on an application program according to an interface calling instruction, when a developer of the application program switches a control 1 according to an environment configured by the test tool interface to trigger an instruction triggering event based on the touch point, a piece of time data is synchronously selected and input as instruction content, so that when the terminal device monitors the instruction triggering event, the terminal device immediately analyzes the instruction triggering event by adopting any mature command analysis technology, thereby analyzing and acquiring the time data input by the developer.
Step S202, packaging the instruction content and environment identifiers of other server environments associated with the environment switching control to generate a server environment switching instruction, and acquiring the server environment switching instruction.
After analyzing an instruction triggering event triggered by a developer based on the environment switching control, the terminal equipment determines other server environments associated with the environment switching control and packages the environment identifiers of the other server environments and the instruction content together into a server environment switching instruction, and acquires and stores the server environment switching instruction.
Specifically, for example, after analyzing and obtaining time data input by a developer, the terminal device first establishes a one-to-one association relationship between the environment switching control 1 and a test server environment (or a formal server environment), further obtains an environment identifier, namely a test service (or a formal service), of the test server environment (or the formal server environment) associated with the environment switching control 1, and then encapsulates the time data and the obtained environment identifier to generate a server environment switching instruction capable of controlling server environment switching, and obtains the instruction for storage, so that the subsequent test of an application program is performed by controlling the switching server environment according to the instruction.
Further, in a possible embodiment, the step of "switching the current server environment to the other server environment according to the server environment switching instruction" in the above step S20 may include:
and step S203, when the current time reaches the switching time, switching the current server environment to other server environments corresponding to the environment identifier.
In this embodiment, the switching time may be specifically time data input by the developer.
After the terminal equipment acquires the server environment switching instruction stored in the environment identifier packaged with the server environment and the instruction content input by the development staff, the terminal equipment starts to detect the current time of the system, and immediately controls the current server environment which provides a service interface for the test of the application program at the current time to be directly switched to other server environments corresponding to the environment identifier when the current time reaches the time indicated by the time data, so that the terminal equipment provides the service interface for the test of the application program in the subsequent server environments.
Specifically, for example, assume that in a server environment switching instruction acquired and stored by a terminal device, an environment identifier of another server environment associated with the packaged environment switching control 1 is "test service" (corresponding to a test server environment), and time data input by a developer of a packaged application program to be tested is "00:00", when detecting that the current time of the system reaches "00:00", the terminal device immediately controls the development server environment that is currently providing a service interface for the application program to be directly switched to the test server environment corresponding to the environment identifier-test service, so that after the application program is restarted under the test server environment, the application program can be directly tested based on the service interface provided by the terminal device under the test server environment.
According to the method for testing the application program, through the terminal equipment provided with the application program to be tested, a testing tool interface for testing assistance of the application program is output according to an interface calling instruction, an environment switching control for controlling and switching the environment of a testing server of the application program is configured on the testing tool interface, and the environment switching control is respectively associated with other server environments which are different from the current server environment of the application program for testing at the current moment; after outputting a testing tool interface configured with an environment switching control according to an interface calling instruction, the terminal equipment starts to monitor development staff of an application program to be tested, acquires a server environment switching instruction triggered based on the time when the instruction triggering event is monitored based on an instruction triggering event input by the environment switching control, correspondingly switches the current server environment of the application program tested at the current moment to other server environments associated with the environment switching control according to the server environment switching instruction, and enables the application program to continue testing under the other server environments.
Compared with the traditional mode of switching the server environment based on modifying codes, compiling programs, packing and uploading programs and downloading programs to test the application programs, the method and the device can be used for realizing switching the server environment to test the application programs based on the simple command control and the different server environments and then according to the server environment switching command triggered based on the command control, so that the processes of code modification, program compiling, packing, uploading programs and downloading and installing programs are not needed, the operation of switching the server environment to test the application programs is simplified to a great extent, the environment switching time is shortened, and the testing efficiency of the application programs is improved.
Further, based on the above first embodiment, a second embodiment of the test method for an application program of the present invention is provided, and in this embodiment, the test method for an application program of the present invention may further include:
and step S40, displaying the service request parameters of the application program on the test tool interface.
In this embodiment, because the interface return data terminal device of the server for the service request cannot be directly displayed when the application is operated by the developer to request the server to provide the service in the test process of the application, in the prior art, the developer only needs to manually search each interface provided by the server one by one under the condition that the developer needs to check the interface return data, so that the interface return data is screened out for analysis, and the whole process is very time-consuming.
In addition, it should be noted that, in this embodiment, the service request parameter includes a request interface when the application program initiates a service request to the background server in the current server environment, and the parameter content returned by the background server through the request interface for the service request, where the terminal device continuously records the request interface when the application program initiates the service request to the background server in the process of providing the service interface for the test of the application program based on any server environment, and the background server returns data based on the parameter content and the detailed interface returned by the request interface.
In the process that the terminal equipment provides a service interface for testing of the application program based on any server environment, once an instruction triggered by a developer based on the requirement of data returned by a check interface is detected, the application program immediately initiates a request interface when a service request is sent to a background server in the current server environment, and the background server outputs and displays the parameter content returned by the request interface based on the parameter content, so that the developer can directly check and analyze the parameter content.
Further, in a possible embodiment, in addition to the above-mentioned processing and configuring one or more environment switching controls on the test tool interface, a view control of the service request parameter may be configured in the same manner as the environment switching control is configured. Step S40, displaying the service request parameters of the application program on the test tool interface may include:
Step S401, when an instruction triggering event input based on the view control is monitored, extracting all request interfaces of the application program and respective parameter contents of all request interfaces;
When monitoring a development staff of an application program to be tested, the terminal equipment immediately determines a background server for providing service for the application program in the current server environment based on a requirement of checking and analyzing data returned by a server interface and utilizing a checking control input instruction trigger event configured on a test tool interface, and extracts all request interfaces for initiating service requests to the background server by the application program and parameter contents returned by all request interfaces.
Specifically, for example, assume that a terminal device is currently in a development server environment, and a service interface is provided for testing of an application program based on a development server. When the terminal equipment monitors that a developer clicks an instruction trigger event input by clicking a view control based on the view control configured on the test tool interface, the terminal equipment immediately determines that a background server providing service for the application program at the current moment is the development server, and the terminal equipment extracts all request interfaces of the application program for initiating service requests to the development server and extracts parameter contents returned by all request interfaces one by one.
And step S402, generating a parameter display list on the test tool interface, and filling all the request interfaces and the parameter content into the parameter display list for associated display.
After the terminal equipment extracts all the request interfaces and the parameter contents returned by all the request interfaces, the terminal equipment further generates a parameter display list on the test tool interface, and sequentially fills the parameter contents of all the request interfaces and the request interfaces into the parameter display list correspondingly, and after filling of all the request interfaces and the parameter contents is completed, the parameter display list is output.
Specifically, for example, on a test tool interface, the terminal device generates a parameter display list by using a request interface and a parameter content as headers, and then sequentially fills all the request interfaces into each cell corresponding to the request interface, and sequentially fills the respective parameter content of all the request interfaces into each cell corresponding to the parameter content so as to perform associated display on the request interfaces and the parameters, so that a developer of an application program can intuitively check the parameter content returned by all the request interfaces and all the request interfaces.
Further, in a possible embodiment, after the step of "filling all the request interfaces and the parameter contents in the parameter presentation list to perform association presentation" in step S402, the method for testing an application program of the present invention may further include:
And step A, outputting detailed interface return data of the request interface pointed by the selection instruction when the selection instruction triggered based on the parameter display list is detected.
It should be noted that, in this embodiment, the terminal device may also configure all the cells filled with the request interface in the parameter display list as instruction controls in the same manner as the environment switching controls are configured, so that the developer may trigger the selection instruction.
After the terminal equipment uses the parameter display list to aim at all request interfaces and the respective parameter content of all request interfaces, if detecting that a developer triggers a selection instruction based on the cell filling the request interface in the parameter display list, the terminal equipment further outputs detailed interface return data of the request interface selected by the selection instruction so as to enable the developer to check the detailed interface return data to carry out test analysis of the application program.
Specifically, for example, assume that there are 5 cells filled with the request interface on the parameter display list output by the terminal device, and the terminal device has previously configured the 5 cells as command controls capable of triggering the selection command, so when detecting that the developer of the application program to be tested clicks the cell 3 in each of the 5 cells by touching to trigger the selection command, the terminal device immediately extracts detailed interface return data of the request interface filled in the cell 3, and then outputs the detailed interface return data in a floating window form for viewing and analysis by the developer.
In this embodiment, in the testing process for the application program, when the application program is operated by the developer to request the server to provide the service, the interface return data terminal device of the server for the service request cannot be directly displayed, so in the prior art, the developer only can search each interface provided by the server one by one in a manual manner under the condition that the developer needs to check the interface return data, and therefore the interface return data is screened out for analysis, and the whole process is very time-consuming.
In this way, in the method for testing the application program, when the developer of the application program to be tested is monitored, based on the requirement of checking and analyzing the return data of the server interface, and when a command trigger event is input by using the checking control configured on the testing tool interface, the terminal equipment immediately determines a background server for providing service for the application program in the current server environment, and extracts all request interfaces for initiating service requests to the background server by the application program and parameter contents returned by all request interfaces; after the terminal equipment extracts all the request interfaces and the parameter contents returned by all the request interfaces, the terminal equipment further generates a parameter display list on the test tool interface, and sequentially fills the parameter contents of all the request interfaces and the request interfaces into the parameter display list correspondingly, and after filling of all the request interfaces and the parameter contents is completed, the parameter display list is output.
After the parameter display list is used for all the request interfaces and the respective parameter content of all the request interfaces, if detecting that the developer triggers a selection instruction based on the cell filling the request interface in the parameter display list, the terminal device further outputs detailed interface return data of the request interface selected by the selection instruction, so that the developer can check the detailed interface return data to perform test analysis of the application program.
Compared with the traditional method of searching each interface provided by the server one by one based on manual operation, the method screens out the mode of analyzing the interface return data, directly displays the interface and the interface parameter output to development staff in a list form, and further outputs the detailed interface return data of the display request interface based on the operation of the development staff for the development staff to carry out the test analysis of the application program, thereby avoiding the situation that a great amount of time is required for manually inquiring the interfaces one by one, further simplifying the operation of testing the application program, shortening the time consumption of environment switching and improving the test efficiency of the application program.
Further, the invention also provides a testing system of the application program, and the testing system of the application program is applied to the terminal equipment provided with the application program to be tested in any embodiment. Referring to fig. 3, fig. 3 is a schematic diagram of a functional module of a testing system for an application program according to an embodiment of the invention. As shown in fig. 3, the test system of the application program of the present invention includes:
The interface output module 10 is configured to output a test tool interface of the application program according to an interface calling instruction, where the test tool interface is configured with an environment switching control, and the environment switching control is associated with other server environments different from the current server environment;
And the test environment switching module 20 is configured to obtain a server environment switching instruction triggered based on the environment switching control, and switch the current server environment to the other server environments according to the server environment switching instruction, so as to test the application program under the other server environments.
Further, the test environment switching module 20 includes:
the instruction analysis unit is used for monitoring an instruction triggering event input based on the environment switching control and analyzing instruction content carried by the instruction triggering event;
the instruction acquisition unit is used for packaging the instruction content and environment identifiers of other server environments associated with the environment switching control to generate a server environment switching instruction and acquiring the server environment switching instruction.
Further, the test environment switching module 20 further includes:
and the environment switching unit is used for switching the current server environment to other server environments corresponding to the environment identifier when the current time is detected to reach the switching time.
Further, the terminal device is configured with a testing tool for assisting in testing the application program, and the testing system of the application program further comprises:
And the instruction triggering module is used for triggering the interface calling instruction of the testing tool when the instruction triggering event input based on the calling control of the testing tool is monitored.
Further, the test system of the application program of the present invention further comprises:
and the interface data display module is used for displaying the service request parameters of the application program on the test tool interface.
Further, the test tool interface is further configured with a view control of service request parameters, where the service request parameters include a request interface and parameter content corresponding to the request interface, and an interface data display module includes:
The extraction unit is used for extracting all request interfaces of the application program and respective parameter contents of all the request interfaces when an instruction triggering event input based on the view control is monitored;
and the first data display unit is used for generating a parameter display list on the test tool interface, and filling all the request interfaces and the parameter content into the parameter display list for associated display.
Further, the interface data display module further includes:
And the second data display unit is used for outputting detailed interface return data of the request interface pointed by the selection instruction when the selection instruction triggered based on the parameter display list is detected.
The function implementation of each module in the test system of the application program corresponds to each step in the test method embodiment of the application program, and the function and implementation process of each module are not described here again.
The present invention also provides a computer storage medium having stored thereon a test program of an application program, which when executed by a processor implements the steps of the test method of an application program according to any of the above embodiments.
The specific embodiments of the computer storage medium of the present invention are substantially the same as the embodiments of the testing method of the application program described above, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.