CN108255714A - Interface document builds test method and terminal device - Google Patents

Interface document builds test method and terminal device Download PDF

Info

Publication number
CN108255714A
CN108255714A CN201810001735.4A CN201810001735A CN108255714A CN 108255714 A CN108255714 A CN 108255714A CN 201810001735 A CN201810001735 A CN 201810001735A CN 108255714 A CN108255714 A CN 108255714A
Authority
CN
China
Prior art keywords
interface
document
interface document
target
field
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
CN201810001735.4A
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.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart 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 OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201810001735.4A priority Critical patent/CN108255714A/en
Publication of CN108255714A publication Critical patent/CN108255714A/en
Pending legal-status Critical Current

Links

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

Abstract

The present invention is suitable for field of computer technology, provides a kind of interface document structure test method and terminal device.This method includes:The interface document that user is obtained in interface document structure test platform triggering builds instruction;Each interface in instruction structure interface document and the interface document is built according to the interface document;Structuring processing is carried out to each interface in the interface document, obtains unified structured document;The interface field of target interface in the structured document is obtained, the test case of target interface automation is generated according to the interface field of the target interface;The target interface is tested according to the test case that the target interface automates, it can solve existing to obtain interface document by modes such as QQ, wechat, mails, data maintenance is inconvenient, data are easily lost in transmission process, and the problem of test case is spliced acquisition by tester manually, and test period is long, testing efficiency is low.

Description

Interface document builds test method and terminal device
Technical field
The invention belongs to field of computer technology more particularly to a kind of interface document structure test method and terminal devices.
Background technology
In project development, the front and back end separation exploitation of project needs, by front and back end engineer's common definition interface, to write Interface document, later everybody all developed according to this interface document, will be safeguarded always before terminating to project.
Existing to be obtained if necessary to obtain interface document by modes such as QQ, wechat, mails, it is inconvenient to safeguard, data exist It is easily lost in transmission process.If wanting test interface document, tester is needed to splice test case manually and is surveyed Examination, test period is long, testing efficiency is low.
Invention content
The embodiment of the present invention provides a kind of interface document structure test method and terminal device, to solve existing to pass through The modes such as QQ, wechat, mail obtain interface document, and data maintenance is inconvenient, and data are easily lost in transmission process, and test The problem of use-case is spliced acquisition by tester manually, and test period is long, testing efficiency is low.
The first aspect of the embodiment of the present invention provides a kind of interface document structure test method, including:
The interface document that user is obtained in interface document structure test platform triggering builds instruction;
Each interface in instruction structure interface document and the interface document is built according to the interface document;
Structuring processing is carried out to each interface in the interface document, obtains unified structured document;
The interface field of target interface in the structured document is obtained, is generated according to the interface field of the target interface The test case of target interface automation, the target interface connect for any one in each interface in the structured document Mouthful;
The target interface is tested according to the test case that the target interface automates.
Optionally, it is described each in interface document structure instruction structure interface document and the interface document Interface includes:
Building instruction according to the interface document and obtain needs the product for establishing interface document;
According to the product and the correspondence of module to prestore, determine to need to build in the product for needing to establish interface document The module of vertical interface document;
According to the module and the correspondence of version to prestore, determine to need to build in the module for needing to establish interface document The version of vertical interface document;
Product, the module for needing to establish interface document and the needs of establishing interface document is needed to build according to described The version of vertical interface document, builds three hierarchy management interface document of multi-product-multimode-multi version;
The corresponding each interface of the three hierarchy managements interface document is determined, according to determining each described three layers of interface structure Each interface of grade management interface document.
Optionally, each interface in the interface document carries out structuring processing, obtains unified structuring Document includes:
According to the interface and the correspondence of interface field to prestore, determine that each interface in the interface document is corresponding Interface field;
Edit the interface field of each interface in the interface document respectively according to determining interface field;
The interface field of each interface in the interface document is converted into the structured document form to prestore, is united One structured document.
Optionally, interface field include interface name, interface url, interface specification, enter ginseng, go out ginseng, demo returned datas, The domain name of interface testing server and port;
The test case that target interface automation is generated according to the interface field of the target interface includes:
By the interface name of the target interface, interface url, interface specification, enter ginseng, go out ginseng, demo returned datas, interface The domain name of test server and port are assembled, and generate the test case of a target interface automation.
Optionally, the target interface is carried out to test it in the test case automated according to the target interface Afterwards, it further includes:
Obtain the returned data of the test case of the target interface automation;
According to the test case returned data that prestores and the returned data obtained, judge the target interface perform whether into Work(.
Optionally, the interface document structure instruction carries the identity of the user;
The method further includes:
The permission of the user is determined according to the identity;
Detect whether the permission of the user has the permission of structure interface document;
There is the permission of structure interface document if detecting the permission of the user, perform described according to interface text Each interface in shelves structure instruction structure interface document and the interface document.
The second aspect of the embodiment of the present invention provides a kind of interface document structure test terminal device, including memory, Processor and the computer program that can be run in the memory and on the processor is stored in, the processor performs Following steps are realized during the computer program:
The interface document that user is obtained in interface document structure test platform triggering builds instruction;
Each interface in instruction structure interface document and the interface document is built according to the interface document;
Structuring processing is carried out to each interface in the interface document, obtains unified structured document;
The interface field of target interface in the structured document is obtained, is generated according to the interface field of the target interface The test case of target interface automation, the target interface connect for any one in each interface in the structured document Mouthful;
The target interface is tested according to the test case that the target interface automates.
Optionally, it is described each in interface document structure instruction structure interface document and the interface document Interface includes:
Building instruction according to the interface document and obtain needs the product for establishing interface document;
According to the product and the correspondence of module to prestore, determine to need to build in the product for needing to establish interface document The module of vertical interface document;
According to the module and the correspondence of version to prestore, determine to need to build in the module for needing to establish interface document The version of vertical interface document;
Product, the module for needing to establish interface document and the needs of establishing interface document is needed to build according to described The version of vertical interface document, builds three hierarchy management interface document of multi-product-multimode-multi version;
The corresponding each interface of the three hierarchy managements interface document is determined, according to determining each described three layers of interface structure Each interface of grade management interface document.
Optionally, each interface in the interface document carries out structuring processing, obtains unified structuring Document includes:
According to the interface and the correspondence of interface field to prestore, determine that each interface in the interface document is corresponding Interface field;
Edit the interface field of each interface in the interface document respectively according to determining interface field;
The interface field of each interface in the interface document is converted into the structured document form to prestore, is united One structured document.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, realizes that above-mentioned interface document such as builds test side when the computer program is executed by processor The step of method.
Existing advantageous effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention is existed by obtaining user The interface document structure instruction of interface document structure test platform triggering builds instruction structure interface document according to the interface document With each interface in interface document, structuring processing is carried out to each interface in interface document, obtains unified structuring Document obtains the interface field of target interface in the structured document, and target interface is generated according to the interface field of target interface The test case of automation tests target interface according to the test case that target interface automates.Since the present invention is logical Interface document structure test platform structure interface document is crossed, user directly can build test platform acquisition by interface document and connect Mouth document is not needed to as that must obtain interface document by modes such as QQ, wechat, mails in the prior art, and data maintenance is convenient, Data is avoided to be lost in transmission process simultaneously, and the present invention generates the test of interface automation according to the interface field of interface Use-case, does not need to tester and splices test case manually to be tested, and shortens the interface automatic test period, improves survey Efficiency is tried, meets practical application needs.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description be only the present invention some Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of schematic flow diagram of interface document structure test method provided in an embodiment of the present invention;
Fig. 2 is the schematic flow diagram of a kind of interface document structure test method that another embodiment of the present invention provides;
Fig. 3 is the schematic flow diagram of a kind of interface document structure test method that yet another embodiment of the invention provides;
Fig. 4 is the schematic flow diagram of a kind of interface document structure test method that further embodiment of this invention provides;
Fig. 5 is the schematic flow diagram of a kind of interface document structure test method that further embodiment of this invention provides;
Fig. 6 is the schematic flow diagram of a kind of interface document structure test method that further embodiment of this invention provides;
Fig. 7 is a kind of schematic block diagram of interface document structure test program provided in an embodiment of the present invention;
Fig. 8 is a kind of schematic block diagram of interface document structure test terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specifically The present invention can also be realized in the other embodiments of details.In other situations, it omits to well-known system, device, electricity Road and the detailed description of method, in case unnecessary details interferes description of the invention.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Referring to Fig. 1, Fig. 1 is a kind of schematic flow diagram of interface document structure test method provided in an embodiment of the present invention, In this embodiment, it is illustrated by taking the triggering of the angle of server as an example, here, server can be to build to survey with interface document It tries platform and carries out information exchange.As shown in Figure 1, in this embodiment, the processing procedure of server may comprise steps of:
S101:The interface document that user is obtained in interface document structure test platform triggering builds instruction.
Here, interface document structure test platform can be a website, and user can build in interface document and survey Examination platform is operated, such as is created interface document, obtained interface document etc..It builds and surveys in interface document in above-mentioned acquisition user Before the interface document structure instruction for trying platform triggering, the logging request of the user can also be obtained, which carries Username and password judges whether the logging request is legal with password according to the user name to prestore, that is, verifies the user to prestore Whether name is with storing the username and password in above-mentioned logging request in password, if being stored in user name and password that verification prestores Username and password in above-mentioned logging request judges that above-mentioned logging request is legal, can perform subsequent step, otherwise, judges Above-mentioned logging request is illegal, stops operation, and generates login failure information.
S102:Each interface in instruction structure interface document and the interface document is built according to the interface document.
Specifically, above-mentioned interface document structure instruction can carry the identity of interface document for needing to build, subsequently Structure interface document can build the above-mentioned identity carried in instruction according to interface document and build, for example, the interface text that prestores Shelves identity and the correspondence of document elements find the above-mentioned identity carried in interface document structure instruction according to the relationship Corresponding document elements are identified, interface document is built according to the document elements found.Can prestore interface document and interface simultaneously Correspondence, after structure completes above-mentioned interface document, above-mentioned structure is found according to the correspondence of interface document and interface The corresponding interface of interface document, each interface of the interface document of above-mentioned structure is established according to the interface found.
Here, each interface in instruction structure interface document and the interface document are built according to the interface document Later, it can also show each interface in the interface document and the interface document of structure, related personnel is facilitated to audit, it can be with Whether generation changes the prompting of document, if receiving document changes request, according to the interface document of request modification structure and is somebody's turn to do Each interface in interface document, until meeting the requirements.
S103:Structuring processing is carried out to each interface in the interface document, obtains unified structured document.
It specifically, can be with Pre-existing structure document format, according to the structured document form to prestore to above-mentioned steps S102 Each interface of the interface document of structure carries out structuring processing, obtains unified structured document.Above-mentioned Pre-existing structureization text Shelves form can be set according to actual needs, such as setting structure document format is json forms.Here, to the interface of structure Document carries out structuring processing, and the interface document of structure is converted into unified structured document, makes the interface document lattice of structure Formula is unified, facilitates writing, change, developing for further interface document, is suitble to application.
Structuring processing is being carried out to each interface in the interface document, after obtaining unified structured document, It can also show unified structured document, related personnel is facilitated to understand the form of document in time, improve subsequent processing speed.
S104:The interface field of target interface in the structured document is obtained, according to the interface word of the target interface The test case of Duan Shengcheng target interfaces automation, the target interface are arbitrary in each interface in the structured document One interface.
Here, after the interface document of above-mentioned structure is converted into unified structured document, the system to conversion is needed One structured document is tested, and is illustrated for testing interface 1, obtains the interface field of interface 1, such as interface 1 interface name, interface url, interface specification enter ginseng, go out ginseng, demo returned datas, the domain name of interface testing server and end Mouthful etc., the test case automated according to the interface field of interface 1 one interface of generation.It is used according to the test that the interface automates Whether example tests interface 1, judge that interface 1 performs and succeed, so far complete the process of entire interface testing.
S105:The target interface is tested according to the test case that the target interface automates.
Specifically, the test case that interface automation can be repeatedly generated according to the interface field of interface 1 carries out interface 1 Test, preserves each test result, whether judge that interface 1 performs according to multiple test result succeeds.
It is evidenced from the above discussion that the interface document structure test method of the embodiment of the present invention, is built by interface document and surveyed Platform construction interface document is tried, user directly can build test platform by interface document and obtain interface document, not need to picture Interface document must be obtained by modes such as QQ, wechat, mails in the prior art, data maintenance is convenient, while data is avoided to exist It is lost in transmission process, and the present invention generates the test case of interface automation according to the interface field of interface, does not need to survey Examination personnel are spliced test case and are tested manually, shorten the interface automatic test period, improve testing efficiency, meet real Border application needs.
Referring to Fig. 2, a kind of signal stream of interface document structure test method that Fig. 2, which is another embodiment of the present invention, to be provided Cheng Tu.Embodiment corresponding with Fig. 1 difference lies in:It is described that instruction structure interface document and institute are built according to the interface document S202 can be included by stating each interface in interface document.Wherein S201 is identical with the S101 in a upper embodiment, and S203~ S205 is identical with S103~S105 in a upper embodiment, referring specifically to the phase of S101, S103 in above-described embodiment~S105 Description is closed, is not repeated herein.Specifically, S202 can include S2021~S2025:
S2021:Building instruction according to the interface document and obtain needs the product for establishing interface document.
Here, above-mentioned interface document structure instruction can carry the identity of interface document for needing to build, according to pre- The interface document identity deposited and the correspondence of product determine the above-mentioned interface document that interface document structure instruction carries The corresponding product of identity needs to establish the product of interface document according to determining product acquisition, can also show acquisition It needs to establish the product of interface document, facilitates subsequent processing.
S2022:According to the product and the correspondence of module to prestore, determine described to need to establish in the product of interface document Need to establish the module of interface document.
S2023:According to the module and the correspondence of version to prestore, determine described to need to establish in the module of interface document Need to establish the version of interface document.
S2024:According to the product for needing to establish interface document, the module for needing to establish interface document and described It needs to establish the version of interface document, builds three hierarchy management interface document of multi-product-multimode-multi version.
Specifically, structure needs to establish the product of interface document first, and then building needs to establish interface text in the product The module of shelves, obtaining needs the version of interface document established, according to the version of acquisition in the module for needing to establish interface document Middle structure interface document.For example, to establish product A- module a-1.0 version interface documents, it is necessary first to build interface document Product A, then building in product A needs to establish the module a of interface document, obtains the version of the interface document to be established, such as 1.0 version interface documents establish 1.0 version interface documents in module a, record the position of the interface document of foundation, i.e. product A- module a record the version information of the interface document of foundation, i.e. 1.0 versions.
Here, the product and the correspondence of module and module and the correspondence of version to prestore, builds building needs After the product of vertical interface document, according to the said goods module corresponding with the product that the correspondence of module finds structure, according to The module found establishes the module of interface document in corresponding product.Similarly, the mould for establishing interface document is needed building After block, according to the version of above-mentioned module interface document corresponding with the module that the correspondence of version finds structure, according to finding Version the version of interface document is established in corresponding module.
S2025:It determines the corresponding each interface of the three hierarchy managements interface document, institute is built according to determining each interface State each interface of three hierarchy management interface documents.
Specifically, can prestore the correspondence of interface document and interface, and above-mentioned three level is found according to the correspondence The corresponding each interface of management interface document builds above-mentioned each of three hierarchy managements interface document according to the interface found and connects Mouthful.
Here, by searching for needing to establish product, module and the version structure multi-product-multimode-more editions of interface document This three hierarchy management interface document, makes the interface document of structure meet plurality of application scenes needs, and accordingly build three level pipes Each interface of interface document is managed, document can be safeguarded by each interface of structure, be changed, update, being suitble to should With.
Referring to Fig. 3, a kind of signal stream of interface document structure test method that Fig. 3, which is yet another embodiment of the invention, to be provided Cheng Tu.Embodiment corresponding with Fig. 1 difference lies in:Each interface in the interface document is carried out at structuring Reason, S303 can be included by obtaining unified structured document.Wherein S301~S302 and S101~S102 in a upper embodiment Identical, S304~S305 is identical with S104~S105 in a upper embodiment, referring specifically to S101 in above-described embodiment~ The associated description of S102, S104~S105, do not repeat herein.Specifically, S303 can include S3031~S3033:
S3031:According to the interface and the correspondence of interface field to prestore, each interface in the interface document is determined Corresponding interface field.
S3032:Edit the interface field of each interface in the interface document respectively according to determining interface field.
S3033:The interface field of each interface in the interface document is converted into the structured document form to prestore, Obtain unified structured document.
Here, after each interface in building interface document, structuring processing is carried out to each interface, obtains unification Structured document.Specifically, prestore interface and the correspondence of interface field, and above-mentioned each connect is determined according to the correspondence The corresponding interface field of mouth edits the interface field of each interface, the interface field according to determining interface field respectively Including interface name, interface url, interface specification enters ginseng, goes out ginseng, structure content description (interface function description), and demo returns to number According to fixed fields such as, the domain name of interface testing server and ports.After completing the editing, according to the unified structuring to prestore Above-mentioned interface document is converted into unified structured document by document, and specifically, unified structured document can be json lattice The interface field of interface each in the interface document of above-mentioned structure after completing the editing, is converted by the interface document of formula respectively Then the word string of one json form preserves the corresponding word string of the interface field of each interface after conversion in the database, Structuring processing is completed, above-mentioned interface document is converted into unified structured document.
By the way that the interface document of structure to be converted into unified structured document, make the interface document uniform format of structure, Facilitate writing, change, developing for further interface document, meet practical application needs.
Referring to Fig. 4, a kind of signal stream of interface document structure test method that Fig. 4, which is further embodiment of this invention, to be provided Cheng Tu.Interface field includes interface name, interface url, interface specification, enters ginseng, goes out ginseng, demo returned datas, interface testing clothes The domain name of business device and port.Embodiment corresponding with Fig. 1 difference lies in:It is described to be given birth to according to the interface field of the target interface The test case automated into target interface can include S404.Wherein S401~S403 and the S101 in a upper embodiment~ S103 is identical, and S405 is identical with the S105 in a upper embodiment, referring specifically to S101~S103 in above-described embodiment, S105 Associated description does not repeat herein.Specifically, S404 can include S4041~S4042:
S4041:Obtain the interface field of target interface in the structured document.
S4042:By the interface name of the target interface, interface url, interface specification, enter ginseng, go out ginseng, demo return number It is assembled according to, the domain name of interface testing server and port, generates the test case of a target interface automation.
Here, in the structured document is obtained connecing for acquisition can also be shown after the interface field of target interface Mouth field when the interface field of target interface is assembled, can be assembled, for example, pressing according to default assembling rule Each element in the size of each element, interface field in acquisition sequence, interface field according to element each in interface field Type is assembled, here in interface field each element refer to interface name, interface url, interface specification, enter ginseng, go out ginseng, Demo returned datas, the domain name of interface testing server and port etc..
The test case of interface automation is generated by the interface field for obtaining interface, tester is not needed to and splices manually Test case is tested, and is shortened the interface automatic test period, is improved testing efficiency.
Referring to Fig. 5, a kind of interface document that Fig. 5, which is further embodiment of this invention, to be provided builds the signal stream of test method Cheng Tu.The present embodiment above-described embodiment difference lies in S506~S507, wherein S501~S505 in a upper embodiment S101~S105 is identical, referring specifically to the associated description of S101~S105 in above-described embodiment, does not repeat herein.The present embodiment In interface document structure test method can also include:
S506:Obtain the returned data of the test case of the target interface automation.
S507:According to the test case returned data to prestore and the returned data of acquisition, judge that the target interface performs Whether succeed.
Here, the test case automated according to the target interface of above-mentioned generation tests target interface, obtains this The returned data of a test case, then the test case returned data to prestore and the returned data of above-mentioned acquisition are compared, If comparison result is consistent, judge that target interface runs succeeded, otherwise, judge that target interface performs failure.It specifically, can be multiple Assembling interface testing use-case tests interface, preserves each test result, judges that interface performs according to multiple test result Whether succeed.
Referring to Fig. 6, a kind of interface document that Fig. 6, which is further embodiment of this invention, to be provided builds the signal stream of test method Cheng Tu.Difference lies in S602~S604 for the present embodiment above-described embodiment, and wherein S601 is identical with the S101 in a upper embodiment, S605~S607 is identical with S103~S105 in a upper embodiment, referring specifically to S101, S103 in above-described embodiment~ The associated description of S105, does not repeat herein.Interface document structure test method in the present embodiment can also include:
S602:The interface document structure instruction carries the identity of the user, is determined according to the identity The permission of the user.
S603:Detect whether the permission of the user has the permission of structure interface document.
S604:There is the permission of structure interface document if detecting the permission of the user, according to the interface document Each interface in structure instruction structure interface document and the interface document.
Here, user triggers structure instruction in interface document management platform, which carries User Identity, according to this Identity determines user right, judges whether the user right has the permission of structure interface document, if so, performing follow-up step Suddenly, if nothing, generation structure is unsuccessfully prompted.
User right is set, when detecting permission of the user with structure interface document, subsequent step is just performed, otherwise stops It only operates, avoids the out-of-limit operation of disabled user, ensure user's legitimate rights and interests.
It should be understood that the size of the serial number of each step is not meant to the priority of execution sequence, each process in above-described embodiment Execution sequence should determine that the implementation process without coping with the embodiment of the present invention forms any limit with its function and internal logic It is fixed.
Test method is built corresponding to the interface document described in foregoing embodiments, Fig. 7 shows that the embodiment of the present invention provides Interface document structure test program running environment schematic diagram.For convenience of description, it illustrates only related to the present embodiment Part.
In the present embodiment, interface document structure test program 700 is installed and is run in terminal device 70.It should Terminal device 70 can be mobile terminal, palm PC, server etc..The terminal device 70 may include, but be not limited only to, and store Device 701, processor 702 and display 703.Fig. 7 illustrates only the terminal device 70 with component 701-703, it should be understood that Be, it is not required that implement all components shown, the more or less component of the implementation that can be substituted.
The memory 701 can be the internal storage unit of the terminal device 70 in some embodiments, such as should The hard disk or memory of terminal device 70.The memory 701 can also be the terminal device 70 in further embodiments The plug-in type hard disk being equipped on External memory equipment, such as the terminal device 70, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, it is described to deposit Reservoir 701 can also both include the internal storage unit of the terminal device 70 or including External memory equipment.The memory 701 are installed on the application software and Various types of data of the terminal device 70, such as interface document structure test for storing Program code of program 700 etc..The memory 701 can be also used for temporarily storing the number that has exported or will export According to.
The processor 702 can be a central processing unit (Central Processing in some embodiments Unit, CPU), microprocessor or other data processing chips, for run the program code that is stored in the memory 701 or Data are handled, such as perform described interface document structure test program 700 etc..
The display 703 can be that light-emitting diode display, liquid crystal display, touch control type LCD are shown in some embodiments Device and Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) touch device etc..The display 703 For being shown in the information that is handled in the terminal device 70 and for showing visual user interface, such as application menu Interface, application icon interface etc..The component 701-703 of the terminal device 70 is in communication with each other by system bus.
Referring to Fig. 8, it is the functional block diagram of interface document structure test program 700 provided in an embodiment of the present invention. In the present embodiment, interface document structure test program 700 can be divided into one or more modules, it is one or The multiple modules of person are stored in the memory 701, and (the present embodiment is the processor by one or more processors 702) it is performed, to complete the present invention.For example, in fig. 8, interface document structure test program 700 can be divided Into structure instruction acquiring unit 801, interface document construction unit 802, structuring processing unit 803, Test cases technology unit 804 and interface testing unit 805.The so-called unit of the present invention is to refer to complete the series of computation machine program of specific function to refer to Section is enabled, than program more suitable for describing execution of the interface document structure test program 700 in the terminal device 70 Journey.The function of specifically introducing the module 801-805 is described below.
Wherein, structure instruction acquiring unit 801, for obtaining interface of the user in interface document structure test platform triggering Document structure instruction.Interface document construction unit 802, for building instruction structure interface document and institute according to the interface document State each interface in interface document.Structuring processing unit 803, for being tied to each interface in the interface document Structureization processing, obtains unified structured document.Test cases technology unit 804, for obtaining mesh in the structured document The interface field of tag splice mouth generates the test case of target interface automation according to the interface field of the target interface, described Target interface is any one interface in each interface in the structured document.Interface testing unit 805, for according to institute The test case for stating target interface automation tests the target interface.
Optionally, the interface document construction unit 802 can be divided into product acquiring unit 8021, module obtains list Member 8022, version acquiring unit 8023, the first document construction unit 8024 and the second document construction unit 8025.
Wherein, product acquiring unit 8021 needs to establish interface text for building instruction according to the interface document and obtaining The product of shelves.Module acquiring unit 8022 for the correspondence according to the product that prestores and module, determines described to need to establish Need to establish the module of interface document in the product of interface document.Version acquiring unit 8023, for according to the module that prestores with The correspondence of version determines to need to establish the version of interface document in the module for needing to establish interface document.First text Shelves construction unit 8024, for needing to establish the product of interface document, the module for needing to establish interface document according to described With the version for needing to establish interface document, three hierarchy management interface document of multi-product-multimode-multi version is built.Second Document construction unit 8025, for determining the corresponding each interface of the three hierarchy managements interface document, according to determining each to connect Mouth builds each interface of the three hierarchy managements interface document.
Optionally, the structuring processing unit 803 can be divided into interface field determination unit 8031, interface field Edit cell 8032 and interface field structuring unit 8033.
Wherein, interface field determination unit 8031, for according to the interface and the correspondence of interface field to prestore, determining The corresponding interface field of each interface in the interface document.Interface field edit cell 8032, for being connect according to what is determined Mouth field edits the interface field of each interface in the interface document respectively.Interface field structuring unit 8033, is used for The interface field of each interface in the interface document is converted into the structured document form to prestore, obtains unified structure Change document.
Optionally, interface field include interface name, interface url, interface specification, enter ginseng, go out ginseng, demo returned datas, The domain name of interface testing server and port.
The Test cases technology unit 804 can be divided into interface field acquiring unit 8041 and Test cases technology Unit 8042.
Wherein, interface field acquiring unit 8041, for obtaining the interface field of target interface in the structured document. Test cases technology unit 8042, for by the interface name of the target interface, interface url, interface specification, enter ginseng, go out ginseng, Demo returned datas, the domain name of interface testing server and port are assembled, and generate the test of a target interface automation Use-case.
Optionally, interface document structure test program 700 can also be divided into returned data acquiring unit 806 With test judging unit 807.
Wherein, returned data acquiring unit 806, for obtaining the return number of the test case of the target interface automation According to.Judging unit 807 is tested, for according to the test case returned data to prestore and the returned data of acquisition, judging the mesh Whether the execution of tag splice mouth succeeds.
Optionally, the interface document structure instruction carries the identity of the user.
The interface document structure test program 700 can also be divided into user right determination unit 808 and user Permission detection unit 809.
Wherein, user right determination unit 808, for determining the permission of the user according to the identity.User Permission detection unit 809, for detecting whether the permission of the user has the permission of structure interface document.The interface document Construction unit 802, if for detecting that the permission of the user has the permission of structure interface document, according to interface text Each interface in shelves structure instruction structure interface document and the interface document.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each work( Can unit, module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device are divided into different functional units or module, more than completion The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used To be that each unit is individually physically present, can also two or more units integrate in a unit, it is above-mentioned integrated The form that hardware had both may be used in unit is realized, can also be realized in the form of SFU software functional unit.In addition, each function list Member, the specific name of module are not limited to the protection domain of the application also only to facilitate mutually distinguish.Above system The specific work process of middle unit, module can refer to the corresponding process in preceding method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may realize that each exemplary lists described with reference to the embodiments described herein Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is performed with hardware or software mode, specific application and design constraint depending on technical solution.Professional technician Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of division of logic function can have other dividing mode in actual implementation, such as Multiple units or component may be combined or can be integrated into another system or some features can be ignored or does not perform.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be by some interfaces, device Or the INDIRECT COUPLING of unit or communication connection, can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit The component shown may or may not be physical unit, you can be located at a place or can also be distributed to multiple In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also That each unit is individually physically present, can also two or more units integrate in a unit.Above-mentioned integrated list The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
If the integrated module/unit realized in the form of SFU software functional unit and be independent product sale or In use, it can be stored in a computer read/write memory medium.Based on such understanding, the present invention realizes above-mentioned implementation All or part of flow in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It can include:Any entity of the computer program code or device, recording medium, USB flash disk, mobile hard disk, magnetic can be carried Dish, CD, computer storage, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the meter The content that calculation machine readable medium includes can carry out appropriate increase and decrease according to legislation in jurisdiction and the requirement of patent practice, Such as in certain jurisdictions, according to legislation and patent practice, computer-readable medium does not include electric carrier signal and telecommunications Signal.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to aforementioned reality Example is applied the present invention is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to aforementioned each Technical solution recorded in embodiment modifies or carries out equivalent replacement to which part technical characteristic;And these are changed Or replace, the spirit and scope for various embodiments of the present invention technical solution that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of interface document builds test method, which is characterized in that including:
The interface document that user is obtained in interface document structure test platform triggering builds instruction;
Each interface in instruction structure interface document and the interface document is built according to the interface document;
Structuring processing is carried out to each interface in the interface document, obtains unified structured document;
The interface field of target interface in the structured document is obtained, target is generated according to the interface field of the target interface The test case of interface automation, the target interface are any one interface in each interface in the structured document;
The target interface is tested according to the test case that the target interface automates.
2. interface document as described in claim 1 builds test method, which is characterized in that described according to the interface document structure The each interface built in instruction structure interface document and the interface document includes:
Building instruction according to the interface document and obtain needs the product for establishing interface document;
According to the product and the correspondence of module to prestore, determine to need to establish in the product for needing to establish interface document to connect The module of mouth document;
According to the module and the correspondence of version to prestore, determine to need to establish in the module for needing to establish interface document to connect The version of mouth document;
Product, the module for needing to establish interface document and the needs of establishing interface document is needed to establish and connect according to described The version of mouth document, builds three hierarchy management interface document of multi-product-multimode-multi version;
It determines the corresponding each interface of the three hierarchy managements interface document, the three levels pipe is built according to determining each interface Manage each interface of interface document.
3. interface document as described in claim 1 builds test method, which is characterized in that described in the interface document Each interface carries out structuring processing, obtains unified structured document and includes:
According to the interface and the correspondence of interface field to prestore, the corresponding interface of each interface in the interface document is determined Field;
Edit the interface field of each interface in the interface document respectively according to determining interface field;
The interface field of each interface in the interface document is converted into the structured document form to prestore, is unified Structured document.
4. interface document as described in claim 1 builds test method, which is characterized in that interface field include interface name, Interface uniform resource locator url, interface specification, enter ginseng, go out ginseng, demo returned datas, the domain name of interface testing server and Port;
The test case that target interface automation is generated according to the interface field of the target interface includes:
By the interface name of the target interface, interface url, interface specification, enter ginseng, go out ginseng, demo returned datas, interface testing The domain name of server and port are assembled, and generate the test case of a target interface automation.
5. interface document as described in claim 1 builds test method, which is characterized in that described according to the target interface After the test case of automation tests the target interface, further include:
Obtain the returned data of the test case of the target interface automation;
According to the test case returned data to prestore and the returned data of acquisition, judge whether the target interface execution succeeds.
6. interface document as described in claim 1 builds test method, which is characterized in that the interface document structure instruction is taken Identity with the user;
The method further includes:
The permission of the user is determined according to the identity;
Detect whether the permission of the user has the permission of structure interface document;
There is the permission of structure interface document if detecting the permission of the user, perform described according to the interface document structure Build each interface in instruction structure interface document and the interface document.
7. a kind of interface document structure test terminal device, which is characterized in that including memory, processor and be stored in described In memory and the computer program that can run on the processor, the processor are realized when performing the computer program Following steps:
The interface document that user is obtained in interface document structure test platform triggering builds instruction;
Each interface in instruction structure interface document and the interface document is built according to the interface document;
Structuring processing is carried out to each interface in the interface document, obtains unified structured document;
The interface field of target interface in the structured document is obtained, target is generated according to the interface field of the target interface The test case of interface automation, the target interface are any one interface in each interface in the structured document;
The target interface is tested according to the test case that the target interface automates.
8. interface document structure test terminal device as claimed in claim 7, which is characterized in that described according to interface text Each interface in shelves structure instruction structure interface document and the interface document includes:
Building instruction according to the interface document and obtain needs the product for establishing interface document;
According to the product and the correspondence of module to prestore, determine to need to establish in the product for needing to establish interface document to connect The module of mouth document;
According to the module and the correspondence of version to prestore, determine to need to establish in the module for needing to establish interface document to connect The version of mouth document;
Product, the module for needing to establish interface document and the needs of establishing interface document is needed to establish and connect according to described The version of mouth document, builds three hierarchy management interface document of multi-product-multimode-multi version;
It determines the corresponding each interface of the three hierarchy managements interface document, the three levels pipe is built according to determining each interface Manage each interface of interface document.
9. interface document structure test terminal device as claimed in claim 7, which is characterized in that described to the interface document In each interface carry out structuring processing, obtain unified structured document and include:
According to the interface and the correspondence of interface field to prestore, the corresponding interface of each interface in the interface document is determined Field;
Edit the interface field of each interface in the interface document respectively according to determining interface field;
The interface field of each interface in the interface document is converted into the structured document form to prestore, is unified Structured document.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In realization interface document as described in any one of claim 1 to 6 builds test side when the computer program is executed by processor The step of method.
CN201810001735.4A 2018-01-02 2018-01-02 Interface document builds test method and terminal device Pending CN108255714A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810001735.4A CN108255714A (en) 2018-01-02 2018-01-02 Interface document builds test method and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810001735.4A CN108255714A (en) 2018-01-02 2018-01-02 Interface document builds test method and terminal device

Publications (1)

Publication Number Publication Date
CN108255714A true CN108255714A (en) 2018-07-06

Family

ID=62725521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810001735.4A Pending CN108255714A (en) 2018-01-02 2018-01-02 Interface document builds test method and terminal device

Country Status (1)

Country Link
CN (1) CN108255714A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109445841A (en) * 2018-11-08 2019-03-08 深圳乐信软件技术有限公司 Interface document management method, device, server and storage medium
CN109522220A (en) * 2018-10-23 2019-03-26 中国银行股份有限公司 A kind of text test method and device
CN110232018A (en) * 2019-05-17 2019-09-13 浙江数链科技有限公司 Interface test method, device, computer equipment
CN110458513A (en) * 2019-07-17 2019-11-15 广东鼎义互联科技股份有限公司 A kind of centralization interface document management platform
CN110955416A (en) * 2019-10-12 2020-04-03 平安普惠企业管理有限公司 Interface document generation method, device, equipment and computer storage medium
CN111274120A (en) * 2018-12-05 2020-06-12 北京奇虎科技有限公司 Interface document verification method and device
CN111581083A (en) * 2020-04-26 2020-08-25 北京字节跳动网络技术有限公司 Interface testing method and device, electronic equipment and storage medium
CN112307723A (en) * 2020-08-31 2021-02-02 北京字节跳动网络技术有限公司 Method and device for generating code document and electronic equipment
CN112799952A (en) * 2021-02-04 2021-05-14 上海云轴信息科技有限公司 Method and equipment for automatically testing cloud platform account system authority
CN113535531A (en) * 2020-04-14 2021-10-22 浙江大搜车软件技术有限公司 Interface document generation method, interface test method and device
CN114356786A (en) * 2022-03-11 2022-04-15 中电云数智科技有限公司 IAM interface authority verification method and device based on automatic interface generation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567838A (en) * 2010-12-30 2012-07-11 中国移动通信集团公司 Collaborative development system and collaborative development method
US20130282892A1 (en) * 2012-04-23 2013-10-24 Ithai Levi Event extractor
CN104375814A (en) * 2013-08-14 2015-02-25 腾讯科技(深圳)有限公司 Generation method and device of an interface document
CN105528294A (en) * 2015-12-29 2016-04-27 广东金赋信息科技有限公司 Method and system for automatically generating interface testing case
CN105681126A (en) * 2015-12-30 2016-06-15 合一网络技术(北京)有限公司 Automatic test method and system based on protocol interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567838A (en) * 2010-12-30 2012-07-11 中国移动通信集团公司 Collaborative development system and collaborative development method
US20130282892A1 (en) * 2012-04-23 2013-10-24 Ithai Levi Event extractor
CN104375814A (en) * 2013-08-14 2015-02-25 腾讯科技(深圳)有限公司 Generation method and device of an interface document
CN105528294A (en) * 2015-12-29 2016-04-27 广东金赋信息科技有限公司 Method and system for automatically generating interface testing case
CN105681126A (en) * 2015-12-30 2016-06-15 合一网络技术(北京)有限公司 Automatic test method and system based on protocol interface

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109522220A (en) * 2018-10-23 2019-03-26 中国银行股份有限公司 A kind of text test method and device
CN109445841A (en) * 2018-11-08 2019-03-08 深圳乐信软件技术有限公司 Interface document management method, device, server and storage medium
CN109445841B (en) * 2018-11-08 2022-04-22 深圳乐信软件技术有限公司 Interface document management method, device, server and storage medium
CN111274120A (en) * 2018-12-05 2020-06-12 北京奇虎科技有限公司 Interface document verification method and device
CN111274120B (en) * 2018-12-05 2024-02-02 三六零科技集团有限公司 Interface document verification method and device
CN110232018A (en) * 2019-05-17 2019-09-13 浙江数链科技有限公司 Interface test method, device, computer equipment
CN110458513A (en) * 2019-07-17 2019-11-15 广东鼎义互联科技股份有限公司 A kind of centralization interface document management platform
CN110955416A (en) * 2019-10-12 2020-04-03 平安普惠企业管理有限公司 Interface document generation method, device, equipment and computer storage medium
CN113535531A (en) * 2020-04-14 2021-10-22 浙江大搜车软件技术有限公司 Interface document generation method, interface test method and device
CN111581083A (en) * 2020-04-26 2020-08-25 北京字节跳动网络技术有限公司 Interface testing method and device, electronic equipment and storage medium
CN111581083B (en) * 2020-04-26 2024-02-09 抖音视界有限公司 Interface testing method and device, electronic equipment and storage medium
CN112307723A (en) * 2020-08-31 2021-02-02 北京字节跳动网络技术有限公司 Method and device for generating code document and electronic equipment
CN112799952A (en) * 2021-02-04 2021-05-14 上海云轴信息科技有限公司 Method and equipment for automatically testing cloud platform account system authority
CN114356786A (en) * 2022-03-11 2022-04-15 中电云数智科技有限公司 IAM interface authority verification method and device based on automatic interface generation
CN114356786B (en) * 2022-03-11 2022-06-07 中电云数智科技有限公司 IAM interface authority verification method and device based on automatic interface generation

Similar Documents

Publication Publication Date Title
CN108255714A (en) Interface document builds test method and terminal device
CN108268253B (en) Interface code generation method and terminal equipment
US8151248B1 (en) Method and system for software defect management
US20190042211A1 (en) Expressive generic model technology
Tsatsou et al. Towards a taxonomy for regulatory issues in a digital business ecosystem in the EU
CN103238308B (en) The method and system of propagating source identification information
CN106062719A (en) Service metric analysis from structured logging schema of usage data
CN102170378B (en) Web service test method with no need of anticipation
EP3185027B1 (en) Information processing method and device and computer storage medium
CN108268374B (en) Software version test method, device, terminal device and storage medium
Zanoni et al. Pattern detection for conceptual schema recovery in data‐intensive systems
CN112148278A (en) Visual block chain intelligent contract framework and intelligent contract development and deployment method
CN110162464A (en) Mcok test method and system, electronic equipment and readable storage medium storing program for executing
CN109460661A (en) A kind of logical security leak detection method, device and terminal device
CN108601023A (en) Home-network linkups authentication method, device, electronic equipment and storage medium
CN108733374A (en) Application program homepage development approach and terminal device
CN111125066B (en) Method and device for detecting functions of database auditing equipment
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
Faily et al. Design as code: facilitating collaboration between usability and security engineers using CAIRIS
Singh et al. Demand based test case generation for object oriented system
Eisele et al. SolidWorx: A resilient and trustworthy transactive platform for smart and connected communities
CN115544950A (en) Constraint file importing method, device, equipment and storage medium
CN109582347A (en) A kind of method and device obtaining front-end code
CN110737427B (en) Internet technology architecture, construction method and device thereof, electronic equipment and medium
Hatebur et al. A method for component-based software and system development

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180706