CN116340182A - Interface testing method, device, terminal and storage medium - Google Patents

Interface testing method, device, terminal and storage medium Download PDF

Info

Publication number
CN116340182A
CN116340182A CN202310350589.7A CN202310350589A CN116340182A CN 116340182 A CN116340182 A CN 116340182A CN 202310350589 A CN202310350589 A CN 202310350589A CN 116340182 A CN116340182 A CN 116340182A
Authority
CN
China
Prior art keywords
test
interface
user
case
text
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
CN202310350589.7A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202310350589.7A priority Critical patent/CN116340182A/en
Publication of CN116340182A publication Critical patent/CN116340182A/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/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention provides an interface test method, an interface test device, a terminal and a storage medium, wherein the interface test method, the interface test device, the terminal and the storage medium are used for responding to the triggering operation of a user on a preset control and generating interface test text content corresponding to the preset control; responding to the replacement operation of the user, and replacing the content of the target selectable replacement text; constructing a test case according to the interface test text content after responding to the replacing operation; storing the test cases in a case warehouse; and responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test, and obtaining a test result. In the embodiment of the invention, the test case file is easy to construct, the learning cost of technicians can be reduced, and the efficiency of interface test is improved.

Description

Interface testing method, device, terminal and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an interface testing method, an apparatus, a terminal, and a storage medium.
Background
The interface test is a test for testing interfaces among components of a system, and is mainly used for detecting interaction points among external systems, internal subsystems and the like, and the test is mainly used for checking data exchange, transmission and control management processes, mutual logic dependency among the systems and the like.
In the prior art, test cases required by interface tests are usually maintained in the form of codes or tables, and the test cases are low in quality due to the fact that unified specifications are not available, so that the test efficiency is seriously affected.
Disclosure of Invention
The embodiment of the application provides an interface testing method, an interface testing device, a terminal and a storage medium, which are used for solving the problem of low interface testing efficiency in the prior art.
The embodiment of the application provides an interface testing method, which comprises the following steps:
responding to the triggering operation of a user on a preset control, generating interface test text content corresponding to the preset control, wherein the interface test text content comprises a first quantity of text information, and the first quantity of text information comprises a second quantity of selectable alternative texts;
in response to a user's replacement operation, replacing the content of a target alternative text, wherein the target alternative text is any segment in the second number of segments of alternative texts;
constructing a test case according to the interface test text content after responding to the replacing operation;
storing the test cases in a case warehouse;
and responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test, and obtaining a test result.
The embodiment of the application also provides an interface testing device, which comprises:
the generation module is used for responding to the triggering operation of a user on a preset control, generating interface test text content corresponding to the preset control, wherein the interface test text content comprises a first number of text messages, and the first number of text messages comprise a second number of selectable alternative texts;
the replacing module is used for responding to the replacing operation of a user and replacing the content of the target selectable replacing text, wherein the target selectable replacing text is any section in the second number of sections of selectable replacing texts;
the construction module is used for constructing a test case according to the interface test text content after responding to the replacement operation;
the storage module is used for storing the test cases in a case warehouse;
and the test module is used for responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test, and obtaining a test result.
In some embodiments, the interface test apparatus further comprises:
the demand module is used for acquiring a test demand, wherein the test demand comprises a plurality of test links, and the plurality of test links have an association relation;
The flow module is used for generating a test flow according to the association relation between the test links, wherein the test flow comprises at least one test link;
and the determining module is used for determining the preset control according to the test links included in the test flow.
In some embodiments, the test module further comprises:
the configuration submodule is used for constructing interface test configuration according to the test requirements;
and the first test sub-module is used for calling a plurality of test cases stored in the case warehouse to carry out interface test under the interface test configuration.
In some embodiments, the first test sub-module further comprises:
the second testing submodule is used for carrying out interface testing on the preset control according to the testing case;
the result submodule is used for obtaining a return result after the preset control interface is tested;
and the assertion submodule is used for executing corresponding flow control actions when the returned result accords with the assertion rule.
In some embodiments, the first test sub-module further comprises:
the path submodule is used for storing the returned result in a specified path;
and the calling sub-module is used for calling the return result from the appointed path when the next testing link is skipped.
In some embodiments, the interface test apparatus further comprises:
the display module is used for responding to the result display operation of the user and generating a display interface, wherein the display interface comprises a selection control;
and the selection module is used for responding to the selection operation of the user on the selection control and displaying the test result corresponding to the selection operation on the display interface.
In some embodiments, the demand module further comprises:
the uploading sub-module is used for uploading the test requirement to the auditing platform so that the auditing platform can generate auditing comments on the test requirement;
the opinion submodule is used for acquiring audit opinions;
the modification sub-module is used for responding to a modification instruction triggered by a user when the auditing opinion is failed, adjusting the test requirement and transmitting the adjusted test requirement to an auditing platform;
and the pass sub-module is used for acquiring the test requirement when the audit opinion is passed.
In the interface test method provided by the embodiment of the application, the standardized test cases are constructed through the steps of control generation and text replacement, and the test cases are different from the full code form in the prior art through the unified management method of the case warehouse, so that technicians can conveniently construct, manage and call the test cases to carry out interface test, and the test efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1a is a schematic diagram of a scenario of an interface testing method provided in an embodiment of the present application;
FIG. 1b is a flowchart of an interface testing method according to an embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of determining preset controls provided in an embodiment of the present application;
fig. 3a is a schematic diagram of an association diagram provided in an embodiment of the present application;
FIG. 3b is another schematic illustration of an association provided by an embodiment of the present application;
FIG. 4 is a schematic flow chart of performing a test procedure according to an embodiment of the present application;
FIG. 5a is a schematic view of a scenario of another embodiment provided in an embodiment of the present application;
FIG. 5b is a schematic flow chart of another embodiment provided in an embodiment of the present application;
FIG. 6 is a schematic diagram of an interface testing apparatus according to an embodiment of the present application;
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
It is noted that the terminology used in the examples section of the embodiments of the present application is used for the purpose of explaining specific embodiments of the present application only and is not intended to limit the present application. In addition, in the description of the embodiments of the present application, unless otherwise indicated, "a plurality" means two or more, and "at least one" means one, two or more. The term "first" is used for descriptive purposes only and is not to be interpreted as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "upper level" is used for descriptive purposes only and is not to be construed as implying that the described object is relatively more important. Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," and the like in various places throughout this specification are not necessarily all referring to the same embodiment, but mean "one or more, but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
First, basic concepts of understanding the related nouns of the present invention are described:
test cases: test Case (Test Case) refers to a description of a specific software product for performing a Test task, and its contents may include a Test environment, input data, configuration parameters, a Test script, and the like, to finally form a document. The test cases generally do not include actual test results, and the test cases are generated before testing, and the actual results are generated only when the test cases are called for testing.
The embodiment of the application provides an interface testing method, an interface testing device, a terminal and a storage medium.
The interface testing method can be integrated in electronic equipment, and the electronic equipment can be a terminal, a server and other equipment. The terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer or a personal computer (Personal Computer, PC) and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
In some embodiments, the interface testing method may also be integrated in a plurality of electronic devices, for example, the interface testing method may be integrated in a plurality of servers, where the plurality of servers implement the interface testing method of the present application, and each server may implement different functions. In some embodiments, the server may also be implemented in the form of a terminal.
The following will describe in detail. The numbers of the following examples are not intended to limit the preferred order of the examples.
Example 1
Referring to fig. 1a, an application scenario diagram of an interface testing method in this embodiment is shown. As shown in fig. 1a, the present embodiment may include a client 101, an audit platform 102;
specifically, the client 101 obtains a test requirement, where the test requirement is in a text format, the test requirement includes N test links, and the N test links have an association relationship, and the association relationship includes a transmission between variables and a relative test sequence of the test links; after acquiring the test requirement, the client can choose to send the test requirement to the auditing platform 102, and after the auditing platform 102 passes the auditing of the test requirement, the client receives the test requirement passing the auditing; the client side automatically generates a test flow according to the association relation between the test links, one test flow can comprise one or more test links, and a test sequence between the test links is designed according to the association relation, for example, the test flow 1 can comprise a test link 1, a test link 2 and a test link 3, the test flow 2 can comprise a test link 2 and a test link 4, and the test sequence corresponding to the test flow 1 is designed according to the association relation: test link 1, test link 2, test link 3, test procedure 2, corresponding test sequence: test link 2→test link 4; the generation of the test flows is not necessarily related to the number of test links, namely the N test links can generate M test flows, no definite mathematical relationship exists between M and N, and the test flows can be generated according to the setting of a user, such as the selected test links needing to be tested, the coverage rate of the whole test and the like; further, a preset control is determined according to M test flows generated by test requirements, and one test link corresponds to one preset control under normal conditions; responding to the triggering operation of a user on a preset control, and generating interface test text content corresponding to the preset control; responding to the replacement operation of the user, and replacing part of text of the interface test text content; constructing test cases according to the replaced interface test text content, wherein each test flow can construct one test case, namely M test flows can construct M test cases; the M test cases are stored in a case warehouse inside the client 101, and can be uniformly managed in the modes of identification codes, adding labels and the like so as to be conveniently distinguished from other test cases and be convenient for calling in actual test; responding to interface test operation of a user, constructing a test scene according to the test flows, wherein the test scene can select all or part of the test flows of the M test flows stored in a case warehouse, design parallel calling logic according to variable transfer relations among test links, and then call test cases in the case warehouse in parallel for interface test to obtain a test result; and finally, responding to the result display operation of the user, and displaying the test result.
In this embodiment, description will be made from the perspective of an interface test device, which may be integrated in a client, for receiving a test requirement of a user, generating a test case according to the test requirement, saving the test case in a case repository, and calling the test case to perform an interface test. The client may be an electronic device, for example, a server, a terminal, or the like. For example, the server may be a server, such as a single server, a cluster of servers, and so forth. For another example, the terminal may be a mobile phone, a notebook computer, a personal computer, etc.
As shown in fig. 1b, the flow of the interface testing method in this embodiment may include steps S110 to S150:
s110, responding to triggering operation of a user on a preset control, and generating test text content corresponding to the preset control, wherein the test text content comprises a first number of pieces of text information, and the first number of pieces of text information comprises a second number of pieces of selectable alternative texts.
In some embodiments, the client provides a plurality of preset controls, where each preset control corresponds to a specific component in the interface test, for example, the components may be classified into an interface (API), a storage (DB), a real-time Messaging (MQ), a variable component (VAR), a dependency component (DEPENDS), a trace temporary storage component (SAVE), etc., and the preset control corresponds to a component, i.e., a specific component in the above components, and the preset control may be identified by using an english abbreviation corresponding to the component, and after the user performs a triggering operation on the preset control, the client generates the test text content of the component corresponding to the preset control. The triggering operation may be clicking, dragging, long pressing, etc. to trigger the control to realize the generation of the test text content, and the triggering operation is determined according to the desire of the technician and should not be construed as limiting the invention.
The test text content is text content related to a component corresponding to the preset control, and the text content comprises configuration information of the component. In some embodiments, the test text content includes a first number of pieces of text information equal to the number of configuration items contained by the component, e.g., a configuration category included by a component may be a type, description, parameter, assertion, retry mechanism, variable storage rule, each category may include a plurality of configuration items, e.g., parameters may include parameter1, parameter2, where the first number is the sum of the configuration items under all configuration categories. Further, the sum of the numbers of configuration entries in which the replacement operation can be performed is the second number, and a specific replacement operation will be explained below. In some embodiments, all configuration information of the test text content is preset, and even if the user does not execute the replacement operation, the test case generated according to the test text content can be directly invoked in the subsequent test.
In some embodiments, the text corresponding to each of the component configuration categories may be the following respective:
Type (2): i.e. the above-mentioned component types, for example, API, DB, VAR, etc., in the test text, the text content is consistent with the component name corresponding to the preset control, and the replacement operation is generally impossible;
description of: the test behavior describing module is used for describing the test behavior executed by the current component and can be used for carrying out replacement operation;
parameters: the parameters corresponding to the different types of components are usually different, and a corresponding number of configuration items can be set according to the number of the parameters, for example, the parameters of the API component are a request head and a request body, the parameters of the DB component are SQL sentences, and substitution operation can be carried out;
assertion of: after the execution of the component is finished, the returned result is asserted to judge whether the execution result is correct or not; the setting of an assertion may include two configuration entries, a flow control action and an assertion rule that will determine, by some simple operator, whether the actual result meets expectations, e.g., "code equivalents 0? "the predicate rules may constitute a plurality of large predicate blocks; the flow control action decides the next action after the assertion block meets the condition;
retry mechanism: the configuration can comprise two configuration items of retry time and retry times so as to achieve the effect of repeatedly executing and waiting for a certain assertion block to accord with expectations;
Variable storage rules: the configuration may include two configuration entries, namely an identification code and a save path, and after the single component test is finished, the returned value may be recorded through the variable storage configuration and transmitted to the subsequent component for execution.
Obviously, according to the requirements of the actual interface test, the test text content can comprise more expanded configuration items and configuration types.
In some embodiments, before the client responds to the triggering operation of the user on the preset control, the testing method of the present invention, as shown in fig. 2, further includes the following preset control confirmation steps S210 to S230:
s210, acquiring a test requirement, wherein the test requirement comprises a plurality of test links, and the plurality of test links have an association relation.
Generally speaking, the test requirements are text contents presented in text or table form, and can be applied in various test environments, such as software test, hardware test, interface test, etc., where the test requirements are all based on analysis of corresponding development requirements, and a series of testable contents, i.e. test links, are formed by differentiating and decomposing the development requirements. The test requirements typically cover all defined test links, including functional as well as non-functional testing. The formulated test link item must be verifiable, i.e., after a test link is tested, an observable and evaluable result must be returned, and if the result cannot be verified, the test link cannot be called; a test element should indicate that the normal preconditions of the demand are met, and also indicate that the error conditions are not met.
In some embodiments of the present application, the test requirements are applied in an interface test environment, where the test requirements are stored in a table, and each row of the table represents one test link in the whole test requirements, where a test link may include information of a test serial number, a test interface, a test purpose, a judgment condition, a variable, an upper link, and the like, and these information together form a column of the table, which is used to specifically describe the test link. The test serial number is automatically marked by the client and is only used for identification; the test interface corresponds to a type in the test text content, i.e., the above-mentioned component kind, for example, API, DB, VAR, etc.; the test purpose is used for expressing the specific test content of the test link in a text form, and corresponds to the description in the test text content; the judging condition is used for verifying whether the returned result of the test meets the requirement or not and corresponds to the assertion in the test text content; variables refer to variables that may be used in the test link; the upper level link indicates the relative test sequence of the test link in the whole test requirement by marking the upper level test link of the test link, wherein the upper level test link can perform the test of the test link only when the test link is required to be completed in the test, and in some cases, the upper level test link can be provided with a plurality of test links; in some embodiments, the upper level link may be replaced by a lower level link, and the manner of marking the lower level test link of the test link indicates the relative test sequence of the test link in the whole test requirement, and the concept of the lower level test link is opposite to that of the upper level test link, which is not described herein. The variables and the superior links together form an association relation between the test links, and the association relation is used for expressing the relative test sequence and the variable transfer relation between the test links.
The method for obtaining the test requirement has various modes, for example, a technician can input corresponding text information in a text input window of the client to form a corresponding text file, wherein the text file is the test requirement, the text file can also receive the test requirement text information sent by other terminal equipment through a wireless network, and the test requirement can also be received through a communication medium, for example, a network cable, a USB flash disk, a floppy disk, an optical disk and the like.
In some embodiments, the client generates a display interface, and performs visual display on the test requirement, where the visual display may directly display all the test links on the same interface according to an association relationship, as shown in fig. 3a, where a certain test requirement includes 9 test links, connection lines with arrows are set between the test links according to the association relationship, to indicate a relative test sequence between the test links, and one test link may have multiple upper test links, or may have multiple lower test links, for example, test link 7; if the two test links have a superior-subordinate relationship and a variable transmission relationship, the connecting line between the test link pairs can be thickened for marking; on the basis of the visual display, as shown in fig. 3b, by selecting a certain test link of the test requirement as a target link, for example, selecting the test link 7, an interactive interface may be generated, where the interactive interface includes a link control and an expansion control, the link control uses a serial number corresponding to the test link as an identifier, the expansion control may have two display states, and the expansion control represents expansion/folding of the upper test link respectively, and may control the display interface to display all or part of the association relationship graph through the control. The user can trigger the expansion control 301 to expand the upper test link representing the target link through operations such as clicking, double clicking, long pressing and the like, if the upper test link also has the upper test link, the user can trigger the expansion control corresponding to the upper test link through the same operations until all the upper test links are test link positions which cannot be further expanded. In addition, the user can trigger the triggered control again to switch the display state of the triggered control, so that the upper-level test link is not displayed any more. Different colors can be used for distinguishing link controls which cannot be further expanded from link controls corresponding to index data, for example, blue marks can be used for second link controls 303 corresponding to test link 1, and orange marks can be used for first link controls 302 corresponding to target links. Each link control can be repeatedly triggered in response to operations such as clicking, double clicking, long pressing and the like of a user so as to display/close specific text information of the display test link, such as a test sequence number, a test interface, a test purpose, a judgment condition, a variable and the like.
S220, generating a test flow according to the association relation between the test links, wherein the test flow at least comprises one test link.
The test flow includes at least one test link in the test requirement, and one test flow may specifically be all or part of the test links in the test requirement, as shown in fig. 3 a: multiple upper/lower level test links, such as test link 1 and test link 2, test link 6 and test link 7, of the same test link cannot be included in one test flow; unless the test flow includes only one test flow, one test link needs to have a direct upper/lower level test link in the test flow, for example, the test link 3 needs to occur simultaneously with the test link 5; the test links with variable transmission and upper and lower relationships must occur simultaneously; one test requirement may generate multiple test flows.
In some embodiments, as shown in fig. 3a, the test requirements include a plurality of test links, not all the test links have an association relationship, where a test link without an upper test link is referred to as an initial test link, a test link without a lower test link is referred to as a final test link, a plurality of test links may be generated based on the test requirements according to the requirements of the test flow, where the generated test flow is identified by a sequence number, for example, the test flow 1 may include a test link 1, a test link 4, a test link 6, and a test link 9, and a specific test sequence may be a test link 1→a test link 4→a test link 6→a test link 9; the test flow 2 may include a test link 3, a test link 5, a test link 7, and a test link 9, and the specific test sequence may be the test link 3→the test link 5→the test link 7→the test link 9. In summary, a complete test procedure may be performed from an initial test link to a final test link according to the association relationship. In other embodiments, on the premise of meeting the requirements of the test flow, the complete test flow may be further taken out for splitting a part of the test flow, for example, the test flow 2 may remove the test links 9, and the remaining three test links are used as new test flows, so that some unnecessary test links may be removed according to the actual test requirements, so as to improve the test efficiency.
In some embodiments, the test procedure may be determined manually based on the test requirement or the visual result of the test requirement, or may be automatically generated by the client. The generation process of the automated test flow may be similar to a routing algorithm, for example, the test requirements are converted into a distance matrix according to the visualization result, all possible test flows are found by determining an initial test link and a final test link, and the routing algorithm may be further optimized according to the constraint conditions to determine all test flows meeting the conditions.
S230, determining the preset control according to the test links included in the test flow.
In some embodiments, based on the generated test procedure, the client may automatically find component information corresponding to all test links therein, and further determine the preset control according to the component information.
In the embodiment, the test flow is generated through the test requirement, the mode of the preset control is further determined according to the test flow, initial preparation work of the test case is automatically completed, the construction speed of the subsequent test case is improved, and the quality and the progress of the test are guaranteed.
And S120, replacing the content of the target selectable replacement text in response to the replacement operation of the user, wherein the target selectable replacement text is any segment in the second number of segments of selectable replacement texts.
The replacing operation can be that a user selects any section in the second number of sections of selectable replacing texts, the client generates a text input window so as to receive text contents input by the user for replacing, and after the user finishes inputting and confirms, the text contents received by the text input window and the target selectable replacing texts are directly replaced; the replacing operation may also be that after the user selects the target selectable replacing text, the client generates a replacing window, where the replacing window includes at least one preset text control, one preset text control corresponds to a section of text content for replacing, after the user performs operations such as clicking, double clicking, long pressing, etc. on a certain preset text space, the client responds to the user operation, and the client replaces the target replacing text content with the text content for replacing, which corresponds to the preset text control.
In some embodiments, after the user completes the selection of the preset control, the client generates a replacement interface, and the user can complete the replacement operation of the test text content on the replacement interface. The test interface comprises a plurality of replacement controls and a confirmation control, the number of the replacement controls can be a second number, each replacement control corresponds to a section of selectable replacement text, and triggering operation is performed on each replacement control according to different kinds of configuration: a drop-down list can be generated, the drop-down list comprises at least one piece of replacement text content, and the replacement text content is used for replacing the selectable replacement text corresponding to the replacement control; a text input window may also be generated that may be pre-formatted with a canonical input format to receive user input of alternate text content. After the replacement text contents corresponding to all the selectable replacement texts are determined, responding to the confirmation operation executed by the user on the confirmation control, and replacing the test text contents by the client according to the information in all the replacement interfaces. In the embodiment, the user can more intuitively and conveniently replace the content of the test text through the replacement interface, so that the construction efficiency of the test case is improved.
In some embodiments, according to actual needs, the process of obtaining the test requirement may include examining the test requirement to adjust the test requirement, where the process of examining includes the following steps A1-A4:
a1, uploading a test requirement to an auditing platform so that the auditing platform can generate auditing comments on the test requirement;
a2, obtaining audit opinions;
a3, when the auditing opinion is failed, responding to a modification instruction triggered by a user, adjusting the testing requirement, and transmitting the adjusted testing requirement to an auditing platform;
a4, when the auditing opinion is that the auditing opinion is passed, acquiring the testing requirement;
in some embodiments, the client sends an audit request to an audit platform. The auditing request can comprise a file to be audited and source information, wherein the file to be audited is a test requirement, and the auditing platform audits the test requirement according to the auditing request.
The source information may include device information of a client making an audit request and personal information of a user performing a corresponding operation. The device information may include a network IP address of the client, geographic location information, physical device information, etc., where the physical device information may include device identification information, which may be user-defined and uploaded to an audit platform to characterize the device's uniqueness within a space-time range. The personal information may include user account information, user identity information, etc. for the user initiating the audit request to log into the client. The device information and the personal information can be character strings formed by combining elements such as English letters, numbers, separators and the like, or can be in a format converted by a specific standard, such as binary conversion, hexadecimal conversion and the like. The format of the specific device information and the user information may be determined according to the will of the skilled person.
In some embodiments, the step of the auditing platform generating auditing opinions is specifically as follows: receiving an audit request; analyzing the auditing request to obtain files to be audited and source information; determining auditing standards for the files to be audited according to the source information; pre-auditing the file to be audited by a computer; and (5) carrying out expert manual auditing on the file to be audited to obtain auditing opinions.
In a specific embodiment, an auditing platform receives an auditing request that a file to be audited is a test requirement, and establishes an auditing process; analyzing the audit request to obtain testing requirements and source information containing personal information and equipment information; judging that the test requirement comes from an interface test department according to personal information, and determining a test requirement auditing standard corresponding to the department; the method comprises the steps of performing computer pre-examination on a test requirement, and mainly judging whether the test requirement is complete in format and accords with a preset test requirement standard, wherein an examination opinion which indicates that the pre-examination is unqualified is generated without passing through the pre-examination; arranging 1-3 experts in the corresponding field for manual auditing through the pre-audit test requirement, mainly judging whether the test requirement can fully cover various features of the development requirement, focusing on the aspects of functional requirements, data definition, interface definition, performance requirements, safety requirements, reliability requirements, system constraint and the like, and focusing on whether to cover the missing and system hidden requirements of the developer; after the expert auditing is finished, collecting the auditing opinion of the expert; when the audit opinion indicates that the audit opinion does not pass, the audit opinion is sent to the corresponding client according to the equipment information so as to carry out subsequent processing; and when the audit opinion indicates that the audit opinion passes, the audit opinion is sent to the corresponding client to end the audit process.
In the embodiment, the mode of auditing the test requirements so that the user can adjust the test requirements is beneficial to the user to construct more reasonable test requirements, so that the efficiency of interface test based on the test requirements is improved, and the test quality is improved.
S130, constructing a test case according to the test text content after the replacement operation is responded.
In some embodiments, the test case includes test text contents corresponding to a plurality of preset controls, the user can arrange the test texts according to a certain sequence, preset connection texts can be added between the test text contents, and when the test case is subsequently called, the client realizes the connection of component tests by identifying the connection texts, and the combined test text contents are the test cases.
And S140, storing the test cases in a case warehouse.
The use case warehouse is a database which can be stored in a client, has a unified management use case set and can be shared by a plurality of technicians, and in some embodiments, the use case warehouse can be placed in other terminals and servers to realize data intercommunication through a local area network; the use case warehouse can also be a cloud warehouse, and data transmission is realized through the Internet. The case warehouse stores the test cases uploaded by each technician, wherein each test case can have a corresponding identification code, corresponding to the identification code, the test requirement also has ID information, the identification code can be a combination of numbers, letters and other symbols, and the identification code corresponding to the test case generated according to the same test requirement can comprise the same part, for example, the beginning part of the identification code can be the ID information of the test requirement, so that the subsequent calling is convenient. In some embodiments, in order to facilitate copying and migration of the test cases and multiplexing of the test cases, each test case may have a corresponding description document, where the description document includes preset control information and description text included in the test case, where the preset control information may be automatically obtained by the system by identifying a type in the test text information, and the description text may be a description in the test text information, or may automatically count other configuration entries of the test text information, and generate corresponding text information, for example, count a parameter number, an assertion type and number included in the test case, a related variable transfer number, and so on; furthermore, the technician may actively enter descriptive text in the test document. The case warehouse can perform centralized management on the test cases in a form according to the information in the description document.
In some embodiments, a technician may perform an adding operation, a deleting operation, a modifying operation, etc. on an established case repository, where the above operations may be performed on text contents of test cases, mainly by adding, deleting, and modifying test text contents corresponding to at least one component in the test case or at least one section of replaceable text contents in a single test text content, so as to replace an original test case with a new test case after the above operations, or replace the new test case in the case repository, so as to implement updating of the case repository; in some embodiments, the operations described above may be implemented for a description document of a test case, mainly by adding, deleting, and modifying description text to update the case.
In the embodiment, the test cases are managed in a centralized manner by pre-establishing the case warehouse, so that the test cases can be conveniently called according to related information during testing, meanwhile, the stored test cases can be reused, repeated construction of the test cases from beginning is avoided, and the testing efficiency is improved.
In some embodiments, the preset control is determined by a test procedure generated by a test requirement, at this time, since there are multiple test procedures, a test case construction process of S110 to S130 needs to be performed for each test procedure, for example, as shown in fig. 1a, one test requirement generates M test procedures, after the test case construction, M test cases are correspondingly generated, and further, all the M test cases are saved in a case warehouse, and can be processed according to the case management process during the saving.
S150, responding to the test operation of the user, and calling the test cases in the case warehouse to test. And obtaining a test result.
In some embodiments, the process of calling the test cases in the case repository to perform the test may include the following specific test steps S410 to S420:
s410, constructing interface test configuration according to the test requirement.
S420, calling a plurality of test cases stored in the case warehouse under the interface test configuration to carry out interface test.
The interface test configuration is generated based on the test requirements and comprises the selection of test cases and the control of variables. The selection of the test case needs to consider the actual test requirement of the technician, as shown in fig. 3a, the test requirement may be that a specific test link in the whole test requirement is limited to be tested, for example, the test link 4 must be completely tested, and the test case at this time may be the test case corresponding to all possible test flows including the test link 4; the test requirement can also be a test coverage rate, for example, more than 90% of test links in the test requirement need to be tested; the test requirements may also be other possible constraints, or a combination of all, part of the above. The client can automatically retrieve all test case sets meeting the requirements from the case warehouse according to the test requirements, and the user can select one of the test case sets to test by himself.
In some embodiments, after the test case set is obtained, the test cases may be directly tested in a preset sequence, where the sequence test is performed in the preset sequence, that is, the interface test configuration; in other embodiments, the interface test configuration also needs to consider variables between test links, when multiple test links use the same variables to perform the test, or when a complete test flow can perform flow splitting, the same variable test links or split sub-links can be subjected to parallel test through setting of a scene, and specific parallel interface test configuration also needs to consider performance of equipment and the like, so that the test efficiency is improved on the premise of ensuring the performance.
After the interface test configuration is set, the client side invokes the required test case sets from the case warehouse according to the scene to perform sequential test or parallel test, and a test result is obtained.
In some embodiments, since the interface test text content of the preset control in the test case includes assertions, as shown in fig. 4, the test step S420 may be expanded into the following steps S421, S422, S425:
s421, performing interface test on the preset control according to the test case.
S422, obtaining a return result after the preset control interface test.
S425, if the returned result accords with the assertion rule, executing corresponding flow control action.
Wherein, the assertion rule determines whether the actual result meets the expectation through some simple operators, such as "code equivalents 0? The assertion rule can form a plurality of large assertion blocks, the judgment relation among the assertion blocks can be set as an intersection or a union, and the flow control action decides the next action after the assertion blocks meet the condition; the flow control actions may include:
continued execution (CONTINUE): continuing to execute the next assertion block;
RETRY (RETRY): repeatedly executing the current assertion block until the condition is met;
EXIT (EXIT): and exiting execution.
In some embodiments, since the interface test text content of the preset control in the test case includes a variable storage rule, where the variable storage rule includes a specified path, whether there is a flow interruption, and so on, in this case, between step S422 and step S425, the test process may further include steps S423 to S424:
s423, storing the returned result in a designated path.
S424, when the next test link is skipped, the return result is called from the appointed path.
The specified path is divided into two types, the two types depend on the type of the preset control, in general, the specified path is a temporary path inside the client, and because the two test links are almost immediately alternated for testing, after the test result returned by the previous test link is stored in the temporary path, the next test link directly calls the returned result from the test link.
In another case, the variable storage rule includes a flow interrupt, because the component performs the test for a very long time, and resources are wasted if the test result is always waited for. At this time, after the test component corresponding to the original test link is connected with a trace temporary storage component (SAVE), after the execution is submitted, the batch number of the execution is produced, for example, the current time stamp or the identification code of the test case is used as the batch number; when the test process encounters the trace temporary storage component, the batch number and the execution process data are stored in a database according to a specified path in the execution process, wherein the database can be located at a client, other terminals, a server or a cloud. The execution process data comprise an execution case identification code, an intermediate variable, an executed test link serial number and the like; the trace temporary storage component is used for carrying out test interrupt operation, so that the previous execution process data can be temporarily stored firstly, then the current use case execution is exited, and the test result is stored in a designated path according to the identification code of the test case after being returned; and after exiting the case test and waiting for the appointed time, the client side can test the test case by itself again, in the test process, whether the execution process data of the batch number and the return result exist in the database of the appointed path is firstly pointed, if so, the executed test link is skipped, the return result is called to continue to execute the subsequent test link, and if not, the test case is tested from the beginning.
In the embodiment, the control of the test flow is realized through the assertion and the variable storage rule, so that the flexibility of the test method is enhanced, the test requirements under different conditions are met, and the efficiency and the quality of the test are improved.
In some embodiments, after obtaining the test result, the client may display the test result so that the user follows the test process, and specifically may include the following steps B1 to B2:
b1, responding to a result display operation of a user, and generating a display interface, wherein the display interface comprises a selection control;
and B2, responding to the selection operation of the user on the selection control, and displaying a test result corresponding to the selection operation on the display interface.
In the interface test method provided by the embodiment of the application, the test case is generated based on the standardized test requirement, and the test case is different from the code form of the prior art by the unified management method of the case warehouse, so that the construction and the management are convenient, the test case has extremely strong expansibility, and technicians can conveniently call the test case to perform the interface test under various conditions, so that the efficiency of the interface test is improved.
Example 2
Referring to fig. 5a, an application scenario diagram of the interface testing method in this embodiment is shown. As shown in fig. 5a, the present embodiment may include a client 501 and a server 502;
client side: the client 501 obtains the test requirement and sends the test requirement to the server 502 so that the client can audit or save the test requirement; the client 501 responds to the triggering operation of a user on a preset control and generates interface test text content corresponding to the preset control; the client 501 replaces the content of the target selectable replacement text in response to the replacement operation of the user; the client 501 sends the test case to the server 502 so that it stores the test case; sending a test request to the server 502 so that the server can perform a test according to the test requirement; receiving a test result; and responding to the user operation, and displaying the test result.
The server side: the server 502 receives the test requirement from the client 501, audits the test requirement, and stores the audited test requirement; receiving and saving test cases from the client 501; receiving a test request from a client 501; generating a test scene according to the test request; calling a test case, and performing interface test under the test scene; the test results are sent to the client 501.
Specifically, the client 501 obtains a test requirement, where the test requirement includes a plurality of test links, and the plurality of test links have an association relationship with each other; the client 501 sends the test requirement to the server 502; the server 502 examines and stores the test requirements; the client 501 generates a test case according to the test requirement; the client 501 sends the test case to the server 502; the server 502 stores the test cases in a case warehouse; the client 501 sends a test request to the server 502; the server 502 receives the test request and calls the test cases stored in the case warehouse to test according to the test request; the server 502 sends the test result obtained by the test to the client 501; the client 501 generates a display interface in response to user operation, and displays the test result through the display interface.
In this embodiment, the description will be made from the viewpoint of an interface test system, which may include a client and a server, through which the interface test method is implemented. The client may be an electronic device, for example, a server, a terminal, or the like. For example, the server may be a server, such as a single server, a cluster of servers, and so forth. For another example, the terminal may be a cell phone, a notebook computer, a personal computer, etc.
As shown in fig. 5b, the flow of the interface testing method in this embodiment is as follows steps S501 to S510:
s501, a client acquires a test requirement, wherein the test requirement comprises a plurality of test links, and the plurality of test links have an association relation;
s502, the client sends the test requirement to the server;
s503, the server side examines and stores the test requirement;
s504, the client generates a test case according to the test requirement;
s505, the client sends the test case to the server;
s506, the server side stores the test cases in a case warehouse;
s507, the client sends a test request to the server;
s508, the server receives the test request and calls the test cases stored in the case warehouse to test according to the test request;
s509, the server sends a test result obtained by the test to the client;
s510, the client side responds to user operation to generate a display interface, and the test result is displayed through the display interface.
The steps included in the test method of the present embodiment are basically identical to the specific implementation manner of the steps in embodiment 1, and are not described here again, but only steps S507 and S508 different from those in embodiment 1 are described in detail:
The test request refers to a request initiated by the client to the server, where the request is used to request to perform a test operation. The test request may include interface test configuration and source information.
The interface test configuration corresponds to the test scenario constructed according to the test requirement in embodiment 1, and includes the required test case, the test case setting when parallel test is adopted, and the like. The source information may include device information of the client making the test request and user information performing an operation on the client-side contrast interface. The device information may include a network IP address of the client, geographical location information, physical device information, etc., where the physical device information may include device identification information, which may be user-defined and uploaded to the server, to characterize uniqueness of the device within a certain space-time range. The user information may include user account information, user identity information, etc. for the user initiating the test request to log into the client. The device information and the user information can be character strings formed by combining elements such as English letters, numbers, separators and the like, or can be formats converted by specific standards, such as binary conversion, hexadecimal conversion and the like. The format of the specific device information and user information may be determined according to the wishes of the skilled person and should not be construed as limiting the present application.
The server receives the test request and obtains interface test configuration and source information by analyzing the test request. Firstly, determining a test scene according to source information: the test scene can be a virtual test scene which is built in a virtual machine, and a closed independent working environment is constructed, in the environment, technicians can perform various preset operations on files in the environment, so that generated data changes can be deleted later, the permanent influence on a computer is avoided, and the safe performance of the test operation is ensured; the test scene can also be a preset test scene determined by user information in the source information, the test scene is configured by the user before the user performs the test, and the confidentiality of the test can be ensured by using the test scene.
In some embodiments, the transmission of the test request and the test result is required to go through a group/unpacking process, and the specific group steps are as follows:
a. and acquiring the transmission protocol type information and a data wrapper corresponding to the transmission protocol type information.
The transmission protocol type information is data information carrying the transmission protocol type. Wherein the transmission protocol (Communications Protocol), also referred to as communication protocol, refers to a system standard that allows two or more terminals in a transmission system to communicate information between each other in any physical medium. The types of transport protocols are various, such as TCP/IP protocol type (Transmission Control Protocol/Internet Protocol), UDP protocol type (User Datagram Protocol), IPX/SPX protocol type (Internet work Packet Exchange), and user-defined transport protocol type, etc.
For example, the transport protocol types may include HTTP (a protocol for transport using TCP), svrkit (a protocol for transport using TCP or UDP), logicsvr (a protocol for transport using HTTP), and so on.
b. And packaging the user information, the equipment information, the file to be transmitted and the transmission protocol type information according to the data packaging device to obtain a comparison request data packet.
The file to be transmitted may be an interface test configuration document or a test result document, and the data wrapper may be understood as a section of algorithm code, which is used to encrypt the content to be encrypted by adopting a transmission protocol, so as to generate an encrypted data packet. Different transport protocols may correspond to their proprietary data encapsulator. For example, the TCP/IP protocol corresponds to a TCP/IP data wrapper.
The unpacking process is the reverse of the above-mentioned packing process, and will not be described here again.
It can be known from the above that, in the embodiment of the present application, the client generates the test case based on the standardized test requirement, and performs the unified management through the server, so that the test case is different from the code form in the prior art, and is convenient to construct and manage, and the test case has extremely strong expansibility, so that the technician can conveniently invoke the test case by using the server to perform the interface test under multiple conditions, thereby improving the efficiency of the interface test.
In order to better implement the method, the embodiment of the invention provides an interface testing device which can be integrated in electronic equipment, wherein the electronic equipment can be a terminal, a server and the like.
For example, in the present embodiment, description will be made in terms of an interface test device, and a method of an embodiment of the present invention will be described in detail taking the example that the interface test device is specifically integrated in a client.
For example, as shown in fig. 6, the interface test apparatus 600 may include a generation module 610, a replacement module 620, a construction module 630, a save module 640, and a test module 650.
A generating module 610, configured to generate interface test text content corresponding to a preset control in response to a triggering operation of the user on the preset control, where the interface test text content includes a first number of text pieces, and the first number of text pieces includes a second number of selectable alternative texts;
a replacing module 620, configured to replace content of a target alternative text in response to a replacing operation of a user, where the target alternative text is any one of the second number of segments of alternative texts;
a construction module 630, configured to construct a test case according to the interface test text content after responding to the replacement operation;
A saving module 640, configured to save the test case in a case repository;
and the test module 650 is used for responding to the interface test operation of the user, calling the test cases in the case warehouse to carry out interface test, and obtaining the test result.
In some embodiments, the interface test apparatus further comprises:
the demand module is used for acquiring a test demand, wherein the test demand comprises a plurality of test links, and the plurality of test links have an association relation;
the flow module is used for generating a test flow according to the association relation between the test links, wherein the test flow comprises at least one test link;
and the determining module is used for determining the preset control according to the test links included in the test flow.
In some embodiments, the test module further comprises:
the configuration submodule is used for constructing interface test configuration according to the test requirements;
and the first test sub-module is used for calling a plurality of test cases stored in the case warehouse to carry out interface test under the interface test configuration.
In some embodiments, the first test sub-module further comprises:
the second testing submodule is used for carrying out interface testing on the preset control according to the testing case;
The result submodule is used for obtaining a return result after the preset control interface is tested;
and the assertion submodule is used for executing corresponding flow control actions when the returned result accords with the assertion rule.
In some embodiments, the first test sub-module further comprises:
the path submodule is used for storing the returned result in a specified path;
and the calling sub-module is used for calling the return result from the appointed path when the next testing link is skipped.
In some embodiments, the interface test apparatus further comprises:
the display module is used for responding to the result display operation of the user and generating a display interface, wherein the display interface comprises a selection control;
and the selection module is used for responding to the selection operation of the user on the selection control and displaying the test result corresponding to the selection operation on the display interface.
In some embodiments, the demand module further comprises:
the uploading sub-module is used for uploading the test requirement to the auditing platform so that the auditing platform can generate auditing comments on the test requirement;
the opinion submodule is used for acquiring audit opinions;
the modification sub-module is used for responding to a modification instruction triggered by a user when the auditing opinion is failed, adjusting the test requirement and transmitting the adjusted test requirement to an auditing platform;
And the pass sub-module is used for acquiring the test requirement when the audit opinion is passed.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
It can be known from the above that, in the test device provided by the embodiment of the application, the test case is generated based on the standardized test requirement, and the method of unified management is performed through the case warehouse, so that the test case is different from the code form of the prior art, and is convenient to construct and manage, and meanwhile, the test case has extremely strong expansibility, so that a technician can conveniently call the test case to perform interface test under various conditions, and the efficiency of the interface test is improved.
The embodiment of the invention also provides electronic equipment which can be a terminal, a server and other equipment.
For example, the terminal can be a mobile phone, a tablet computer, an intelligent Bluetooth device, a notebook computer, a personal computer and other devices; the server may be a single server or a server cluster composed of a plurality of servers.
In this embodiment, a detailed description will be given taking an example that the electronic device of this embodiment is a server, for example, as shown in fig. 7, which shows a schematic structural diagram of the server according to the embodiment of the present invention, specifically:
the server may include one or more processors 701 of a processing core, memory 702 of one or more computer readable storage media, power supply 703, input module 704, and communication module 705, among other components. Those skilled in the art will appreciate that the server architecture shown in fig. 7 is not limiting of the server and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the processor 701 is a control center of the server, connects respective portions of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 702, and calling data stored in the memory 702, thereby performing overall monitoring of the server. In some embodiments, processor 701 may include one or more processing cores; in some embodiments, processor 701 may integrate an application processor that primarily processes operating systems, user pages, applications, and the like, with a modem processor that primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by executing the software programs and modules stored in the memory 702. The memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the server, etc. In addition, the memory 702 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. Accordingly, the memory 702 may also include a memory controller to provide access to the memory 702 by the processor 701.
The server also includes a power supply 703 that powers the various components, and in some embodiments, the power supply 703 may be logically connected to the processor 701 through a power management system, thereby performing functions such as managing charging, discharging, and power consumption through the power management system. The power supply 703 may also include one or more of any component, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, etc.
The server may also include an input module 704, the input module 704 being operable to receive entered numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The server may also include a communication module 705. In some embodiments, the communication module 705 may include a wireless module, and the server may provide wireless broadband internet access to the user by short-range wireless transmission through the wireless module of the communication module 705. For example, the communication module 705 may be used to assist a user in e-mail, browsing web pages, accessing streaming media, and the like.
Although not shown, the server may further include a display unit or the like, which is not described herein. In this embodiment, the processor 701 in the server loads executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 executes the application programs stored in the memory 702, so as to implement various functions as follows:
responding to the triggering operation of a user on a preset control, generating interface test text content corresponding to the preset control, wherein the interface test text content comprises a first quantity of text information, and the first quantity of text information comprises a second quantity of selectable alternative texts;
In response to a user's replacement operation, replacing the content of a target alternative text, wherein the target alternative text is any segment in the second number of segments of alternative texts;
constructing a test case according to the interface test text content after responding to the replacing operation;
storing the test cases in a case warehouse;
and responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test, and obtaining a test result.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
It can be known from the above that, in the electronic device provided by the embodiment of the present application, the test case is generated based on the standardized test requirement, and the method for unified management is performed through the case repository, so that the test case is different from the code form in the prior art, and is convenient to construct and manage, and the test case has extremely strong expansibility, so that a technician can conveniently call the test case to perform the interface test under multiple conditions, thereby improving the efficiency of the interface test.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present invention provide a computer readable storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform the steps of any of the interface testing methods provided by the embodiments of the present invention. For example, the instructions may perform the steps of:
responding to the triggering operation of a user on a preset control, generating interface test text content corresponding to the preset control, wherein the interface test text content comprises a first quantity of text information, and the first quantity of text information comprises a second quantity of selectable alternative texts;
in response to a user's replacement operation, replacing the content of a target alternative text, wherein the target alternative text is any segment in the second number of segments of alternative texts;
constructing a test case according to the interface test text content after responding to the replacing operation;
storing the test cases in a case warehouse;
and responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test, and obtaining a test result.
The instructions stored in the storage medium can execute the steps in any of the interface testing methods provided in the embodiments of the present invention, so that the beneficial effects that any of the interface testing methods provided in the embodiments of the present invention can be achieved are detailed in the previous embodiments, and are not repeated here.
The foregoing has described in detail a method and apparatus for testing interfaces provided by embodiments of the present invention, and specific examples have been used herein to illustrate the principles and embodiments of the present invention, the above description of embodiments being only for aiding in the understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in specific embodiments and application scope in light of the ideas of the present invention, the present disclosure should not be construed as limiting the present application.

Claims (10)

1. An interface testing method, comprising:
responding to the triggering operation of a user on a preset control, generating interface test text content corresponding to the preset control, wherein the interface test text content comprises a first quantity of text information, and the first quantity of text information comprises a second quantity of selectable alternative texts;
in response to a user's replacement operation, replacing the content of a target alternative text, wherein the target alternative text is any segment in the second number of segments of alternative texts;
constructing a test case according to the interface test text content after responding to the replacing operation;
Storing the test cases in a case warehouse;
and responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test, and obtaining a test result.
2. The method for testing an interface according to claim 1, wherein before responding to the triggering operation of the preset control by the user, the method comprises:
acquiring a test requirement, wherein the test requirement comprises a plurality of test links, and the plurality of test links have an association relation;
generating a test flow according to the association relation between the test links, wherein the test flow comprises at least one test link;
and determining the preset control according to the test links included in the test flow.
3. The interface testing method according to claim 2, wherein calling the test cases in the case repository to perform the interface test comprises:
constructing interface test configuration according to the test requirement;
and calling a plurality of test cases stored in the case warehouse under the interface test configuration to carry out interface test.
4. The interface testing method according to claim 3, wherein said calling the test cases in the case repository to perform the interface test comprises:
Performing interface test on the preset control according to the test case;
acquiring a return result after the preset control interface test;
and if the returned result accords with the assertion rule, executing corresponding flow control action.
5. The method of claim 4, wherein after said obtaining the returned result after said component interface test, said method further comprises:
storing the returned result in a designated path;
and when the next testing link is skipped, calling the returned result from the appointed path.
6. The method for testing an interface according to any one of claims 1 to 5, comprising, after obtaining the test result:
responding to the result display operation of a user, generating a display interface, wherein the display interface comprises a selection control;
and responding to the selection operation of the user on the selection control, and displaying the test result corresponding to the selection operation on the display interface.
7. An interface testing method according to any of claims 2-5, wherein said obtaining test requirements comprises:
uploading a test requirement to an auditing platform so that the auditing platform can generate auditing comments on the test requirement;
Obtaining audit opinions;
when the auditing opinion is failed, responding to a modification instruction triggered by a user, adjusting the testing requirement, and transmitting the adjusted testing requirement to an auditing platform;
and when the auditing opinion is passing the auditing, acquiring the testing requirement.
8. An interface testing apparatus, comprising:
the generation module is used for responding to the triggering operation of a user on a preset control, generating interface test text content of the preset control, wherein the preset control has a corresponding relation with the preset control, the interface test text content comprises a plurality of items, and the items comprise corresponding selectable alternative texts;
the replacing module is used for responding to the replacing operation of a user and replacing the interface test text content corresponding to the item according to the alternative text;
the construction module is used for constructing a test case according to the interface test text content;
the storage module is used for storing the test cases in a case warehouse;
and the interface test module is used for responding to interface test operation of a user, calling the test cases in the case warehouse to carry out interface test and obtaining a test result.
9. A terminal comprising a processor and a memory, the memory storing a plurality of instructions; the processor loads instructions from the memory to perform the interface testing method of any one of claims 1-7.
10. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the interface testing method of any one of claims 1 to 7.
CN202310350589.7A 2023-03-27 2023-03-27 Interface testing method, device, terminal and storage medium Pending CN116340182A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310350589.7A CN116340182A (en) 2023-03-27 2023-03-27 Interface testing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310350589.7A CN116340182A (en) 2023-03-27 2023-03-27 Interface testing method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN116340182A true CN116340182A (en) 2023-06-27

Family

ID=86876025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310350589.7A Pending CN116340182A (en) 2023-03-27 2023-03-27 Interface testing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN116340182A (en)

Similar Documents

Publication Publication Date Title
US9934406B2 (en) Protecting private information in input understanding system
CN110347560A (en) Abnormal prompt method, apparatus, system, equipment and the medium of big data product
JP2018185808A (en) Apparatus for and method of testing smart agreement based on block chain
US9336019B2 (en) Information processing apparatus and method therefor
CN108304201A (en) Object updating method, device and equipment
CN112187585A (en) Network protocol testing method and device
US10387390B2 (en) Judgment quality in SBS evaluation
CN110309931A (en) A kind of service optimization method and device
CN112799782B (en) Model generation system, method, electronic device and storage medium
KR20210138095A (en) Systems and methods for a virtual agent in a cloud computing environment
CN109635016A (en) Data transfer device, device, equipment and computer readable storage medium
CN107423223A (en) Test and management system
CN112313627A (en) Mapping mechanism of events to serverless function workflow instances
CN112835782A (en) Interface access test method and system
CN112016256A (en) Integrated circuit development platform, method, storage medium and equipment
CN116340182A (en) Interface testing method, device, terminal and storage medium
CN115115062B (en) Machine learning model building method, related device and computer program product
CN113347060B (en) Method, device and system for detecting power network fault based on process automation
JP4257364B2 (en) COMMUNICATION ERROR INFORMATION OUTPUT PROGRAM, COMMUNICATION ERROR INFORMATION OUTPUT METHOD, AND COMMUNICATION ERROR INFORMATION OUTPUT DEVICE
CN116011955A (en) Robot flow automation demand realization method, device, equipment and storage medium
CN115439080A (en) Work order automatic processing method and electronic equipment
CN110795137A (en) Authority configuration method, device, system, electronic equipment and readable medium
US20190196945A1 (en) Entity performance and usability analysis framework
CN115543807A (en) Automatic regression testing method and device, computer equipment and storage medium
CN116909649A (en) Visual configuration method, device and equipment for standard rule specification

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