CN109582560A - Test file edit methods, device, equipment and computer readable storage medium - Google Patents
Test file edit methods, device, equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN109582560A CN109582560A CN201811180735.1A CN201811180735A CN109582560A CN 109582560 A CN109582560 A CN 109582560A CN 201811180735 A CN201811180735 A CN 201811180735A CN 109582560 A CN109582560 A CN 109582560A
- Authority
- CN
- China
- Prior art keywords
- tested
- file
- api
- test
- api file
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Abstract
A kind of test file edit methods, device, equipment and computer readable storage medium, the method includes obtaining API file to be tested;There is authentication script in API file to be tested and carry out permission identification when receiving authentication information, to confirm the operating right of user;When detecting test instruction, API file to be tested is tested and shows test result;When detecting edit instruction, according to edit instruction and test result editor API file to be tested;API file to be tested is verified when detecting checking command;When API file verification to be tested passes through, then it is assumed that API file corresponding function test passes to be tested;API file to be tested is saved when detecting and saving instruction and is stored to the destination address of memory.The present invention carries out online editing, test and verification to interface test file by visualization interface, reduces the difficulty of API file edit, optimized interface test function.
Description
Technical field
The invention mainly relates to fields of communication technology, specifically, being related to a kind of test file edit methods, device, setting
Standby and computer readable storage medium.
Background technique
With the continuous development of software industry, software newly developed becomes increasingly complex, and function is more and more, so that software is surveyed
Examination also becomes to become increasingly complex.In software test procedure, to guarantee to test quality, it usually needs design and write a large amount of survey
Example on probation.However, testing example design needs higher technical level and working experience abundant, and test case is carried out
Write and modify the plenty of time for generally requiring to expend tester, excessively labor intensive.On the other hand, due to multiple to be tested
Often there is intimate module in software, corresponding test case is also more similar, if rewriting test every time
Use-case, and substantially reduce testing efficiency.
Summary of the invention
The main object of the present invention is to provide a kind of test file edit methods, device, equipment and computer-readable storage
Medium, it is intended to solve the problems, such as that testing efficiency is low in the prior art.
To achieve the above object, the present invention provides a kind of test file edit methods, the test file edit methods packet
Include following steps:
Obtain API file to be tested;
There is authentication script in the API file to be tested and carry out permission identification when receiving authentication information,
To confirm the operating right of user;
When detecting test instruction, the API file to be tested is tested and shows test result;
When detecting edit instruction, according to the text of API to be tested described in the edit instruction and the test result editor
Part;
When detecting checking command, the API file to be tested is verified;
When the API file verification to be tested passes through, then it is assumed that the corresponding function of the API file to be tested is qualified;
When detecting preservation instruction, saves the API file to be tested and simultaneously store to the destination address of memory.
Preferably, the step of acquisition API file to be tested includes:
When detecting search instruction by the name of the existing API file in the search key received and the memory
Title is compared;
Judge in the memory with the presence or absence of the API file to match with the received search key;
If it exists, it grabs and shows and at least one matched API file of the search key;
Select corresponding API file as the API file to be tested when detecting selection instruction;
If it does not exist, prompt information is generated, there is no matched with the search key to prompt in the memory
API file;
New API file is established as the API file to be tested when detecting newly-built instruction.
Preferably, it is described exist in the API file to be tested authentication script and when receiving authentication information into
Row permission identify the step of include:
The authentication information is compared with the identity information in memory;
Judge to whether there is and the matched identity information of the authentication information in the memory;
If it exists, then allow to operate the API file to be tested;
If it does not exist, pop-up dialog box prompt authentication information is not present, and does not allow to the API file to be tested
It is operated.
Preferably, described that the API file to be tested is tested when detecting test instruction and shows test knot
The step of fruit includes:
When detecting test instruction, API file to be tested described in running background;
Receive the response data that the API file to be tested returns;
Show the response data.
Preferably, described the step of verifying when detecting checking command to the API file to be tested, includes:
Grab the returned data of target component;
The returned data of crawl is compared with corresponding desired value;The API document memory to be tested contains multiple
Desired value;The desired value is the intended response data returned after the target component is run;
If the returned data of the crawl is consistent with the corresponding desired value, in the form of a popup window prompt verification at
Function;
If the returned data of the crawl and the corresponding desired value are inconsistent, by check results in a manner of mail
It is sent to designated person.
Preferably, it is edited according to target component of the edit instruction to the API file to be tested;The target
Parameter may include key-value pair parameter, JSON format parameter and scene build parameter;It is key-value pair parameter in the target component
When, according to the edit instruction for being increased newly, being adjusted to key-value pair parameter, deleted and batch import operation.
Preferably, the relevant parameter in the API file to be tested increased newly according to user demand, deleted, modified
Deng operation to generate new API file.
In addition, to achieve the goals above, the present invention also proposes that a kind of test file editing device, the test file are compiled
Collecting device includes:
Module is obtained, for obtaining API file to be tested;
Authentication module, when for there is authentication script in the API file to be tested and receive authentication information
Permission identification is carried out, to confirm the operating right of user;
Test module, for being tested when detecting test instruction the API file to be tested and showing test
As a result;
Editor module, for editing the API file to be tested when detecting edit instruction;
Correction verification module, for being verified when detecting checking command to the API file to be tested;Described to be measured
Examination API file verification is when passing through, then it is assumed that the corresponding function of the API file to be tested is qualified;
Preserving module, for saving the API file to be tested when detecting and saving instruction and storing to memory
Destination address.
In addition, to achieve the goals above, the present invention also proposes that a kind of equipment, equipment include processor and memory, place
Following steps are realized when reason device when executing the computer program stored in memory for executing:
Obtain API file to be tested;
There is authentication script in the API file to be tested and carry out permission identification when receiving authentication information,
To confirm the operating right of user;
When detecting test instruction, the API file to be tested is tested and shows test result;
When detecting edit instruction, according to the text of API to be tested described in the edit instruction and the test result editor
Part;
When detecting checking command, the API file to be tested is verified;
When the API file verification to be tested passes through, then it is assumed that the corresponding function of the API file to be tested is qualified;
When detecting preservation instruction, saves the API file to be tested and simultaneously store to the destination address of memory.
In addition, to achieve the goals above, the present invention also proposes a kind of computer readable storage medium, and the computer can
It reads storage medium and is stored at least one instruction, at least one described instruction realizes following steps when being executed by processor:
Obtain API file to be tested;
There is authentication script in the API file to be tested and carry out permission identification when receiving authentication information,
To confirm the operating right of user;
The API file to be tested is tested when detecting test instruction and shows test result;
The API file to be tested is edited when detecting edit instruction;
The API file to be tested is verified when detecting checking command;
When the API file verification to be tested passes through, then it is assumed that the corresponding function of the API file to be tested is qualified;
The API file to be tested is saved when detecting and saving instruction and is stored to the destination address of memory.
Compared with prior art, user can obtain API file to be tested in API test interface, and to API text to be tested
Operation is edited online, is tested, verified and saved to part, has programming basis without tester, API file can be improved
Design efficiency, while also reducing the difficulty of API file edit.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is the flow diagram of test file edit methods of the present invention.
Fig. 2 is the refinement flow diagram of step S11 in Fig. 1.
Fig. 3 is the refinement flow diagram of step S12 in Fig. 1.
Fig. 4 is the refinement flow diagram of step S13 in Fig. 1.
Fig. 5 is the refinement flow diagram of step S15 in Fig. 1.
Fig. 6 is the functional block diagram of test file editing device of the present invention.
Fig. 7 is the device structure schematic diagram of the hardware running environment of the embodiment of the present invention.
Main element symbol description
Obtain module 10
Authentication module 20
Test module 30
Editor module 40
Correction verification module 50
Preserving module 60
Memory 102
Communication bus 104
Processor 106
The present invention that the following detailed description will be further explained with reference to the above drawings.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
Description and claims of this specification and term " first " in above-mentioned attached drawing, " second " and " third " etc. are
For distinguishing different objects, not for description particular order.In addition, term " includes " and their any deformations, it is intended that
Non-exclusive include in covering.Such as it contains series of steps or the process, method, system, product or equipment of module and does not have
It is defined in listed step or module, but optionally further comprising the step of not listing or module, or optionally further comprising
For these process, methods, product or equipment intrinsic other steps or module.
Referring to Fig. 1, it is the flow chart of test file edit methods of the present invention.The flow chart according to different requirements,
The sequence of middle step can change, and certain steps can be omitted.
S11 obtains API file to be tested.
With the development of communication technology, the application function of types of applications software is more and more, is such as installed in machine or computer
On safety bank, safety the financing class software etc. such as easily borrow.Each function is realized by program code, in order to facilitate the dimension of program
It protects, multiple API (Application Programming Interface, application programming interface) text is provided in code
Part, its essence is some functions predetermined for API file, this is arranged for accessing to application program or application developer
The program of API so that application program or application developer are not necessarily to access the source code of program, or understands its internal work mechanism
It can be realized or understand the function of code.
In one embodiment, the test file edit methods are applied to the interface testing management platform in an equipment
In.The interface testing management platform is used to provide man-machine interactive interface towards tester by customer terminal webpage or Web page,
Tester can be connected on the interface testing management platform by terminal devices such as mobile phone or computers.The interface testing
Management platform for writing, storing, Administration API file, while also for tester's verification, editor, integrate existing API file.
Specifically, the interface testing management platform shows an API test interface, includes an input field in the API test interface
For for user entered keyword.The API test interface can according to the keyword in input in memory Auto-matching phase
The API file of pass.
It in one embodiment, include the interface testing script of at least one type in the API file.Each test foot
It originally may include interface name, Application Programming Interface address of service, test mode, test request parameter and verification mode etc..Institute
Stating API file can be the API file obtained out of database, or be created in database according to newly-built instruction
API file.
Referring to Figure 2 together, specifically, the step S11 for obtaining API file to be tested is specific can include:
S111, when detecting search instruction by the existing API file in the search key and memory that receive
Title is compared;
The search key can be text, such as when user needs to test financing ranking list or finance fast sale list,
Keyword " financing ", " ranking list " etc. can be inputted in the frame retrieval.The search key can also be that automation is surveyed
Specific fields or function in training sheet, naturally it is also possible to be the identifier etc. for identifying test case.
S112 judges in the memory with the presence or absence of the API file to match with the received search key;
S113, and if it exists, grab and show and at least one matched API file of the search key;
S114 selects corresponding API file as API file to be tested when detecting selection instruction;
S115 generates prompt information if it does not exist, to prompt to be not present and the search key in the memory
The API file matched;
S116 establishes new API file as API file to be tested when detecting newly-built instruction.
The API test interface further comprises description field, intuitively to show API file to be tested to user
Function.In one embodiment, the description field may include interface function, interface description, test result and check item description.Example
It such as, is "/elis_smp_eco_dzm/web/financialCircle/ in the API file of extraction
HotPurchaseProductList.visit ", corresponding description field are [finance circle]-[fast-selling list list]-normal stream
Journey-circleType is that fast-selling list is enclosed in 04 financing.
There is authentication script in API file to be tested and carry out permission identification when receiving authentication information in S12,
To confirm the operating right of user.
In one embodiment, when API file to be tested includes authentication script, according to authentication information to user identity
Carry out authority verification.In the present embodiment, authentication information can be user name, password, fingerprint, facial image information
Deng.
Also referring to Fig. 3, specifically, there is authentication script in API file to be tested and receive authentication letter
The step S12 of permission identification is carried out when breath can include:
The authentication information is compared S121 with identity information in memory;
S122 judges to whether there is and the matched identity information of the authentication information in the memory;
S123, and if it exists, then allow to operate API file to be tested;
S124, if it does not exist, pop-up dialog box prompt authentication information are not present, and do not allow to API text to be tested
Part is operated.
S13, API file to be tested is tested when detecting test instruction and shows test result.
In one embodiment, the API test interface further comprises a testing button and response message field.?
After clicking testing button, the API test interface is shown in running background API file to be tested and in response message field
The test result of API file to be tested.
Referring to Figure 4 together, specifically, API file to be tested is tested and is shown when detecting test instruction
The step S13 of test result can include:
S131, when detecting test instruction, running background API file to be tested;
S132 receives the response data that API file to be tested returns;
S133 shows response data.
S14, API file to be tested is edited when detecting edit instruction.
In one embodiment, the API test interface further comprises having API parameter editor's field.According to the volume
Instruction is collected to edit the target component of API file to be tested.The target component may include key-value pair parameter, JSON format
Parameter and scene build parameter etc..In one embodiment, the key-value pair parameter can further comprise parameter name, ginseng
Numerical value and encipherment scheme etc..In one embodiment, when the target component is key-value pair parameter, the edit instruction is used for
Key-value pair parameter is increased newly, is adjusted, is deleted and importing etc. operates in batches.It is correspondingly arranged in API test interface newly-increased
Button, delete button and RAW batch addition button, user is by clicking above-mentioned button to the institute in API file to be tested
State the operations such as key-value pair parameter is increased newly, adjusted, deleted and batch imports.
S15, API file to be tested is verified when detecting checking command, and logical in API file verification to be tested
It is out-of-date, then it is assumed that the corresponding function of API file to be tested is qualified.
In one embodiment, the API test interface further comprises having verification button.The checking command passes through use
It clicks verification button and generates in family.The API document memory to be tested contains multiple desired values.The desired value is target ginseng
The intended response data returned after number operation.
Please refer to fig. 5, specifically, it is described to detect the step that checking command verifies API file to be tested
Rapid S15 can include:
S151 grabs the returned data of target component when detecting checking command;
The returned data of crawl is compared by S152 with corresponding desired value;
S153, if the returned data of crawl is consistent with corresponding desired value, prompt is verified successfully in the form of a popup window;
S154 is sent out check results in a manner of mail if the returned data and corresponding desired value of crawl are inconsistent
It send to designated person.
In one embodiment, the checking command also carries out packet loss verification to API file to be tested.
S16, API file to be tested is saved when detecting and saving instruction and is stored to the destination address of memory.
In one embodiment, the relevant parameter in the API file to be tested increased newly according to user demand, deleted
The operation such as remove, modify to generate new API file, so that user quotes when designing new API file.
In one embodiment, the API file is made of being write by automatic test script language, and can compile
Test and verification operation are carried out after writing complete directly to complete automatic test.
As seen from the above embodiment, user can obtain API file to be tested in API test interface, and to API text to be tested
Operation is edited online, is tested, verified and saved to part, has programming basis without tester, API file can be improved
Design efficiency, while also reducing the difficulty of API file edit.
Fig. 6 is please referred to, the present invention provides a kind of document edit device, is applied in one or more equipment.In the present invention
In embodiment, the document edit device includes:
Module 10 is obtained, for obtaining API file to be tested.
With the development of communication technology, the application function of types of applications software is more and more, is such as installed in machine or computer
On safety bank, safety the financing class software etc. such as easily borrow.Each function is realized by program code, in order to facilitate the dimension of program
It protects, multiple API (Application Programming Interface, application programming interface) text is provided in code
Part, its essence is some functions predetermined for API file, this is arranged for accessing to application program or application developer
The program of API so that application program or application developer are not necessarily to access the source code of program, or understands its internal work mechanism
It can be realized or understand the function of code.
In one embodiment, the interface document editing device is applied to the interface testing management platform in an equipment
In.The interface testing management platform is used to provide man-machine interactive interface towards tester by customer terminal webpage or Web page,
Tester can be connected on the interface testing management platform by terminal devices such as mobile phone or computers.The interface testing
Management platform for writing, storing, Administration API file, while also for tester's verification, editor, integrate existing API file.
Specifically, the interface testing management platform shows an API test interface, includes an input field in the API test interface
For for user entered keyword.The API test interface can according to the keyword in input in memory Auto-matching phase
The API file of pass.
It in one embodiment, include the interface testing script of at least one type in the API file.Each test foot
It originally may include interface name, Application Programming Interface address of service, test mode, test request parameter and verification mode etc..Institute
Stating API file can be the API file obtained out of database, or be created in database according to newly-built instruction
API file.
The search key and memory that obtains module 10 and will further be received when detecting search instruction
In the title of existing API file be compared.
The acquisition module 10 further judges to whether there is and the received search key in the memory
The API file to match.If it exists, the acquisition module 10 grab and show with the search key it is matched at least one
API file.
The acquisition module 10 further selects corresponding API file as to be tested when detecting selection instruction
API file.
If it does not exist, the acquisition module 10 generates prompt information, to prompt to be not present and the inspection in the memory
The API file of rope keyword match.
The acquisition module 10 further establishes new API file as API to be tested when detecting newly-built instruction
File.
The API test interface further comprises description field, intuitively to show API file to be tested to user
Function.In one embodiment, the description field may include interface function, interface description, test result and check item description.Example
It such as, is "/elis_smp_eco_dzm/web/financialCircle/ in the API file of extraction
HotPurchaseProductList.visit ", corresponding description field are [finance circle]-[fast-selling list list]-normal stream
Journey-circleType is that fast-selling list is enclosed in 04 financing.
Authentication module 20, for there is authentication script in API file to be tested and when receiving authentication information into
Row permission identifies, to confirm the operating right of user.
In one embodiment, when API file to be tested includes authentication script, according to authentication information to user identity
Carry out authority verification.In the present embodiment, authentication information can be user name, password, fingerprint, facial image information
Deng.
Further authentication information is compared with the identity information in memory for the authentication module 20.
The authentication module 20 further judges to whether there is in the memory to be matched with the authentication information
Identity information.
If it exists, the authentication module 20 further allows to operate API file to be tested.
If it does not exist, the authentication module 20 further pops up dialog box prompt authentication information and is not present, and not
Allow to operate API file to be tested.
Test module 30, for being tested when detecting test instruction API file to be tested and showing test knot
Fruit.
In one embodiment, the API test interface further comprises a testing button and response message field.?
After clicking testing button, the API test interface is shown in running background API file to be tested and in response message field
The test result of API file to be tested.
The test module 30 further running background API file to be tested.
The test module 30 further receives the response data that API file to be tested returns.
The test module 30 further shows response data.
Editor module 40, for editing API file to be tested when detecting edit instruction.
In one embodiment, the API test interface further comprises having API parameter editor's field.According to the volume
Instruction is collected to edit the target component of API file to be tested.The target component may include key-value pair parameter, JSON format
Parameter and scene build parameter etc..In one embodiment, the key-value pair parameter can further comprise parameter name, ginseng
Numerical value and encipherment scheme etc..In one embodiment, when the target component is key-value pair parameter, the edit instruction is used for
Key-value pair parameter is increased newly, is adjusted, is deleted and importing etc. operates in batches.It is correspondingly arranged in API test interface newly-increased
Button, delete button and RAW batch addition button, user is by clicking above-mentioned button to the institute in API file to be tested
State the operations such as key-value pair parameter is increased newly, adjusted, deleted and batch imports.
Correction verification module 50, for being verified when detecting checking command to API file to be tested, and to be tested
When API file verification passes through, then it is assumed that the corresponding function of API file to be tested is qualified.
In one embodiment, the API test interface further comprises having verification button.The checking command passes through use
It clicks verification button and generates in family.The API document memory to be tested contains multiple desired values.The desired value is target ginseng
The intended response data returned after number operation.
The correction verification module 50 further when detecting checking command, grabs the returned data of the target component.
The returned data of crawl is further compared by the correction verification module 50 with the corresponding desired value.
If the returned data of crawl is consistent with the corresponding desired value, the correction verification module 50 is further with pop-up
Form prompt verifies successfully.
If the returned data and the corresponding desired value of crawl are inconsistent, the correction verification module 50 is further with mail
Mode the check results are sent to designated person.
In one embodiment, the checking command also carries out packet loss verification to API file to be tested.
Preserving module 60, for saving API file to be tested when detecting and saving instruction and storing to the memory
Destination address.
In one embodiment, the API file is made of being write by automatic test script language, and can compile
Test and verification operation are carried out after writing complete directly to complete automatic test.
As seen from the above embodiment, user can obtain API file to be tested in API test interface, and to current test API
Operation is edited online, is tested, verified and saved to file, has programming basis without tester, API text can be improved
The design efficiency of part, while also reducing the difficulty of API file edit.
Referring to Fig. 7, it is a kind of computer readable storage medium of the embodiment of the present invention.The computer-readable storage
Computer instruction is stored on medium.The computer instruction can be stored on memory 102, and be worked as by one or more
When managing the execution of device 106, to realize the test file edit methods as described in embodiment of the method above.
The memory 102 is for storing program code.The memory 102 can be in integrated circuit without material object shape
The circuit with store function of formula, such as RAM (Random-Access Memory, random access memory), FIFO (First
In First Out) etc..Alternatively, the memory 102 is also possible to the memory with physical form, such as memory bar, TF card
(Trans-flash Card), smart media card (smart media card), safe digital card (secure digital
Card), the storage facilities such as flash memory cards (flash card).The memory 102 can pass through communication bus 104 and processing
Device 106 carries out data communication.It may include that operating system, network communication module and test file are compiled in the memory 102
Collect program.Operating system is to manage and control the program of interface testing equipment hardware and software resource, supports test file editor
The operation of program and other softwares and/or program.Network communication module for realizing the 102 each component in inside of the memory it
Between communication, and communicated between hardware and softwares other in interface testing equipment.
The processor 106 may include one or more microprocessor, digital processing unit.The processor 106 can
Call the program code stored in the memory 102 to execute relevant function.For example, modules described in Fig. 6 are
The program code being stored in the memory 102, and as performed by the processor 106, to realize that a kind of test file is compiled
The method of collecting.The processor 106 is also known as central processing unit (CPU, Central Processing Unit), is one piece of super large rule
The integrated circuit of mould is arithmetic core (Core) and control core (Control Unit).
The processor 106 is used to execute the multiple computer instructions stored in the memory 102 to realize that test is compiled
Multiple instruction can be performed to perform the steps of in the method for collecting, the processor 106
S11 obtains API file to be tested;
With the development of communication technology, the application function of types of applications software is more and more, is such as installed in machine or computer
On safety bank, safety the financing class software etc. such as easily borrow.Each function is realized by program code, in order to facilitate the dimension of program
It protects, multiple API (Application Programming Interface, application programming interface) text is provided in code
Part, its essence is some functions predetermined for API file, this is arranged for accessing to application program or application developer
The program of API so that application program or application developer are not necessarily to access the source code of program, or understands its internal work mechanism
It can be realized or understand the function of code.
In one embodiment, the test file edit methods are applied in an equipment in interface testing management platform.
The interface testing management platform is used to provide man-machine interactive interface towards tester by customer terminal webpage or Web page, surveys
Examination personnel can be connected on the interface testing management platform by terminal devices such as mobile phone or computers.The interface testing pipe
Platform for writing, storing, Administration API file, while also for tester's verification, editor, integrate existing API file.Tool
Body, the interface testing management platform shows an API test interface, includes that an input field is used in the API test interface
In for user entered keyword.The API test interface can Auto-matching be related in memory according to the keyword in input
API file.
It in one embodiment, include the interface testing script of at least one type in the API file.Each test foot
It originally may include interface name, Application Programming Interface address of service, test mode, test request parameter and verification mode etc..Institute
Stating API file can be the API file obtained out of database, or be created in database according to newly-built instruction
API file.
Specifically, the step S11 for obtaining API file to be tested is specific can include:
S111, when detecting search instruction by the existing API file in the search key and memory that receive
Title is compared;
The search key can be text, such as when user needs to test financing ranking list or finance fast sale list,
Keyword " financing ", " ranking list " etc. can be inputted in the frame retrieval.The search key can also be that automation is surveyed
Specific fields or function in training sheet, naturally it is also possible to be the identifier etc. for identifying test case.
S112 judges in the memory with the presence or absence of the API file to match with the received search key;
S113, and if it exists, grab and show and at least one matched API file of the search key;
S114 selects corresponding API file as API file to be tested when detecting selection instruction;
S115 generates prompt information if it does not exist, to prompt to be not present and the search key in the memory
The API file matched;
S116 establishes new API file as API file to be tested when detecting newly-built instruction.
The API test interface further comprises description field, intuitively to show API file to be tested to user
Function.In one embodiment, the description field may include interface function, interface description, test result and check item description.Example
It such as, is "/elis_smp_eco_dzm/web/financialCircle/ in the API file of extraction
HotPurchaseProductList.visit ", corresponding description field are [finance circle]-[fast-selling list list]-normal stream
Journey-circleType is that fast-selling list is enclosed in 04 financing.
There is authentication script in API file to be tested and carry out permission identification when receiving authentication information in S12,
To confirm the operating right of user.
In one embodiment, when API file to be tested includes authentication script, according to authentication information to user identity
Carry out authority verification.In the present embodiment, authentication information can be user name, password, fingerprint, facial image information
Deng.
Specifically, there is authentication script in API file to be tested and carry out permission mirror when receiving authentication information
Other step S12 can include:
Authentication information is compared S121 with the identity information in memory;
S122 judges to whether there is and the matched identity information of the authentication information in the memory;
S123, and if it exists, then allow to operate API file to be tested;
S124, if it does not exist, pop-up dialog box prompt authentication information are not present, and do not allow to API text to be tested
Part is operated.
S13, API file to be tested is tested when detecting test instruction and shows test result.
In one embodiment, the API test interface further comprises a testing button and response message field.?
After clicking testing button, the API test interface is shown in running background API file to be tested and in response message field
The test result of API file to be tested.
Specifically, the step of API file to be tested being tested and shows test result when detecting test instruction
S13 can include:
S131, when detecting test instruction, running background API file to be tested;
S132 receives the response data that API file to be tested returns;
S133 shows response data.
S14, API file to be tested is edited when detecting edit instruction.
In one embodiment, the API test interface further comprises having API parameter editor's field.According to the volume
Instruction is collected to edit the target component of API file to be tested.The target component may include key-value pair parameter, JSON format
Parameter and scene build parameter etc..In one embodiment, the key-value pair parameter can further comprise parameter name, ginseng
Numerical value and encipherment scheme etc..In one embodiment, when the target component is key-value pair parameter, the edit instruction is used for
Key-value pair parameter is increased newly, is adjusted, is deleted and importing etc. operates in batches.It is correspondingly arranged in API test interface newly-increased
Button, delete button and RAW batch addition button, user is by clicking above-mentioned button to the institute in API file to be tested
State the operations such as key-value pair parameter is increased newly, adjusted, deleted and batch imports.
S15, API file to be tested is verified when detecting checking command.
In one embodiment, the API test interface further comprises having verification button.The checking command passes through use
It clicks verification button and generates in family.The API document memory to be tested contains multiple desired values.The desired value is target ginseng
The intended response data returned after number operation.
It is specifically, described to detect the step S15 that checking command verifies API file to be tested can include:
S151 grabs the returned data of target component when detecting checking command;
The returned data of crawl is compared by S152 with corresponding desired value;
S153, if crawl returned data it is consistent with the corresponding desired value, in the form of a popup window prompt verify at
Function;
S154 is tied verification in a manner of mail if the returned data and the corresponding desired value of crawl are inconsistent
Fruit is sent to designated person.
In one embodiment, the checking command also carries out packet loss verification to API file to be tested.
S16, API file to be tested is saved when detecting and saving instruction and is stored to the destination address of memory.
In one embodiment, the relevant parameter in the API file to be tested increased newly according to user demand, deleted
The operation such as remove, modify to generate new API file, so that user quotes when designing new API file.
In one embodiment, the API file is made of being write by automatic test script language, and can compile
Test and verification operation are carried out after writing complete directly to complete automatic test.
As seen from the above embodiment, user can obtain API file to be tested in API test interface, and to API text to be tested
Operation is edited online, is tested, verified and saved to part, has programming basis without tester, API file can be improved
Design efficiency, while also reducing the difficulty of API file edit.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the module, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple module or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or module,
It can be electrical or other forms.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module
The component shown may or may not be physical module, it can and it is in one place, or may be distributed over multiple
On network module.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
It, can also be in addition, each functional module in various embodiments of the present invention can integrate in a processor
It is that modules physically exist alone, can also be integrated in two or more modules in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.
If the integrated module is realized in the form of software function module and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or
Part steps.
It should also be noted that, herein, term " including ", " including " or its any other variant are intended to non-
It is exclusive to include, so that the process, method, article or the device that include a series of elements not only include those elements,
It but also including other elements that are not explicitly listed, or further include solid by this process, method, article or device
Some elements.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that including
There is also other identical elements in the process, method of the element, article or device.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the range for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (10)
1. a kind of test file edit methods, which is characterized in that the described method includes:
Obtain API file to be tested;
There is authentication script in the API file to be tested and carry out permission identification when receiving authentication information, with true
Recognize the operating right of user;
When detecting test instruction, the API file to be tested is tested and shows test result;
When detecting edit instruction, according to API file to be tested described in the edit instruction and the test result editor;
When detecting checking command, the API file to be tested is verified;
When the API file verification to be tested passes through, then it is assumed that the API file corresponding function test passes to be tested;
When detecting preservation instruction, saves the API file to be tested and simultaneously store to the destination address of memory.
2. test file edit methods as described in claim 1, it is characterised in that: the step for obtaining API file to be tested
Suddenly include:
When detecting search instruction by the title of the existing API file in the search key received and the memory into
Row compares;
Judge in the memory with the presence or absence of the API file to match with the received search key;
If it exists, it grabs and shows and at least one matched API file of the search key;
Select corresponding API file as the API file to be tested when detecting selection instruction;
If it does not exist, prompt information is generated, there is no literary with the matched API of the search key to prompt in the memory
Part;
New API file is established as the API file to be tested when detecting newly-built instruction.
3. test file edit methods as described in claim 1, it is characterised in that: described in the API file to be tested
The step of progress permission identification, includes: when in the presence of authentication script and receiving authentication information
The authentication information is compared with the identity information in memory;
Judge in the memory with the presence or absence of the identity information to match with the identity information;
If it exists, then allow to operate the API file to be tested;
If it does not exist, pop-up dialog box prompt authentication information is not present, and does not allow to carry out the API file to be tested
Operation.
4. test file edit methods as described in claim 1, it is characterised in that: it is described when detect test instruction when to institute
API file to be tested is stated to be tested and include: the step of showing test result
When detecting test instruction, API file to be tested described in running background;
The response data of the API file return to be tested is received as test result;
Show the response data.
5. test file edit methods as described in claim 1, it is characterised in that: it is described when detecting checking command to institute
Stating the step of API file to be tested is verified includes:
When detecting checking command, the returned data of target component is grabbed;
The returned data of crawl is compared with corresponding desired value;The API document memory to be tested contains multiple
Desired value;The desired value is the expection returned data returned after the target component is run;
If the returned data of the crawl is consistent with the corresponding desired value, in the form of a popup window prompt verification at
Function;
If the returned data of the crawl and the corresponding desired value are inconsistent, by check results in a manner of mail
It is sent to designated person.
6. test file edit methods as described in claim 1, it is characterised in that: according to the edit instruction to described to be measured
The target component of examination API file is edited;The target component may include key-value pair parameter, JSON format parameter and scene
Constructing variable;When the target component is key-value pair parameter, it is used to carry out key-value pair parameter according to the edit instruction new
Increasing, adjustment, deletion and batch import operation.
7. test file edit methods as described in claim 1, it is characterised in that: according to user demand to described to be tested
Relevant parameter in API file the operation newly such as is increased, is deleted, being modified to generate new API file.
8. a kind of test file editing device, which is characterized in that the test file editing device includes:
Module is obtained, for obtaining API file to be tested;
Authentication module, for there is authentication script and the when progress that receives authentication information in the API file to be tested
Permission identifies, to confirm the operating right of user;
Test module, for being tested when detecting test instruction the API file to be tested and showing test result;
Editor module, for editing the API file to be tested when detecting edit instruction;
Correction verification module, for being verified when detecting checking command to the API file to be tested;Described to be tested
When API file verification passes through, then it is assumed that the API file corresponding function test passes to be tested;
Preserving module, for saving the API file to be tested when detecting and saving instruction and storing to the target of memory
Address.
9. a kind of equipment, which is characterized in that the equipment includes processor and memory, and the processor is for executing described deposit
The test file edit methods as described in any one of claim 1 to 6 are realized when the computer program stored in reservoir.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has at least one
Instruction, at least one described instruction realize the test file editor as described in any one of claims 1 to 5 when being executed by processor
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811180735.1A CN109582560A (en) | 2018-10-09 | 2018-10-09 | Test file edit methods, device, equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811180735.1A CN109582560A (en) | 2018-10-09 | 2018-10-09 | Test file edit methods, device, equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109582560A true CN109582560A (en) | 2019-04-05 |
Family
ID=65920384
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811180735.1A Pending CN109582560A (en) | 2018-10-09 | 2018-10-09 | Test file edit methods, device, equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109582560A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110347604A (en) * | 2019-07-11 | 2019-10-18 | 中国工商银行股份有限公司 | Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing |
CN114611473A (en) * | 2022-05-11 | 2022-06-10 | 希维科技(广州)有限公司 | Generation method of inspection execution file and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130262934A1 (en) * | 2012-03-27 | 2013-10-03 | Ge Medical Systems Global Technology Company, Llc | Method and apparatus for automatically generating a test script for a graphical user interface |
CN105159833A (en) * | 2015-09-30 | 2015-12-16 | 努比亚技术有限公司 | Automatic testing device and method |
CN107729243A (en) * | 2017-10-12 | 2018-02-23 | 上海携程金融信息服务有限公司 | API automated testing method, system, equipment and storage medium |
CN108241576A (en) * | 2016-12-26 | 2018-07-03 | 航天信息股份有限公司 | A kind of interface test method and system |
-
2018
- 2018-10-09 CN CN201811180735.1A patent/CN109582560A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130262934A1 (en) * | 2012-03-27 | 2013-10-03 | Ge Medical Systems Global Technology Company, Llc | Method and apparatus for automatically generating a test script for a graphical user interface |
CN105159833A (en) * | 2015-09-30 | 2015-12-16 | 努比亚技术有限公司 | Automatic testing device and method |
CN108241576A (en) * | 2016-12-26 | 2018-07-03 | 航天信息股份有限公司 | A kind of interface test method and system |
CN107729243A (en) * | 2017-10-12 | 2018-02-23 | 上海携程金融信息服务有限公司 | API automated testing method, system, equipment and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110347604A (en) * | 2019-07-11 | 2019-10-18 | 中国工商银行股份有限公司 | Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing |
CN114611473A (en) * | 2022-05-11 | 2022-06-10 | 希维科技(广州)有限公司 | Generation method of inspection execution file and electronic equipment |
CN114611473B (en) * | 2022-05-11 | 2022-08-12 | 希维科技(广州)有限公司 | Generation method of inspection execution file and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10296443B2 (en) | Automatically predicting faults that caused software failures using a Markov logic network | |
CN105940654B (en) | Franchise static web application in trust | |
CN105283849B (en) | For the Parallel Tracking of performance and details | |
CN110096429A (en) | Test report generation method, device, equipment and storage medium | |
CN107608874A (en) | Method of testing and device | |
CN105122230A (en) | Tracing as a service | |
CN110109817A (en) | Automatic interface testing method, device, equipment and storage medium | |
CN110474900B (en) | Game protocol testing method and device | |
CN104753909A (en) | Updated information authentication method, device and system | |
CN107729249A (en) | Browser compatibility method of testing, device, system and electronic equipment | |
CN113392303A (en) | Background blasting method, device, equipment and computer readable storage medium | |
CN107103490B (en) | Data processing method, network server and terminal | |
CN109582560A (en) | Test file edit methods, device, equipment and computer readable storage medium | |
JP2021519960A (en) | Systems, devices, and methods for processing and managing web traffic data | |
CN111538659A (en) | Interface testing method and system for service scene, electronic device and storage medium | |
CN106844214A (en) | A kind of automatic method and device that sectional drawing is carried out to page rendering | |
CN112395182A (en) | Automatic testing method, device, equipment and computer readable storage medium | |
CN107430590B (en) | System and method for data comparison | |
CN107735785A (en) | Automated information retrieval | |
CN113569162A (en) | Data processing method, device, equipment and storage medium | |
CN112600936A (en) | Quantification and evaluation method for cloud computing system service | |
Segura et al. | Automated variability analysis and testing of an E-commerce site. an experience report | |
CN115348117B (en) | User level unauthorized behavior determination method and device | |
CN108369590A (en) | For commending system, the devices and methods therefor for instructing Self-Service to analyze | |
CN110389897A (en) | SDK logic test method, device, storage medium and server |
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 |