CN114077540A - Interface test system and interface test method - Google Patents

Interface test system and interface test method Download PDF

Info

Publication number
CN114077540A
CN114077540A CN202010850968.9A CN202010850968A CN114077540A CN 114077540 A CN114077540 A CN 114077540A CN 202010850968 A CN202010850968 A CN 202010850968A CN 114077540 A CN114077540 A CN 114077540A
Authority
CN
China
Prior art keywords
test
interface
tested
test case
data
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
CN202010850968.9A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology 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 Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010850968.9A priority Critical patent/CN114077540A/en
Publication of CN114077540A publication Critical patent/CN114077540A/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/3664Environments for testing or debugging software
    • 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/3684Test management for test design, e.g. generating new test cases
    • 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

Abstract

The embodiment of the invention provides an interface test system and an interface test method, which comprise the following steps: receiving a data entry instruction, and performing data entry on functional data corresponding to the interface to be tested according to the data entry instruction; generating a test case corresponding to the interface to be tested based on the input function data to obtain a test case library; receiving an environment selection instruction, and selecting a target test environment corresponding to an interface to be tested from preset test environments according to the environment selection instruction; receiving a case selection instruction, acquiring a target test case corresponding to the case selection instruction from a test case library, and testing the interface to be tested based on the target test case and a target test environment to obtain a test result of the interface to be tested. The embodiment of the invention can save labor and time for testing and improve the working efficiency of interface testing.

Description

Interface test system and interface test method
Technical Field
The present invention relates to the field of test technologies, and in particular, to an interface test system and an interface test method.
Background
The interface test is a test for testing interfaces between components of the system, and is mainly used for testing interfaces between the system and other external systems and interfaces between submodules in the system. The key points of the test are to check the correctness of the interface parameter transmission, the correctness of the interface function realization, the correctness of the output result, and the integrity and the rationality of the fault-tolerant processing of various abnormal conditions.
In the prior art, during the process of testing the interface to be tested, a tester usually compiles a test case corresponding to the interface to be tested, and manually manages the test case. The existing interface testing method needs to manually compile test cases for the interfaces to be tested, wastes manpower, and affects the time for testing, thereby affecting the efficiency of interface testing work.
Disclosure of Invention
The embodiment of the invention aims to provide an interface test system and an interface test method so as to improve the working efficiency of interface test. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides an interface test system, where the interface test system includes:
the interface management module is used for carrying out data entry on the functional data corresponding to the interface to be tested according to the data entry instruction, generating a test case corresponding to the interface to be tested based on the entered functional data and obtaining a test case library;
the environment management module is used for selecting a target test environment corresponding to the interface to be tested from preset test environments according to an environment selection instruction;
the case execution module is used for receiving a case selection instruction, acquiring a target test case corresponding to the case selection instruction from the test case library, and testing the to-be-tested interface based on the target test case and the target test environment to obtain a test result of the to-be-tested interface.
Optionally, the interface management module is specifically configured to:
receiving a data entry instruction;
inputting the functional data corresponding to the interface to be tested according to the operation mode corresponding to the data input instruction, and recording the data type and the number of the functional data;
and generating test cases corresponding to the interfaces to be tested based on the functional data and the data types and the number to obtain a test case library, wherein the test case library comprises at least one test case.
Optionally, the interface management module is specifically configured to:
judging whether the data type accords with a preset template type or not;
if the data type does not accord with the preset template type, converting the input functional data into the data of the preset template type to obtain the converted data;
and generating a test case corresponding to the interface to be tested based on the functional data or the converted data which accord with the type of the preset template and the quantity.
Optionally, the use case execution module is specifically configured to:
receiving a use case selection instruction;
acquiring a target test case corresponding to the case selection instruction from the test case library, and generating a test suite;
receiving a test mode selection instruction;
and testing the interface to be tested by using the test kit based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested.
Optionally, the use case execution module is specifically configured to:
when the testing mode corresponding to the testing mode selection instruction is a manual execution mode, receiving a trigger instruction for testing the interface to be tested, and testing the interface to be tested by using the testing kit in the target testing environment to obtain a testing result of the interface to be tested;
or the like, or, alternatively,
and when the test mode corresponding to the test mode selection instruction is a timer execution mode, testing the interface to be tested by using the test suite in the target test environment based on a preset timer execution mode to obtain a test result of the interface to be tested.
Optionally, the system further comprises: a user management module;
and the user management module is used for receiving an operation instruction of a user on the test case contained in the test case library and responding to the operation instruction.
Optionally, the user management module is specifically configured to:
receiving an operation instruction of a user on a test case contained in the test case library; the operation instruction includes: the method comprises the following steps of (1) adding a test case, modifying a test case, deleting a test case and inquiring a test case;
judging whether the authority corresponding to the user can respond to the operation instruction;
and if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction.
Optionally, the user management module is further configured to:
and displaying the current user information in the system and the data information operated by the current user according to a preset display mode.
In a second aspect, an embodiment of the present invention provides an interface testing method, where the interface testing method includes:
receiving a data entry instruction, and performing data entry on functional data corresponding to the interface to be tested according to the data entry instruction;
generating a test case corresponding to an interface to be tested based on the input function data to obtain a test case library, wherein the test case library comprises at least one test case;
receiving an environment selection instruction, and selecting a target test environment corresponding to the interface to be tested from preset test environments according to the environment selection instruction;
receiving a case selection instruction, and acquiring a target test case corresponding to the case selection instruction from the test case library;
and testing the interface to be tested based on the target test case and the target test environment to obtain a test result of the interface to be tested.
Optionally, the step of performing data entry on the functional data corresponding to the interface to be tested according to the data entry instruction includes:
inputting the functional data corresponding to the interface to be tested according to the operation mode corresponding to the data input instruction, and recording the data type and the number of the functional data;
the step of generating a test case corresponding to the interface to be tested based on the entered functional data to obtain a test case library includes:
and generating a test case corresponding to the interface to be tested based on the functional data and the data type and quantity to obtain a test case library.
Optionally, the step of generating a test case corresponding to the interface to be tested based on the functional data and the data type and number to obtain a test case library includes:
judging whether the data type accords with a preset template type or not;
if the data type does not accord with the preset template type, converting the input functional data into the data of the preset template type to obtain the converted data;
and automatically generating the test cases corresponding to the interfaces to be tested based on the functional data or the converted data which accord with the type of the preset template and the quantity.
Optionally, the step of testing the interface to be tested based on the target test case and the target test environment to obtain a test result of the interface to be tested includes:
generating a test suite based on the target test case;
receiving a test mode selection instruction;
and testing the interface to be tested by using the test kit based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested.
Optionally, the step of testing the to-be-tested interface by using the test kit based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain the test result of the to-be-tested interface includes:
when the testing mode corresponding to the testing mode selection instruction is a manual execution mode, receiving a trigger instruction for testing the interface to be tested, and testing the interface to be tested by using the testing kit in the target testing environment to obtain a testing result of the interface to be tested;
or the like, or, alternatively,
and when the test mode corresponding to the test mode selection instruction is a timer execution mode, testing the interface to be tested by using the test suite in the target test environment based on a preset timer execution mode to obtain a test result of the interface to be tested.
Optionally, the method further comprises:
and receiving an operation instruction of a user on the test case contained in the test case library, and responding to the operation instruction.
Optionally, the step of receiving an operation instruction of a user on a test case included in the test case library and responding to the operation instruction includes:
receiving an operation instruction of a user on a test case contained in the test case library; the operation instruction includes: the method comprises the following steps of (1) adding a test case, modifying a test case, deleting a test case and inquiring a test case;
judging whether the authority corresponding to the user can respond to the operation instruction;
and if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction.
Optionally, the method further comprises:
and displaying the current user information and the data information operated by the current user according to a preset display mode.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the method steps of the interface testing method provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps of the interface testing method provided in the first aspect are implemented.
In a fifth aspect, an embodiment of the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the method steps of the interface testing method provided in the first aspect.
In a sixth aspect, an embodiment of the present invention further provides a computer program, which when run on a computer, causes the computer to perform the method steps of the interface testing method provided in the first aspect.
The embodiment of the invention has the following beneficial effects:
according to the interface test system and the interface test method provided by the embodiment of the invention, an interface management module carries out data entry on functional data corresponding to an interface to be tested according to a data entry instruction, generates a test case corresponding to the interface to be tested based on the entered functional data, and obtains a test case library, an environment management module selects a target test environment corresponding to the interface to be tested from a preset test environment according to an environment selection instruction, a case execution module receives the case selection instruction, obtains the target test case corresponding to the case selection instruction from the test case library, and tests the interface to be tested based on the target test case and the target test environment, so as to obtain a test result of the interface to be tested. In the embodiment of the invention, because the functional data corresponding to the interface to be tested can be automatically data-typed according to the data-typed instruction, the test case corresponding to the interface to be tested is automatically generated based on the typed functional data to obtain the test case library, and then the interface to be tested is tested based on the target test case corresponding to the case selection instruction and obtained from the test case library and the target test environment to obtain the test result of the interface to be tested, the manual compiling of the test case for the interface to be tested is avoided, the manpower and the time for testing can be saved, and the working efficiency of the interface testing is improved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an interface test system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of another interface test system according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an interface management module function according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a function of a use case execution module according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a function of a user management module according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of an interface testing method according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of an embodiment of test case generation according to an embodiment of the present invention;
FIG. 8 is a schematic flow chart of a use case testing embodiment according to an embodiment of the present invention;
fig. 9 is a schematic flowchart of an embodiment of a user operation according to the present invention;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that in the existing interface testing process, a test case needs to be manually compiled for an interface to be tested, manpower is wasted, and meanwhile, time for testing is affected, so that the interface testing work efficiency is affected, an embodiment of the invention provides an interface testing system and an interface testing method, wherein the interface testing system can comprise:
the interface management module is used for carrying out data entry on the functional data corresponding to the interface to be tested according to the data entry instruction, generating a test case corresponding to the interface to be tested based on the entered functional data and obtaining a test case library;
the environment management module is used for selecting a target test environment corresponding to the interface to be tested from preset test environments according to the environment selection instruction;
the case execution module is used for receiving the case selection instruction, acquiring a target test case corresponding to the case selection instruction from the test case library, and testing the interface to be tested based on the target test case and the target test environment to obtain a test result of the interface to be tested.
According to the interface test system provided by the embodiment of the invention, the functional data corresponding to the interface to be tested can be automatically subjected to data entry according to the data entry instruction, the test case corresponding to the interface to be tested is automatically generated based on the entered functional data to obtain the test case library, and then the interface to be tested is tested based on the target test case corresponding to the case selection instruction and obtained from the test case library and the target test environment to obtain the test result of the interface to be tested, so that the test case is prevented from being manually compiled for the interface to be tested, the labor and the time for testing can be saved, and the working efficiency of interface test is improved.
The following describes an interface test system provided by an embodiment of the present invention in detail:
as shown in fig. 1, the interface test system 100 in the embodiment of the present invention may be a test system arranged in a server, and the server may adopt a cluster deployment manner, and in the cluster deployment manner, the interface test system on the server may obtain test data from multiple server devices, so that the data response speed is high, and the test efficiency is further improved.
As shown in fig. 2, an embodiment of the present invention provides an interface test system, which may include: an interface management module 101, an environment management module 102 and a use case execution module 103.
The interface management module 101 may be configured to perform data entry on the functional data corresponding to the interface to be tested according to the data entry instruction, and generate a test case corresponding to the interface to be tested based on the entered functional data, so as to obtain a test case library.
In the embodiment of the present invention, the interface management module 101 may be configured to receive a data entry instruction, where the data entry instruction may indicate a manner adopted by data entry, perform data entry on functional data corresponding to an interface to be tested according to the data entry instruction, and generate a test case corresponding to the interface to be tested based on the entered functional data after the data entry, so as to obtain a test case library.
The functional data corresponding to the interface to be tested may be related data for testing the function of the interface to be tested, and for example, when the ticket purchasing interface of the website is tested, the related data for the function of the ticket purchasing interface may be: user name, user type, vehicle type, etc.
The environment management module 102 is configured to select, according to the environment selection instruction, a target test environment corresponding to the interface to be tested from preset test environments.
The environment management module 102 may manage a test environment of the interface to be tested, where the test environment may include: real environments and simulated environments. In practical application, the testing environment can be selected according to actual requirements, a real environment can be selected by default to test the interface to be tested under normal conditions, and when the real environment cannot be accessed, the simulation environment can be switched to test the interface to be tested.
When the interface test is needed, an environment selection instruction aiming at the test environment can be received, so that the test environment for testing the interface to be tested is selected from the real environment and the simulation environment, and the selected test environment is used as the target test environment corresponding to the interface to be tested.
The case execution module 103 is configured to receive the case selection instruction, obtain a target test case corresponding to the case selection instruction from the test case library, and test the interface to be tested based on the target test case and the target test environment to obtain a test result of the interface to be tested.
The case execution module 103 may be configured to execute a test on an interface to be tested, and when an interface test is required, may receive a case selection instruction for testing the interface to be tested, select a test case required by the interface to be tested from the generated test case library, and then test the interface to be tested using the selected test case in the selected target test environment to obtain a test result of the interface to be tested.
According to the interface test system provided by the embodiment of the invention, the functional data corresponding to the interface to be tested can be automatically subjected to data entry according to the data entry instruction, the test case corresponding to the interface to be tested is automatically generated based on the entered functional data to obtain the test case library, and then the interface to be tested is tested based on the target test case corresponding to the case selection instruction and obtained from the test case library and the target test environment to obtain the test result of the interface to be tested, so that the test case is prevented from being manually compiled for the interface to be tested, the labor and the time for testing can be saved, and the working efficiency of interface test is improved.
As an optional implementation manner of the embodiment of the present invention, the interface management module 101 may be specifically configured to:
the method comprises the steps of receiving a data entry instruction, entering functional data corresponding to an interface to be tested according to an operation mode corresponding to the data entry instruction, recording the data type and the number of the functional data, and generating a test case corresponding to the interface to be tested based on the functional data and the data type and the number to obtain a test case library, wherein the test case library comprises at least one test case.
In the embodiment of the present invention, the interface management module 101 receives a data entry instruction, where an operation mode corresponding to the data entry instruction may be a manual entry mode or an automatic entry mode, and then, according to the operation mode corresponding to the data entry instruction, enters functional data corresponding to the interface to be tested, and records a data type and a quantity of the functional data, where the quantity may represent information such as the number of the functional data. And automatically generating test cases corresponding to the interfaces to be tested based on the functional data and the data types and the number to obtain a test case library, wherein the test case library comprises at least one test case.
In practical application, the functional data corresponding to the interface to be tested may be pre-stored in a database or a network disk of a server or a cluster, and when data entry is required, the data may be directly read from the database or the network disk.
In the embodiment of the invention, after the test case is generated and the test case library is obtained, the test case can be stored according to the information such as the type, the identification and the like of the test case, and then when the interface is required to be tested and the test case is used, the corresponding test case is obtained from the test case library. For example, the identifier of the test case may be a name of the test case or an ID (identification) of the test case, and the obtained test case library may be stored locally, or in a corresponding database, or in a network disk.
In the embodiment of the invention, the generated test case can be managed in a version number mode, when the test case is generated, the version number corresponding to the test case is automatically generated and stored, and the version number of the later generated test case is larger than the version number of the previously generated test case.
Exemplarily, as shown in fig. 3, fig. 3 is a schematic structural diagram of an interface management module function according to an embodiment of the present invention. When the manual entry mode is selected to record the functional data corresponding to the interface to be tested, the type of data entry may be, for example, data based on an HTTP (HyperText Transfer Protocol) type, data based on an HTTPs (HyperText Transfer Protocol over Secure Socket Layer) type, data based on a RESTful (Representational State Transfer) type, or data based on a Web type, and the Web type may include an RPC (Remote Procedure Call) type, an RMI (Remote Method Invocation ), a SOAP (Simple Object Access Protocol) type, and the like.
When the automatic entry mode is selected to be used for entering the functional data corresponding to the interface to be tested, data entry can be further selected to be performed in a single entry mode or a batch entry mode, the type of the data entry can be, for example, data based on swagger type, data based on postman type, data based on HAR (HTTP Archive format), and the like, and the entered data can also be data in a third-party platform.
In the embodiment of the invention, the functional data corresponding to the interface to be tested can be automatically input, the data input time is saved, the test case can be further quickly generated, the interface test time is saved, and the interface test efficiency is improved.
When the functional data corresponding to the interface to be tested is recorded, the data type and the number of the recorded functional data can be recorded, and then the test case corresponding to the interface to be tested is automatically generated based on the functional data and the data type and the number, so that a test case library is obtained for the interface test. Alternatively, documents may be automatically generated for archiving or querying, etc., based on the functional data and the type and amount of data.
As an optional implementation manner of the embodiment of the present invention, the process of automatically generating the test case corresponding to the interface to be tested by the interface management module 101 based on the functional data and the data type and number may be:
judging whether the data type accords with the preset template type, if the data type does not accord with the preset template type, converting the input functional data into the data of the preset template type to obtain the converted data, and generating the test case corresponding to the interface to be tested based on the functional data which accords with the preset template type or the converted data and the quantity.
After the functional data corresponding to the interface to be tested is entered, whether the entered data type meets a preset template type can be judged, and the preset template type can be a standard data type which is preset for an interface test system in the embodiment of the invention and is used for generating a test case. When the type of the input data does not accord with the type of the preset template, the input functional data can be converted into the data of the type of the preset template to obtain the converted data, and then, based on the functional data or the converted data which accord with the type of the preset template and the quantity of the input data, the test case corresponding to the interface to be tested is automatically generated.
In the embodiment of the invention, the data types used by the test cases are generated uniformly, and the standard data types used for generating the test cases are set as the template types, so that the data compatibility of the interface test system is improved.
As an optional implementation manner of the embodiment of the present invention, the use case execution module 103 may be specifically configured to:
the method comprises the steps of receiving a case selection instruction, obtaining a target test case corresponding to the case selection instruction from a test case library, generating a test suite, receiving a test mode selection instruction, and testing an interface to be tested by using the test suite based on a target test environment and a test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested.
In this embodiment of the present invention, the use case execution module 103 may receive a use case selection instruction, where the use case selection instruction may indicate a test use case that needs to be selected. It can be understood that the case selection instruction may carry information such as a type or an identifier of a test case, and further, according to the information such as the type or the identifier of the test case carried in the case selection instruction, a target test case corresponding to the case selection instruction is obtained from a test case library, and a test suite is generated.
After receiving the test mode selection instruction, testing the interface to be tested by using the test suite based on the selected target test environment and the test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested. For example, the test result may be an execution result report automatically generated after the test of the interface to be tested is performed, or the like.
Exemplarily, as shown in fig. 4, fig. 4 is a schematic structural diagram of a function of a use case execution module according to an embodiment of the present invention. In the embodiment of the present invention, the test mode corresponding to the test mode selection instruction may include: a manual trigger test mode, a timer execution mode and the like.
As an optional implementation manner of the embodiment of the present invention, the process of using the test suite to test the interface to be tested based on the target test environment and the test manner corresponding to the test manner selection instruction by the case execution module 103 to obtain the test result of the interface to be tested may be:
and when the test mode corresponding to the test mode selection instruction is a manual execution mode, receiving a trigger instruction for testing the interface to be tested, and testing the interface to be tested by using the test kit in a target test environment to obtain a test result of the interface to be tested.
Or when the test mode corresponding to the test mode selection instruction is the timer execution mode, testing the interface to be tested by using the test suite in the target test environment based on the preset timer execution mode to obtain the test result of the interface to be tested.
In the embodiment of the invention, when the test mode corresponding to the test mode selection instruction is a manual execution mode, the interface to be tested can be tested only by receiving the trigger instruction for starting the test, and after the trigger instruction for testing the interface to be tested is received, the obtained test suite is used for testing the interface to be tested in a target test environment, so that the test result of the interface to be tested is obtained.
When the test mode corresponding to the test mode selection instruction is the timer execution mode, the test is not required to be triggered manually, but the test kit can be used for testing the interface to be tested in the target test environment according to the preset timer execution mode, so that the test result of the interface to be tested is obtained. The execution mode of the timer can be a mode of setting periodic triggering to test the interface to be tested, or a mode of setting a certain time interval to test the interface to be tested, and the like.
In the embodiment of the invention, the interface to be tested can be tested by using a timer execution mode, so that the labor can be saved, and the working efficiency of the interface test can be improved.
As an optional implementation manner of the embodiment of the present invention, after the test result of the interface to be tested is obtained, the test result of the interface to be tested may be sent to a preset user. For example, the test result of the interface to be tested may be sent to any user needing sending in an email manner. The content of the mail may include: the system comprises a test interface, a target test environment, a test suite, a target test case in the test suite, test execution time, a test result and the like.
As an optional implementation manner of the embodiment of the present invention, as shown in fig. 1, the interface test system may further include: the user management module 104, where the user management module 104 may be configured to receive an operation instruction of a user on a test case included in the test case library, and respond to the operation instruction.
In the embodiment of the present invention, the user management module 104 may be configured to manage a user and an operation thereof, and specifically, may receive an operation instruction of a test case generated by the user on the interface management module 101, and further respond to the operation instruction.
As an optional implementation manner of the embodiment of the present invention, the user management module 104 may be specifically configured to:
receiving an operation instruction of a user on a test case contained in a test case library, wherein the operation instruction comprises: the method comprises the following steps of (1) adding a test case, modifying a test case, deleting a test case and inquiring a test case; judging whether the authority corresponding to the user can respond to the operation instruction; and if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction.
In this embodiment of the present invention, the user management module 104 may receive an operation instruction of a user on a test case included in the test case library, where the operation instruction may include: the test case adding instruction, the test case modifying instruction, the test case deleting instruction, the test case inquiring instruction and the like.
Exemplarily, as shown in fig. 5, fig. 5 is a schematic structural diagram of a function of a user management module according to an embodiment of the present invention. In the embodiment of the present invention, the user management module 104 may be configured to manage the user and the operation thereof, and specifically, may preset an operation right corresponding to the user, and associate the user with the operation right corresponding to the user. For example, the authority of the user a may include adding and deleting a test case, the authority of the user B may include modifying and querying a test case, and the authority of the user C may include adding and modifying a test case.
After receiving an operation instruction of a user on a test case contained in the test case library, judging whether the authority corresponding to the user can respond to the operation instruction, if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction, and if the authority corresponding to the user cannot respond to the operation instruction, not responding to the operation instruction.
As an optional implementation manner of the embodiment of the present invention, the user management module 104 may be further configured to:
and displaying the current user information in the system and the data information operated by the current user according to a preset display mode.
In the embodiment of the present invention, the user management module 104 may receive an operation of a user logging in the interface test system on a test case included in the test case library, may further display information of all current users logged in the interface test system according to a preset display manner, and may further display data information that is being operated by all current users logged in the interface test system. The information of the current user may be a user name, a user ID, etc. of the current user, the data information operated by the current user may be operation information, etc. being executed by the current user, and the preset display mode may be a real-time refresh mode, a periodic refresh mode, or a timing refresh mode, etc.
For example, all current users in the login interface test system are user a and user B, user a is modifying test case a1, user B is querying test case B1, and the current users may be displayed when user a is modifying test case a1 and user B is querying test case B1, where the specific display sequence may be: according to the time sequence of the user A and the user B, or the sequence of the test case A1 and B1 generation time, and the like.
In the embodiment of the invention, the current user information in the system and the data information operated by the current user can be displayed according to the preset display mode, so that the real-time visibility of the data in the interface test system is ensured, and the concurrence problem of operating the same test case by different users can be prevented.
Corresponding to the above system embodiment, the embodiment of the present invention further provides a corresponding method embodiment.
As shown in fig. 6, an embodiment of the present invention provides an interface testing method, which may be applied to the interface testing system, where the method may include:
s201, receiving a data entry instruction, and performing data entry on the functional data corresponding to the interface to be tested according to the data entry instruction.
S202, generating a test case corresponding to the interface to be tested based on the recorded function data to obtain a test case library, wherein the test case library comprises at least one test case.
S203, receiving an environment selection instruction, and selecting a target test environment corresponding to the interface to be tested from the preset test environment according to the environment selection instruction.
S204, receiving the case selection instruction, and acquiring the target test case corresponding to the case selection instruction from the test case library.
S205, testing the interface to be tested based on the target test case and the target test environment to obtain a test result of the interface to be tested.
The specific implementation of steps S201 to S205 may refer to the above description, and the embodiment of the present invention is not described herein again.
According to the interface testing method provided by the embodiment of the invention, the functional data corresponding to the interface to be tested can be automatically subjected to data entry according to the data entry instruction, the test case corresponding to the interface to be tested is automatically generated based on the entered functional data to obtain the test case library, and then the interface to be tested is tested based on the target test case corresponding to the case selection instruction and obtained from the test case library and the target testing environment to obtain the testing result of the interface to be tested, so that the test case is prevented from being manually compiled for the interface to be tested, the labor and the time for testing can be saved, and the working efficiency of interface testing is improved.
Optionally, the step of performing data entry on the functional data corresponding to the interface to be tested according to the data entry instruction in step S201 may include:
and inputting the functional data corresponding to the interface to be tested according to the operation mode corresponding to the data input instruction, and recording the data type and the number of the functional data.
Optionally, the implementation of step S202 may include:
and generating a test case corresponding to the interface to be tested based on the functional data and the data type and quantity to obtain a test case library.
Optionally, as shown in fig. 7, the step of generating a test case corresponding to the interface to be tested based on the functional data and the data type and quantity to obtain a test case library may include:
s301, judging whether the data type accords with the preset template type.
S302, if the data type does not accord with the preset template type, converting the input functional data into the data of the preset template type to obtain the converted data.
S303, generating a test case corresponding to the interface to be tested based on the functional data or the converted data which accord with the type of the preset template and the quantity.
Optionally, as shown in fig. 8, the implementation of step S205 may include:
s401, generating a test suite based on the target test case.
S402, receiving a test mode selection instruction.
And S403, testing the interface to be tested by using the test kit based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested.
Optionally, the implementation of step S403 may include:
and when the test mode corresponding to the test mode selection instruction is a manual execution mode, receiving a trigger instruction for testing the interface to be tested, and testing the interface to be tested by using the test kit in a target test environment to obtain a test result of the interface to be tested.
Or the like, or, alternatively,
and when the test mode corresponding to the test mode selection instruction is the timer execution mode, testing the interface to be tested by using the test suite in the target test environment based on the preset timer execution mode to obtain the test result of the interface to be tested.
Optionally, the method may further include:
and receiving an operation instruction of a user on the test case contained in the test case library, and responding to the operation instruction.
Optionally, as shown in fig. 9, the step of receiving an operation instruction of a user on a test case included in the test case library and responding to the operation instruction may include:
s501, receiving an operation instruction of a user on a test case contained in a test case library; the operation instruction comprises: the test case adding instruction, the test case modifying instruction, the test case deleting instruction and the test case inquiring instruction.
And S502, judging whether the authority corresponding to the user can respond to the operation instruction.
S503, if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction.
Optionally, the method may further include:
and displaying the current user information and the data information operated by the current user according to a preset display mode.
In the embodiment of the present invention, as for the method embodiment, since it is basically similar to the system embodiment described above, the description is relatively simple, and the relevant points can be referred to the partial description of the system embodiment.
As shown in fig. 10, the device 600 includes a processor 601 and a machine-readable storage medium 602, where the machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor executes the machine-executable instructions to implement the steps of the interface testing method provided in the embodiment of the present invention.
The machine-readable storage medium may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
According to the electronic equipment provided by the embodiment of the invention, the functional data corresponding to the interface to be tested can be automatically subjected to data entry according to the data entry instruction, the test case corresponding to the interface to be tested is automatically generated based on the entered functional data to obtain the test case library, and then the interface to be tested is tested based on the target test case corresponding to the case selection instruction and obtained from the test case library and the target test environment to obtain the test result of the interface to be tested, so that the test case is prevented from being manually compiled for the interface to be tested, the labor and the time for testing can be saved, and the working efficiency of interface testing is improved.
The embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program is used to execute the steps of the interface testing method provided by the embodiment of the present invention, so as to achieve the same effect.
Embodiments of the present invention further provide a computer program product including instructions, which when run on a computer, causes the computer to execute the steps of the interface testing method provided in the embodiments of the present invention, so as to achieve the same effect.
It is noted that, herein, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the method/electronic device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (18)

1. An interface test system, the interface test system comprising:
the interface management module is used for carrying out data entry on the functional data corresponding to the interface to be tested according to the data entry instruction, generating a test case corresponding to the interface to be tested based on the entered functional data and obtaining a test case library;
the environment management module is used for selecting a target test environment corresponding to the interface to be tested from preset test environments according to an environment selection instruction;
the case execution module is used for receiving a case selection instruction, acquiring a target test case corresponding to the case selection instruction from the test case library, and testing the to-be-tested interface based on the target test case and the target test environment to obtain a test result of the to-be-tested interface.
2. The system of claim 1, wherein the interface management module is specifically configured to:
receiving a data entry instruction;
inputting the functional data corresponding to the interface to be tested according to the operation mode corresponding to the data input instruction, and recording the data type and the number of the functional data;
and generating test cases corresponding to the interfaces to be tested based on the functional data and the data types and the number to obtain a test case library, wherein the test case library comprises at least one test case.
3. The system of claim 2, wherein the interface management module is specifically configured to:
judging whether the data type accords with a preset template type or not;
if the data type does not accord with the preset template type, converting the input functional data into the data of the preset template type to obtain the converted data;
and generating a test case corresponding to the interface to be tested based on the functional data or the converted data which accord with the type of the preset template and the quantity.
4. The system according to claim 1, wherein the use case execution module is specifically configured to:
receiving a use case selection instruction;
acquiring a target test case corresponding to the case selection instruction from the test case library, and generating a test suite;
receiving a test mode selection instruction;
and testing the interface to be tested by using the test kit based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested.
5. The system of claim 4, wherein the use case execution module is specifically configured to:
when the testing mode corresponding to the testing mode selection instruction is a manual execution mode, receiving a trigger instruction for testing the interface to be tested, and testing the interface to be tested by using the testing kit in the target testing environment to obtain a testing result of the interface to be tested;
or the like, or, alternatively,
and when the test mode corresponding to the test mode selection instruction is a timer execution mode, testing the interface to be tested by using the test suite in the target test environment based on a preset timer execution mode to obtain a test result of the interface to be tested.
6. The system of claim 1, further comprising: a user management module;
and the user management module is used for receiving an operation instruction of a user on the test case contained in the test case library and responding to the operation instruction.
7. The system of claim 6, wherein the user management module is specifically configured to:
receiving an operation instruction of a user on a test case contained in the test case library; the operation instruction includes: the method comprises the following steps of (1) adding a test case, modifying a test case, deleting a test case and inquiring a test case;
judging whether the authority corresponding to the user can respond to the operation instruction;
and if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction.
8. The system according to any of claims 6-7, wherein the user management module is further configured to:
and displaying the current user information in the system and the data information operated by the current user according to a preset display mode.
9. An interface testing method, characterized in that the interface testing method comprises:
receiving a data entry instruction, and performing data entry on functional data corresponding to the interface to be tested according to the data entry instruction;
generating a test case corresponding to an interface to be tested based on the input function data to obtain a test case library, wherein the test case library comprises at least one test case;
receiving an environment selection instruction, and selecting a target test environment corresponding to the interface to be tested from preset test environments according to the environment selection instruction;
receiving a case selection instruction, and acquiring a target test case corresponding to the case selection instruction from the test case library;
and testing the interface to be tested based on the target test case and the target test environment to obtain a test result of the interface to be tested.
10. The method according to claim 9, wherein the step of performing data entry on the functional data corresponding to the interface to be tested according to the data entry instruction includes:
inputting the functional data corresponding to the interface to be tested according to the operation mode corresponding to the data input instruction, and recording the data type and the number of the functional data;
the step of generating a test case corresponding to the interface to be tested based on the entered functional data to obtain a test case library includes:
and generating a test case corresponding to the interface to be tested based on the functional data and the data type and quantity to obtain a test case library.
11. The method according to claim 10, wherein the step of generating the test cases corresponding to the interfaces to be tested based on the functional data and the data types and quantities to obtain a test case library comprises:
judging whether the data type accords with a preset template type or not;
if the data type does not accord with the preset template type, converting the input functional data into the data of the preset template type to obtain the converted data;
and generating a test case corresponding to the interface to be tested based on the functional data or the converted data which accord with the type of the preset template and the quantity.
12. The method of claim 9, wherein the step of testing the interface to be tested based on the target test case and the target test environment to obtain the test result of the interface to be tested comprises:
generating a test suite based on the target test case;
receiving a test mode selection instruction;
and testing the interface to be tested by using the test kit based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain a test result of the interface to be tested.
13. The method according to claim 12, wherein the step of testing the interface to be tested by using the test suite based on the target test environment and the test mode corresponding to the test mode selection instruction to obtain the test result of the interface to be tested comprises:
when the testing mode corresponding to the testing mode selection instruction is a manual execution mode, receiving a trigger instruction for testing the interface to be tested, and testing the interface to be tested by using the testing kit in the target testing environment to obtain a testing result of the interface to be tested;
or the like, or, alternatively,
and when the test mode corresponding to the test mode selection instruction is a timer execution mode, testing the interface to be tested by using the test suite in the target test environment based on a preset timer execution mode to obtain a test result of the interface to be tested.
14. The method of claim 9, further comprising:
and receiving an operation instruction of a user on the test case contained in the test case library, and responding to the operation instruction.
15. The method according to claim 14, wherein the step of receiving an operation instruction of a user on a test case included in the test case library and responding to the operation instruction comprises:
receiving an operation instruction of a user on a test case contained in the test case library; the operation instruction includes: the method comprises the following steps of (1) adding a test case, modifying a test case, deleting a test case and inquiring a test case;
judging whether the authority corresponding to the user can respond to the operation instruction;
and if the authority corresponding to the user can respond to the operation instruction, responding to the operation instruction.
16. The method according to any one of claims 14-15, further comprising:
and displaying the current user information and the data information operated by the current user according to a preset display mode.
17. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor to perform method steps of an interface testing method according to any one of claims 9 to 16.
18. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method steps of an interface testing method according to any one of claims 9 to 16.
CN202010850968.9A 2020-08-21 2020-08-21 Interface test system and interface test method Pending CN114077540A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010850968.9A CN114077540A (en) 2020-08-21 2020-08-21 Interface test system and interface test method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010850968.9A CN114077540A (en) 2020-08-21 2020-08-21 Interface test system and interface test method

Publications (1)

Publication Number Publication Date
CN114077540A true CN114077540A (en) 2022-02-22

Family

ID=80282550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010850968.9A Pending CN114077540A (en) 2020-08-21 2020-08-21 Interface test system and interface test method

Country Status (1)

Country Link
CN (1) CN114077540A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114177A (en) * 2022-08-31 2022-09-27 云账户技术(天津)有限公司 Method and device for generating gPC scene template
CN115509900A (en) * 2022-09-15 2022-12-23 上海宜软检测技术有限公司 Method and system for generating functional test case

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115114177A (en) * 2022-08-31 2022-09-27 云账户技术(天津)有限公司 Method and device for generating gPC scene template
CN115509900A (en) * 2022-09-15 2022-12-23 上海宜软检测技术有限公司 Method and system for generating functional test case
CN115509900B (en) * 2022-09-15 2024-02-02 上海宜软检测技术有限公司 Method and system for generating functional test cases

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN108628748B (en) Automatic test management method and automatic test management system
CN108134708B (en) Method and device for monitoring third-party interface
CN114077540A (en) Interface test system and interface test method
CN111090592A (en) Automatic testing method of buried point, terminal and readable storage medium
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN111949545A (en) Automatic testing method, system, server and storage medium
CN105204986A (en) Automated product testing method, server and mobile equipment
CN104579830A (en) Service monitoring method and device
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
AlGhamdi et al. Towards reducing the time needed for load testing
CN111694550A (en) Page display control method, device and system
CN114625645A (en) Service testing method and device, electronic equipment and readable storage medium
CN111309570A (en) Pressure testing method, medium, device and computing equipment
CN111338931A (en) Buried point testing method, device, equipment and storage medium
CN107102937B (en) User interface testing method and device
CN110689259A (en) Power system statistic digital detection management system
WO2021003924A1 (en) Scheduled testing task control method, device, computer device, and storage medium
CN112835779A (en) Test case determination method and device and computer equipment
CN110851688A (en) Page request method, device and equipment
CN116016270A (en) Switch test management method and device, electronic equipment and storage medium
CN115344490A (en) Method and device for testing software product, storage medium and electronic equipment
US20160132424A1 (en) Simulating sensors
CN113672497A (en) Method, device and equipment for generating non-buried point event and storage medium
CN112346994A (en) Test information correlation method and device, computer equipment and 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