CN115269435A - Functional interface testing method, device, equipment and storage medium - Google Patents

Functional interface testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115269435A
CN115269435A CN202210993587.5A CN202210993587A CN115269435A CN 115269435 A CN115269435 A CN 115269435A CN 202210993587 A CN202210993587 A CN 202210993587A CN 115269435 A CN115269435 A CN 115269435A
Authority
CN
China
Prior art keywords
test
app
tested
interface
execution result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210993587.5A
Other languages
Chinese (zh)
Inventor
何伟能
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202210993587.5A priority Critical patent/CN115269435A/en
Publication of CN115269435A publication Critical patent/CN115269435A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure provides a method, an apparatus, a device and a storage medium for testing a functional interface, wherein the method comprises the following steps: the method comprises the steps of firstly receiving a test request aiming at a target function interface in an application program APP to be tested, wherein the APP to be tested is an APP running on the basis of a client and a front end, the target function interface belongs to an interface with an operating system function packaged in the APP to be tested, then obtaining a test case and test equipment corresponding to the target function interface, executing the test case on the test equipment to trigger the operation of calling the target function interface on a preset front end page of the APP to be tested, obtaining an execution result corresponding to the test case, and determining the test result of the APP to be tested aiming at the target function interface on the basis of the comparison of the execution result corresponding to the test case and an expected execution result. Therefore, the embodiment of the disclosure can automatically test the target function interface encapsulated with the operating system function in a mixed development mode of a front end and a client.

Description

Functional interface testing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing, and in particular, to a method, an apparatus, a device, and a storage medium for testing a functional interface.
Background
With the rapid development of the internet, a mixed development mode of a front end and a client becomes a mainstream development mode.
The front end runs in the browser and is developed in a page mode, so that the function of the operating system cannot be directly called, the development function of the front end is limited, and the client can package the function of the operating system to the functional interface of the operating system based on the JSbridge method, so that the front end can call the function of the operating system by calling the functional interface of the operating system.
However, because the operating system function encapsulated by the operating system function interface often needs to expand iteration, and the operating system function interface needs to be tested in order to avoid problems in the iteration process, how to test the operating system function interface becomes a technical problem which needs to be solved urgently.
Disclosure of Invention
In order to solve the technical problem, the present disclosure provides a method, an apparatus, a device and a storage medium for testing a functional interface.
In a first aspect, the present disclosure provides a method for testing a functional interface, where the method includes:
receiving a test request aiming at a target function interface in an application program APP to be tested; the APP to be tested is an APP running on the basis of a client and a front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested;
acquiring a test case and test equipment corresponding to the target function interface; the APP to be tested runs on the test equipment;
executing the test case on the test equipment to trigger the operation of calling the target function interface on a preset front-end page of the APP to be tested, so as to obtain an execution result corresponding to the test case;
and determining the test result of the APP to be tested aiming at the target function interface based on the comparison of the execution result corresponding to the test case and the expected execution result.
In an optional implementation manner, before determining the test result of the APP to be tested for the target functional interface based on the comparison between the execution result corresponding to the test case and the expected execution result, the method further includes:
acquiring a test case corresponding to a first functional interface in the APP to be tested; the first functional interface is any interface packaged with an operating system function except the target functional interface in the APP to be tested;
executing the test case corresponding to the first functional interface on the test equipment to obtain a first execution result corresponding to the first functional interface;
correspondingly, the determining the test result of the to-be-tested APP for the target functional interface based on the comparison between the execution result corresponding to the test case and the expected execution result includes:
and determining the test result of the APP to be tested aiming at the target function interface based on the comparison of the historical test execution result of the first function interface with the first execution result and the comparison of the execution result corresponding to the test case of the target function interface with the expected execution result.
In an optional implementation manner, after the executing, on the test device, the test case corresponding to the first functional interface to obtain a first execution result corresponding to the first functional interface, the method further includes:
determining version information of the APP to be detected;
and recording the corresponding relation between the version information of the APP to be tested and a first execution result corresponding to the first functional interface.
In an alternative embodiment, the method further comprises:
and determining whether to perform alarm processing on the target function interface or not based on the test result of the APP to be tested on the target function interface.
In an optional implementation manner, before the executing the test case on the test device to trigger an operation of calling the target function interface on a preset front-end page of the APP to be tested and obtain an execution result corresponding to the test case, the method further includes:
configuring browser information on the test equipment;
correspondingly, the executing the test case on the test equipment to trigger the operation of calling the target function interface on the preset front-end page of the APP to be tested, so as to obtain the execution result corresponding to the test case, includes:
controlling the test equipment to operate a target browser corresponding to the browser information;
executing the test case on the test equipment to trigger a preset front-end page based on the target browser for displaying the APP to be tested, and triggering and calling the operation of the target function interface based on the preset front-end page to obtain an execution result corresponding to the test case.
In an optional implementation manner, the obtaining of the test case and the test device corresponding to the target function interface includes:
sending a device calling request to a cloud device platform; the equipment calling request carries equipment model information;
receiving a device identification list from the cloud device platform; the equipment identifier list stores equipment identifiers corresponding to the equipment model information;
and determining the equipment corresponding to each equipment identifier in the equipment identifier list as test equipment, and acquiring the test case corresponding to the target function interface.
In a second aspect, the present disclosure provides a functional interface testing apparatus, the apparatus comprising:
the device comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a test request aiming at a target function interface in an application program APP to be tested; the APP to be tested is an APP running on the basis of a client and a front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested;
the first acquisition module is used for acquiring the test case and the test equipment corresponding to the target function interface; the APP to be tested runs on the test equipment;
the first execution module is used for executing the test case on the test equipment so as to trigger the operation of calling the target function interface on a preset front-end page of the APP to be tested, and obtain an execution result corresponding to the test case;
and the first determining module is used for determining the test result of the APP to be tested aiming at the target function interface based on the comparison between the execution result corresponding to the test case and the expected execution result.
In a third aspect, the present disclosure provides a computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to implement the above-mentioned method.
In a fourth aspect, the present disclosure provides a functional interface test apparatus, comprising: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the method.
In a fifth aspect, the present disclosure provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the method described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has at least the following advantages:
the functional interface testing method provided by the embodiment of the disclosure includes the steps of firstly receiving a test request for a target functional interface in an application program APP to be tested, wherein the APP to be tested is an APP running on the basis of a client and a front end, the target functional interface belongs to an interface with an operating system function packaged in the APP to be tested, then obtaining a test case and test equipment corresponding to the target functional interface, executing the test case on the test equipment to trigger an operation of calling the target functional interface on a preset front end page of the APP to be tested, obtaining an execution result corresponding to the test case, and determining a test result of the APP to be tested for the target functional interface on the basis of comparison between the execution result corresponding to the test case and an expected execution result. Therefore, the embodiment of the disclosure can automatically test the target function interface encapsulated with the operating system function in a mixed development mode of a front end and a client.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a functional interface testing method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another functional interface testing method provided in the embodiment of the present disclosure;
FIG. 3 is a flow chart of a functional interface test system according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a functional interface testing apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a functional interface testing device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Under the scene of a mixed development mode of a front end and a client, the front end cannot directly call the operating system function, but packages the operating system function to an operating system function interface through the client, so that the front end can call the operating system function by calling the operating system function interface, if the front end cannot directly call the calendar function of the operating system, the client can package the calendar function of the operating system to the operating system function interface 1 based on a JSbridge method, and the front end can call the calendar function of the operating system through the operating system function interface 1.
However, the operating system function encapsulated by the operating system function interface often needs to expand iteration, and in order to avoid problems in the iteration process, the operating system function interface needs to be tested.
Therefore, the disclosed embodiment provides a functional interface testing method, which includes firstly receiving a testing request for a target functional interface in an application program (APP) to be tested, wherein the APP to be tested is an APP running on the basis of a client and a front end, the target functional interface belongs to an interface with an operating system function packaged in the APP to be tested, then obtaining a test case and testing equipment corresponding to the target functional interface, executing the test case on the testing equipment to trigger an operation of calling the target functional interface on a preset front end page of the APP to be tested, obtaining an execution result corresponding to the test case, and determining a testing result of the APP to be tested for the target functional interface on the basis of comparison of the execution result corresponding to the test case and an expected execution result. Therefore, the embodiment of the disclosure can automatically test the target function interface encapsulated with the operating system function in a mixed development mode of a front end and a client.
Based on this, an embodiment of the present disclosure provides a method for testing a functional interface, and referring to fig. 1, the method is a flowchart of the method for testing a functional interface provided in the embodiment of the present disclosure, and the method includes:
s101: and receiving a test request aiming at a target function interface in the application program APP to be tested.
The APP to be tested is the APP running on the basis of the client and the front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested.
For convenience of subsequent description, the interface in which the operating system function is packaged in the APP to be tested is simply referred to as an operating system function interface.
The functional interface testing method provided by the embodiment of the disclosure is applied to a scene of a front-end and client hybrid development mode, and is used for testing a target functional interface encapsulated with an operating system function.
The functional interface testing method provided by the embodiment of the disclosure is applied to a testing platform, and the testing platform can be a server or a server cluster and the like.
Specifically, the front end refers to a web front end which runs in a browser and is developed in a page form, and cannot directly call an operating system function; the client is a program corresponding to the server and providing local services for the user, and generally needs to be installed on user equipment and can directly call the functions of the operating system.
The front-end plus client hybrid development mode refers to that a client encapsulates an operating system function to an operating system function interface, so that the front end can call the operating system function by calling the operating system function interface.
In the embodiment of the present disclosure, the front end may implement calling of an operating system function based on an operating system function interface provided by the client, and specifically, the client encapsulates an operating system function, such as a calendar function, to the operating system function interface 1 based on a JSBridge method, so that the front end may implement calling of the calendar function of the operating system through the operating system function interface 1.
The JSB bridge is also called JavaScript bridge, which is a protocol for communication between the front end and the client, and the two-way interaction between the front end and the client can be realized by calling the JSB bridge.
The target function interface can be one or more operating system function interfaces in the APP to be tested.
S102: and acquiring a test case and test equipment corresponding to the target function interface.
And the APP to be tested runs on the test equipment.
A test case refers to a set of test inputs, execution conditions, and expected execution results designed for a specific purpose, and is used to test the functional interface of the operating system. Each operating system function interface has a corresponding relationship with a test case, and the test case is used for testing the operating system function interface corresponding to the test case.
Specifically, the test case may be obtained from the JSBridge management platform, and in an optional implementation, after receiving a test request for a target function interface in the APP to be tested, the test case corresponding to the target function interface is obtained from the JSBridge management platform.
The JSP bridge management platform stores and manages the mapping relation of the test cases and the function interfaces of the operating system.
The test device may be any one device, for example, a preset device which is easy to have compatibility problems, such as a smartphone of a certain model.
Specifically, the test device may be obtained from the cloud device platform, and in an optional implementation manner, after receiving a test request for a target function interface in the APP to be tested, the test platform sends a device call request carrying device model information to the cloud device platform, then receives a device identifier list from the cloud device platform, and determines devices respectively corresponding to device identifiers in the device identifier list as the test device.
The device identification list stores device identifications corresponding to the device model information.
S103: and executing the test case on the test equipment to trigger the operation of calling the target function interface on the preset front-end page of the APP to be tested, so as to obtain an execution result corresponding to the test case.
The preset front-end page can be any preset front-end page with the function requirement of calling the operating system, and specifically, the front-end page is based on a page displayed by a browser in the to-be-tested APP.
In the embodiment of the present disclosure, the test case may be executed on the test device based on a Uniform Resource Locator (URL) of the test case, specifically, in an operation process of the to-be-tested APP, the test case is executed based on the URL of the test case, and an operation of calling a target function interface on a preset front-end page of the to-be-tested APP is triggered, so as to obtain an execution result corresponding to the test case.
S105: and determining a test result of the APP to be tested aiming at the target function interface based on the comparison of the execution result corresponding to the test case and the expected execution result.
The expected execution result refers to a standard execution result corresponding to a preset test case of the target function interface.
In the embodiment of the disclosure, after the execution result corresponding to the test case is obtained, the execution result corresponding to the test case is compared with the expected execution result, and the test result of the target function interface is determined based on the comparison result.
In an optional implementation manner, if the execution result corresponding to the test case is consistent with the expected execution result, it indicates that the target function interface is successfully tested; and if the execution result corresponding to the test case is inconsistent with the expected execution result, indicating that the target function interface fails to test.
In another optional implementation manner, after the execution result corresponding to the test case is obtained, comparing a difference value between the execution result corresponding to the test case and an expected execution result with a preset threshold value, determining a test result of the target functional interface, and if the difference value between the execution result corresponding to the test case and the expected execution result is smaller than the preset threshold value, indicating that the test of the target functional interface is successful; and if the difference value between the execution result corresponding to the test case and the expected execution result is not less than the preset threshold value, indicating that the target function interface test fails.
The preset threshold may be set as needed, and the disclosure is not limited herein.
In addition, because the operating system functions encapsulated by the target function interface are different in different browsers, in order to improve the comprehensiveness of the target function interface test, corresponding browser information can be configured on the test equipment, and the target browser corresponding to the browser information is used for executing the test case, so that the execution result corresponding to the test case is obtained.
The browser information may include a type, a version number, and the like of the browser.
In an optional implementation manner, after the APP to be tested is installed on the test equipment, browser information is configured on the test equipment, the test equipment is controlled to operate a target browser corresponding to the browser information, a test case is executed on the test equipment, so that a preset front-end page for displaying the APP to be tested based on the target browser is triggered, an operation of calling a target function interface is triggered based on the preset front-end page, and an execution result corresponding to the test case is obtained.
In some embodiments, in order to avoid an abnormal condition that the front end calls an operating system function based on the target function interface after the APP to be tested is online, it may be further determined whether to perform alarm processing for the target function interface based on the test result of the target function interface after the test result of the target function interface is determined.
In an optional implementation manner, if the execution result corresponding to the test case is inconsistent with the expected execution result, it is determined that the target function interface fails to be tested, and at this time, an alarm is performed on the target function interface.
In the functional interface testing method provided by the embodiment of the present disclosure, a test request for a target functional interface in an APP to be tested is first received, where the APP to be tested is an APP running on a client and a front end, the target functional interface belongs to an interface in the APP to be tested, where an operating system function is encapsulated, then a test case and a test device corresponding to the target functional interface are obtained, the test case is executed on the test device to trigger an operation of calling the target functional interface on a preset front end page of the APP to be tested, an execution result corresponding to the test case is obtained, and a test result of the APP to be tested for the target functional interface is determined based on a comparison between an execution result corresponding to the test case and an expected execution result. Therefore, the embodiment of the disclosure can automatically test the target function interface encapsulated with the operating system function in a mixed development mode of a front end and a client.
Based on the foregoing embodiment, in order to further understand the functional interface testing method provided by the embodiment of the present disclosure, the present disclosure also provides a functional interface testing method, and specifically, with reference to fig. 2, is a flowchart of another functional interface testing method provided by the embodiment of the present disclosure, where the method includes:
s201: and receiving a test request aiming at a target function interface in the application program APP to be tested.
The APP to be tested is the APP running on the basis of the client and the front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested.
S202: and acquiring a test case and test equipment corresponding to the target function interface.
And the test equipment runs the APP to be tested.
S203: and executing the test case on the test equipment to trigger the operation of calling the target function interface on the preset front-end page of the APP to be tested, so as to obtain an execution result corresponding to the test case.
It should be noted that the contents described in steps S201 to S203 are the same as the contents described in steps S101 to S103, and specific reference is made to the description of steps S101 to S103, and this disclosure is not repeated herein.
S204: and acquiring a test case corresponding to the first functional interface in the APP to be tested.
The first functional interface is any interface packaged with an operating system function in the APP to be tested except for the target functional interface.
Specifically, the first functional interface may be one or more operating system functional interfaces of the APP to be tested, except for the target functional interface.
In the embodiment of the disclosure, after the execution result corresponding to the test case is obtained, the first functional interface may be continuously tested, and the test case corresponding to the first functional interface in the APP to be tested is obtained first.
Specifically, the test case may be obtained from the JSBridge management platform, and in an optional implementation, after the execution result corresponding to the test case is obtained, the test case corresponding to the first functional interface is obtained from the JSBridge management platform.
The JSP bridge management platform stores and manages the mapping relation of the test cases and the function interfaces of the operating system.
S205: executing the test case corresponding to the first functional interface on the test equipment to obtain a first execution result corresponding to the first functional interface
The test device may be any one device, for example, a preset device that is prone to compatibility problems, such as a smartphone of a certain model.
The first execution result corresponding to the first functional interface is an execution result obtained by executing the test case corresponding to the first functional interface in the running process of the to-be-tested APP after the to-be-tested APP is installed on the test equipment.
S206: and determining the test result of the APP to be tested aiming at the target function interface based on the comparison between the historical test execution result of the first function interface and the first execution result and the comparison between the execution result corresponding to the test case of the target function interface and the expected execution result.
The expected execution result refers to a standard execution result corresponding to a preset test case of the target function interface.
In an optional implementation manner, if the historical test execution result of the first functional interface is consistent with the first execution result, and the execution result corresponding to the test case of the target functional interface is consistent with the expected execution result, it indicates that the target functional interface is successfully tested, otherwise, the target functional interface fails to be tested.
In order to avoid the abnormity of the function of the operating system called by the front end based on the target function interface after the APP to be tested is online, the alarm processing can be performed on the target function interface when the test result of the target function interface is determined to be test failure, and the developer is informed, so that the developer can debug the APP software package to be tested based on the test result until the test of the target function test interface is successful.
In addition, since the first execution result corresponding to the first functional interface may also be used to compare with the execution result of the first functional interface of the next adjacent version, after the first execution result corresponding to the first functional interface is obtained, the corresponding relationship between the version information of the APP to be tested corresponding to the first functional interface and the first execution result corresponding to the first functional interface needs to be recorded in the test platform.
The functional interface testing method provided by the embodiment of the disclosure includes the steps of firstly receiving a testing request for a target functional interface in an application program APP to be tested, wherein the APP to be tested is an APP running on the basis of a client and a front end, the target functional interface belongs to an interface in the APP to be tested, an operating system function is packaged in the APP to be tested, a testing case and testing equipment corresponding to the target functional interface are obtained, the APP to be tested runs on the testing equipment, the testing case is executed on the testing equipment to trigger the operation of calling the target functional interface on a preset front end page of the APP to be tested, an execution result corresponding to the testing case is obtained, a testing case corresponding to a first functional interface (any interface in the APP to be tested, except the target functional interface, in which an operating system function is packaged) is obtained, a testing case corresponding to the first functional interface is executed on the testing equipment, a first execution result corresponding to the first functional interface is obtained, and a comparison between a historical testing execution result based on the first functional interface and a comparison between an execution result corresponding to the target functional interface and a comparison between an execution result corresponding to the testing result corresponding to the target functional interface of the target functional interface is determined. Therefore, the embodiment of the disclosure can realize automatic testing of the target function interface packaged with the operating system function in a mixed development mode of a front end and a client, and simultaneously reduce the influence of expansion iteration of the function of the operating system packaged by the target function interface on the first function interface.
For further understanding of the functional interface testing method provided by the present disclosure, referring to fig. 3, a flowchart of a functional interface testing system provided by an embodiment of the present disclosure is shown.
As shown in fig. 3, the functional interface test system includes a test platform, a cloud device platform, and a JSBridge management platform.
The testing platform is used for receiving a testing request of a target function interface in the APP to be tested, requesting the JSbridge management platform to acquire test cases corresponding to all the operating system function interfaces, then acquiring testing equipment from the cloud equipment platform, installing the APP to be tested on the testing equipment, executing the test cases corresponding to all the operating system function interfaces on the testing equipment, obtaining execution results corresponding to the test cases corresponding to all the operating system function interfaces, and determining the test result of the target function interface based on the execution results.
The cloud equipment platform is used for storing a cloud platform of the test equipment, and can send the equipment identification list to the test platform based on a test equipment calling request sent by the test platform.
The JSP bridge management platform stores and manages the mapping relation of the test cases and the operating system function interfaces, and sends the test cases corresponding to all the operating system function interfaces to the test platform after receiving the test case requests corresponding to all the operating system function interfaces sent by the test platform.
Specifically, after receiving a test request for a target function interface in an APP to be tested, a test platform requests a JSBridge management platform to acquire test cases corresponding to all operating system function interfaces, then sends a device call request carrying device model information to a cloud device platform based on pre-stored device model information, after receiving the device call request carrying device model information, the cloud device platform sends a device identification list storing device identifications corresponding to the device model information to the test platform, and after receiving the device identification list from the cloud device platform, the test platform determines devices corresponding to device identifications in the device identification list as test devices.
After the test platform acquires the test equipment, the to-be-tested APP is installed on the test equipment, the test cases corresponding to all the operating system function interfaces are executed on the test equipment, so that the operation of calling all the operating system function interfaces on the preset front-end page of the to-be-tested APP is triggered, the execution results corresponding to the test cases corresponding to all the operating system function interfaces are obtained, and the test result of the target function interface is determined based on the execution results.
And if the test result of the target function is test failure, alarming the target function interface and informing a developer, so that the developer debugs the APP software package to be tested based on the test result until the target function interface is tested successfully.
Corresponding to the above method embodiment, the present disclosure further provides a functional interface testing apparatus, and referring to fig. 4, a schematic structural diagram of the functional interface testing apparatus provided in the embodiment of the present disclosure is shown, where the apparatus includes:
a receiving module 401, configured to receive a test request for a target function interface in an APP to be tested; the APP to be tested is an APP running based on a client and a front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested;
a first obtaining module 402, configured to obtain a test case and test equipment corresponding to the target function interface; the APP to be tested runs on the test equipment;
a first execution module 403, configured to execute the test case on the test device, so as to trigger an operation of calling the target function interface on a preset front-end page of the APP to be tested, and obtain an execution result corresponding to the test case;
a first determining module 404, configured to determine, based on a comparison between an execution result corresponding to the test case and an expected execution result, a test result of the APP to be tested for the target functional interface.
In an alternative embodiment, the apparatus further comprises:
the second obtaining module is used for obtaining a test case corresponding to the first functional interface in the APP to be tested; the first functional interface is any interface packaged with an operating system function except the target functional interface in the APP to be tested;
the second execution module is used for executing the test case corresponding to the first functional interface on the test equipment to obtain a first execution result corresponding to the first functional interface;
correspondingly, the first determining module is specifically configured to:
and determining the test result of the APP to be tested aiming at the target function interface based on the comparison between the historical test execution result of the first function interface and the first execution result and the comparison between the execution result corresponding to the test case of the target function interface and the expected execution result. In an alternative embodiment, the apparatus further comprises:
the second determining module is used for determining the version information of the APP to be detected;
and the recording module is used for recording the corresponding relation between the version information of the APP to be tested and the first execution result corresponding to the first functional interface.
In an alternative embodiment, the apparatus further comprises:
and the third determining module is used for determining whether to alarm the target function interface or not based on the test result of the APP to be tested for the target function interface.
In an alternative embodiment, the apparatus further comprises:
the configuration module is used for configuring browser information on the test equipment;
correspondingly, the first execution module comprises:
the first control submodule is used for controlling the test equipment to operate a target browser corresponding to the browser information;
and the first execution submodule is used for executing the test case on the test equipment so as to trigger the preset front-end page based on the target browser for displaying the APP to be tested and trigger and call the operation of the target function interface based on the preset front-end page, and obtain the execution result corresponding to the test case.
In an alternative embodiment, the apparatus further comprises:
the sending module is used for sending a device calling request to the cloud device platform; the equipment calling request carries equipment model information;
a receiving module, configured to receive a device identifier list from the cloud device platform; the equipment identifier list stores equipment identifiers corresponding to the equipment model information;
and the fourth determining module is used for determining the devices respectively corresponding to the device identifiers in the device identifier list as the test devices and acquiring the test cases corresponding to the target function interfaces.
In the functional interface testing device provided by the embodiment of the present disclosure, a test request for a target functional interface in an APP to be tested is received first, wherein the APP to be tested is an APP running on the basis of a client and a front end, the target functional interface belongs to an interface in the APP to be tested, which encapsulates an operating system function, then a test case and a test device corresponding to the target functional interface are obtained, the test case is executed on the test device, an operation of calling the target functional interface on a preset front end page of the APP to be tested is triggered, an execution result corresponding to the test case is obtained, and based on a comparison between the execution result corresponding to the test case and an expected execution result, a test result of the APP to be tested for the target functional interface is determined. Therefore, the embodiment of the disclosure can automatically test the target function interface packaged with the operating system function in a mixed development mode of adding the client to the front end.
In addition to the method and the apparatus, the embodiment of the present disclosure further provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a terminal device, the terminal device is enabled to implement the functional interface testing method according to the embodiment of the present disclosure.
The disclosed embodiments also provide a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the functional interface testing method described in the disclosed embodiments is implemented.
In addition, an embodiment of the present disclosure further provides a functional interface testing device, as shown in fig. 5, which may include:
a processor 501, a memory 502, an input device 503, and an output device 504. The number of processors 501 in the functional interface test device may be one or more, and one processor is taken as an example in fig. 5. In some embodiments of the present disclosure, the processor 501, the memory 502, the input device 503 and the output device 504 may be connected through a bus or other means, wherein the connection through the bus is taken as an example in fig. 5.
The memory 502 may be used to store software programs and modules, and the processor 501 may function the functional interface to test various functional applications and data processing of the device by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 503 may be used to receive input numeric or character information and generate signal inputs related to user settings and function controls of the functional interface test apparatus.
Specifically, in this embodiment, the processor 501 loads an executable file corresponding to a process of one or more application programs into the memory 502 according to the following instructions, and the processor 501 runs the application programs stored in the memory 502, thereby implementing various functions of the functional interface test device.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A functional interface testing method, the method comprising:
receiving a test request aiming at a target function interface in an application program APP to be tested; the APP to be tested is an APP running based on a client and a front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested;
acquiring a test case and test equipment corresponding to the target function interface; the APP to be tested runs on the test equipment;
executing the test case on the test equipment to trigger the operation of calling the target function interface on a preset front-end page of the APP to be tested, so as to obtain an execution result corresponding to the test case;
and determining the test result of the APP to be tested aiming at the target function interface based on the comparison between the execution result corresponding to the test case and the expected execution result.
2. The method of claim 1, wherein before determining the test result of the APP to be tested for the target functional interface based on the comparison of the execution result corresponding to the test case with the expected execution result, the method further comprises:
obtaining a test case corresponding to a first functional interface in the APP to be tested; the first functional interface is any interface packaged with an operating system function except the target functional interface in the APP to be tested;
executing the test case corresponding to the first functional interface on the test equipment to obtain a first execution result corresponding to the first functional interface;
correspondingly, the determining the test result of the to-be-tested APP for the target functional interface based on the comparison between the execution result corresponding to the test case and the expected execution result includes:
and determining the test result of the APP to be tested aiming at the target function interface based on the comparison between the historical test execution result of the first function interface and the first execution result and the comparison between the execution result corresponding to the test case of the target function interface and the expected execution result.
3. The method according to claim 2, wherein after the executing the test case corresponding to the first functional interface on the test device to obtain the first execution result corresponding to the first functional interface, the method further includes:
determining version information of the APP to be detected;
and recording the corresponding relation between the version information of the APP to be tested and a first execution result corresponding to the first functional interface.
4. The method according to any one of claims 1-3, further comprising:
and determining whether to perform alarm processing on the target function interface or not based on the test result of the APP to be tested on the target function interface.
5. The method according to claim 1, wherein before executing the test case on the test device to trigger an operation of calling the target function interface on a preset front-end page of the APP to be tested and obtain an execution result corresponding to the test case, the method further includes:
configuring browser information on the test equipment;
correspondingly, the executing the test case on the test equipment to trigger the operation of calling the target function interface on the preset front-end page of the APP to be tested, so as to obtain the execution result corresponding to the test case, includes:
controlling the test equipment to operate a target browser corresponding to the browser information;
executing the test case on the test equipment to trigger a preset front-end page based on the target browser for displaying the APP to be tested, and triggering and calling the operation of the target function interface based on the preset front-end page to obtain an execution result corresponding to the test case.
6. The method according to claim 1, wherein the obtaining of the test case and the test device corresponding to the target function interface comprises:
sending a device calling request to a cloud device platform; the equipment calling request carries equipment model information;
receiving a device identification list from the cloud device platform; the equipment type information is stored in the equipment type list;
and determining the equipment corresponding to each equipment identifier in the equipment identifier list as test equipment, and acquiring the test case corresponding to the target function interface.
7. A functional interface testing apparatus, wherein the transpose comprises:
the device comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a test request aiming at a target function interface in an application program APP to be tested; the APP to be tested is an APP running based on a client and a front end, and the target function interface belongs to an interface with an operating system function packaged in the APP to be tested;
the first acquisition module is used for acquiring the test case and the test equipment corresponding to the target function interface; the APP to be tested runs on the test equipment;
the first execution module is used for executing the test case on the test equipment so as to trigger the operation of calling the target function interface on a preset front-end page of the APP to be tested, and obtain an execution result corresponding to the test case;
and the first determining module is used for determining a test result of the APP to be tested aiming at the target function interface based on the comparison between the execution result corresponding to the test case and an expected execution result.
8. A computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to implement the method of any one of claims 1-6.
9. A data processing apparatus, characterized by comprising: memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1-6 when executing the computer program.
10. A computer program product, characterized in that the computer program product comprises a computer program/instructions which, when executed by a processor, implements the method according to any of claims 1-6.
CN202210993587.5A 2022-08-18 2022-08-18 Functional interface testing method, device, equipment and storage medium Pending CN115269435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210993587.5A CN115269435A (en) 2022-08-18 2022-08-18 Functional interface testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210993587.5A CN115269435A (en) 2022-08-18 2022-08-18 Functional interface testing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115269435A true CN115269435A (en) 2022-11-01

Family

ID=83753868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210993587.5A Pending CN115269435A (en) 2022-08-18 2022-08-18 Functional interface testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115269435A (en)

Similar Documents

Publication Publication Date Title
CN107193750B (en) Script recording method and device
CN108595329B (en) Application testing method and device and computer storage medium
CN108399132B (en) Scheduling test method, device and storage medium
CN106844136B (en) Method and system for collecting program crash information
CN106802814B (en) Method and device for upgrading software version
CN111782339B (en) Container creation method and device, electronic equipment and storage medium
CN104809045B (en) Running method and device of monitoring script
CN109739711B (en) Interface test method, device, equipment and storage medium
CN113505073B (en) Performance test method, device, equipment and medium of database
CN108255708B (en) Method, device, storage medium and equipment for accessing production file in test environment
US11055416B2 (en) Detecting vulnerabilities in applications during execution
CN109032705B (en) Application program execution method and device, electronic equipment and readable storage medium
CN113050984A (en) Resource calling method and device, electronic equipment and storage medium
CN113656107A (en) Mobile application loading method and device and electronic equipment
CN110618853B (en) Detection method, device and equipment for zombie container
CN115391228A (en) Precise test method, device, equipment and medium
CN113032100B (en) Exception handling method, device, equipment and storage medium
CN110704311A (en) Application program testing method and device, electronic equipment and readable storage medium
CN113282501A (en) Block chain testing method and device and electronic equipment
CN115269435A (en) Functional interface testing method, device, equipment and storage medium
CN109446105A (en) Web application test method, device, readable medium and electronic equipment
CN113553578B (en) Log printing response method and device, electronic equipment and storage medium
CN111367796B (en) Application program debugging method and device
CN110221880B (en) Application programming interface calling method, device, equipment and medium
CN110287099B (en) Simplified Loadrunner performance test method, server and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination