CN108334449A - A kind of method and apparatus of interface automatic test - Google Patents

A kind of method and apparatus of interface automatic test Download PDF

Info

Publication number
CN108334449A
CN108334449A CN201810076537.4A CN201810076537A CN108334449A CN 108334449 A CN108334449 A CN 108334449A CN 201810076537 A CN201810076537 A CN 201810076537A CN 108334449 A CN108334449 A CN 108334449A
Authority
CN
China
Prior art keywords
test
interface
assignment
configuration information
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810076537.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.)
Beijing Jingdong Financial Technology Holding Co Ltd
Original Assignee
Beijing Jingdong Financial Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Financial Technology Holding Co Ltd filed Critical Beijing Jingdong Financial Technology Holding Co Ltd
Priority to CN201810076537.4A priority Critical patent/CN108334449A/en
Publication of CN108334449A publication Critical patent/CN108334449A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

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

Abstract

The invention discloses a kind of method and apparatus of interface automatic test, are related to field of computer technology.One specific implementation mode of this method includes:Interface testing framework and continuous integrating tool are built in test environment;By continuous integrating instrument creation test assignment, and configure the configuration information of the test assignment;Based on the configuration information of the test assignment, by running the test assignment, to call test class, with implementation of test cases, to obtain test result.The embodiment can solve the problems, such as to cannot achieve constantly automatic test.

Description

A kind of method and apparatus of interface automatic test
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus of interface automatic test.
Background technology
In software test procedure, especially in Internet technology, very short, the version from demand project verification to version on-line time Iteration it is very fast, to ensure that upper line mass, tester need to do the regression test of a large amount of repeatability.And these return and survey In examination, interface class accounts for major part.In testing field, interface testing belongs to a comparatively laborious class testing again, because unbounded Face needs to remove calling interface manually, and comparison result is relatively low so as to cause testing efficiency, and the testing time is longer.
In realizing process of the present invention, inventor has found that at least there are the following problems in the prior art:Utilize FitNesse (software test framework) carries out automatic test, is only to realize automation, cannot achieve continuous integrating, i.e., calls every time all It needs to open the FitNesse pages, automation can just be executed by clicking the testing button of the page manually;And test result is only protected There are in the xml document of Fitnesse, data format and content are relatively more fixed and single.
Invention content
In view of this, the embodiment of the present invention provides a kind of method and apparatus of interface automatic test, can solve can not The problem of realizing constantly automatic test.
To achieve the above object, one side according to the ... of the embodiment of the present invention provides a kind of interface automatic test Method, including:
Interface testing framework and continuous integrating tool are built in test environment;
By continuous integrating instrument creation test assignment, and configure the configuration information of the test assignment;
Carry out calling interface test class, by running the test assignment to hold based on the configuration information of the test assignment Row test case, to obtain test result.
In some embodiments of the invention, the configuration information includes:It is deployed with the IP of the host of interface testing framework Address and port numbers are tested interface message, the execution time of test assignment;And/or the interface testing framework is selected from FitNesse;And/or the continuous integrating tool is selected from Jenkins.
In some embodiments of the invention, the configuration information based on the test assignment is appointed by running the test Business, carrys out calling interface test class, with implementation of test cases, to obtain test result, including:
Based on the configuration information of the test assignment, when reaching the execution time of the test assignment, continuous integrating work Test assignment described in the trigger automatic running of tool, to trigger the analytics engine of interface testing framework so that analytics engine calls Interface testing class, and test case is parsed, to obtain test result.
In some embodiments of the invention, the method further includes:
By the parsing of interface testing class, packaging and testing as a result, by the test result storage after parsing, encapsulation to database In, and test result is fed back into the results page in the results page and continuous integrating tool of interface testing framework;
Wherein, it includes following field to store to the test result in database:Tested interface message, the ID of test case, The title of test case, the number of test case, test case, it is contemplated that test result, actual test result, test assignment The execution time, the success rate of test case, test case executes sum, the test case quantity of failure.
In some embodiments of the invention, the configuration information includes:The email address of responsible person;
The method further includes:According to the email address in the configuration information, the test is tied by mail he Fruit is sent to the email address.
In addition, other side according to the ... of the embodiment of the present invention, provides a kind of device of interface automatic test, packet It includes:
Module is built, for building interface testing framework and continuous integrating tool in test environment;
Creation module, for by continuous integrating instrument creation test assignment, and configure the test assignment matches confidence Breath;
Test module is used for the configuration information based on the test assignment, by running the test assignment, is connect to call Mouth test class, with implementation of test cases, to obtain test result.
In some embodiments of the invention, the configuration information includes:It is deployed with the IP of the host of interface testing framework Address and port numbers are tested interface message, the execution time of test assignment;And/or the interface testing framework is selected from FitNesse;And/or the continuous integrating tool is selected from Jenkins.
In some embodiments of the invention, the test module is used for:
Based on the configuration information of the test assignment, when reaching the execution time of the test assignment, continuous integrating work Test assignment described in the trigger automatic running of tool, to trigger the analytics engine of interface testing framework so that analytics engine calls Interface testing class, and test case is parsed, to obtain test result.
In some embodiments of the invention, described device further includes:
Feedback module, for passing through the parsing of interface testing class, packaging and testing as a result, will parse, the test result after encapsulation It stores in database, and test result is fed back into the result page in the results page and continuous integrating tool of interface testing framework Face;
Wherein, it includes following field to store to the test result in database:Tested interface message, the ID of test case, The title of test case, the number of test case, test case, it is contemplated that test result, actual test result, test assignment The execution time, the success rate of test case, test case executes sum, the test case quantity of failure.
In some embodiments of the invention, the configuration information includes:The email address of responsible person;
Described device further includes:
Sending module, for according to the email address in the configuration information, by mail he by the test result It is sent to the email address.
Other side according to the ... of the embodiment of the present invention additionally provides a kind of electronic equipment, including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processing Device realizes the method described in any of the above-described embodiment.
Other side according to the ... of the embodiment of the present invention additionally provides a kind of computer-readable medium, is stored thereon with meter Calculation machine program, realizes the method described in any of the above-described embodiment when described program is executed by processor.
One embodiment in foregoing invention has the following advantages that or advantageous effect:Because using continuous integrating tool is passed through Test assignment is created, and configures the technological means of the configuration information of the test assignment, cannot achieve constantly so overcoming The technical issues of automatic test, the present invention are can be continued using continuous integrating tool, automatically trigger the spy of test assignment Point, and interface testing framework is combined, Wiki language editor's test cases can be used using interface testing framework, use analytics engine Test case is parsed, calls the operation principle of test class, therefore interface testing framework is deployed in continuous integrating tool so that hold Continuous integration tool executes corresponding test assignment according to configuration information automatically, and test result is stored into database, and Send mail to related personnel.
Further effect possessed by above-mentioned non-usual optional mode adds hereinafter in conjunction with specific implementation mode With explanation.
Description of the drawings
Attached drawing does not constitute inappropriate limitation of the present invention for more fully understanding the present invention.Wherein:
Fig. 1 is the schematic diagram of the main flow of the method for interface automatic test according to the ... of the embodiment of the present invention;
Fig. 2 is the signal according to the main flow of the method for an interface automatic test that can refer to embodiment of the invention Figure;
Fig. 3 is the schematic diagram of the main modular of the device of interface automatic test according to the ... of the embodiment of the present invention;
Fig. 4 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 5 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific implementation mode
It explains to the exemplary embodiment of the present invention below in conjunction with attached drawing, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together The description to known function and structure is omitted for clarity and conciseness in sample in following description.
Fig. 1 is the schematic diagram of the main flow of the method for interface automatic test according to the ... of the embodiment of the present invention.Such as Fig. 1 institutes Show, as an embodiment of the present invention, the method for the interface automatic test may include:
Step 101, interface testing framework and continuous integrating tool are built in test environment.
Optionally, the interface testing framework can be FitNesse, and FitNesse is the Open Framework of a lightweight, It can help to develop and test team easily defining interface Acceptance Test (Acceptance Tests), by web page The table of upper simple output and anticipated output is it is achieved that and can run these tests to determine whether to pass through. FitNesse supports the test, including java, c, c++, python, php etc. of multilingual software product.FitNesse is generally wrapped Wiki Server, Test System, System Under Test and Reporting are included, wherein Wiki Server are for compiling Test case is write, Test System are transmitted to SUT to execute for parsing test case, and System Under Test are referred to as SUT, for executing use-case, Reporting is mainly responsible for record implementing result.
Optionally, the continuous integrating tool can be Jenkins, and Jenkins is an open source software project, is to be based on A kind of continuous integrating tool of Java exploitations, for monitoring the work for continuing to repeat, it is desirable to provide the easy-to-use software of opening Platform makes the continuous integrating of software become possible.
Specifically, another embodiment as the present invention, first disposes test environment, including test client Environment is disposed and the deployment at testing service end, and corresponding software, environmental variance setting can be installed according to test document;Then exist FitNesse and Jenkins are built in test environment, to install FitNesse plug-in units on Jenkins.
As another embodiment of the present invention, after step 101, further include:Interface testing is write using Java language Class, the Wiki linguistic norms using FitNesse write test data as test case.Specifically, it is write using Java language Interface testing class and upload server, interface testing class include:Get methods, the set methods of attribute, the result returned the result Method judges the resultShow methods of test case success or failure, processing test result.Wherein, get methods, the side set Method is used to obtain, transmit the interface parameters of test case, and result methods return String types realize interface logic, ResultShow methods carry out judgement processing to test results such as the return status informations of tested interface, and are surveyed to FitNesse The xml document that test result generates carries out personalized modification.
Step 102, by continuous integrating instrument creation test assignment, and the configuration information of the test assignment is configured.
As another embodiment of the present invention, a test assignment based on FitNesse is created on Jenkins, it can To be named as FitNesse Test.Then, related setting is carried out to the test assignment on Jenkins.The test assignment Configuration information includes:It is deployed with the IP address and port numbers of the host of interface testing framework, is tested interface message, test assignment Execute the time.Optionally, the configuration information can also include:The filename and file type of test result.
Specifically, in the configuration page of the test assignment, " Execute is selected in " structure "-" increasing structure " Then FitNesse tests " options select " FitNesse instance isalready running " option, then fill out It is as follows to enter every terms of information:
Input is deployed with the IP address of the host of FitNesse in " FitNesse Host ";
Input is deployed with the port numbers of the host of FitNesse in " FitNesse Port ";
Input is tested interface message in " Target Page ";
Result.xml is inputted in " Path to FitNesse xml results file ".
It should be pointed out that result.xml is a filename, it is the text for storing FitNesse automatic test results Part, Jenkins can find this document according to this filename in FitNesse, to be opened up in the results page of Jenkins Show test result.
Further, " Build periodically " is selected in " structure trigger ", being inputted in " schedule " needs Execute the time of test assignment.
The postal of input relevant person in charge in " Recipients " in " E-mail Notification " is operated after structure Case address.
Step 103, the configuration information based on the test assignment carrys out calling interface survey by running the test assignment Class is tried, with implementation of test cases, to obtain test result.
Due to being configured with the execution time of test assignment, when the execution time of time is up test assignment, continuous integrating The trigger of tool executes the test assignment automatically, and to trigger the analytics engine inside interface testing, analytics engine, which calls, to be surveyed Class is tried, and parses test case, to test the interface of system under test (SUT).Wherein, the analytics engine can be Slim (Simple List Invocation method, simple list call method) engine, Slim engines parsing test case, and calling interface Test class, test case of the interface testing class to be parsed by Slim engines carry out service logic as interface parameters Judge.
In an embodiment of the present invention, implementing result is returned by the method for String types, expection is returned the result It is compared with actually returning the result, verification returns the result whether meet expection.Specifically, after test case executes, In the results page of interface testing framework, whether comparison expected results are consistent with test result, if it is inconsistent, being surveyed to this Test result mark is red, is defined as failure, and implementing result records a miss data;If consistent, execution passes through, and executes knot Fruit records a successful data.Correspondingly, test result can also feed back the results page in continuous integrating tool.
The embodiment of the present invention utilizes continuous integrating tool continuous integrating interface automatic test, it is issued in each version Before, using automatic test program, automatic test is carried out to each interface, it, can be with deployment train, if lost if passed through It loses, then retracts.
It is tested that certain operation system has multiple interfaces to need, and service logic judgement is carried out to the parameter of input by test class, Then corresponding output result is provided.The present invention writes test case as input parameter using using FitNesse, writes survey Examination class carries out judging whether to meet service logic to the output of the interface.Moreover, the present invention utilizes the spy of Jenkins continuous integratings The FitNesse automatic tests are deployed as a test assignment by point, using Jenkins trigger it is preset some when Quarter executes test automatically.The present invention utilizes FitNesse, under the premise of test category code is immovable, only changes test data, The test that different scenes can be covered, has accomplished code reuse.By disposing FitNesse on Jenkins, can allow automatic Change test continuous integrating.
Optionally, the method for the interface automatic test further includes:Test class parsing encapsulates the test result, and It will be in the test result storage to database after parsing, encapsulation.
After the completion of interface testing framework test execution, test class parsing encapsulates the test result, and will parsing, envelope In test result storage to database after dress.For example, the transformation again that the test result data of FitNesse itself is carried out, Some key messages are written in database, all personnel can be checked by connecting the test platform of the database in project The project regression test situation.
As the present invention, there are one embodiments, and interface testing class parses the test result, and test result is obtained Detail list encapsulation after storage in database.Specifically, interface testing class parsexml is used for parsing the test result, Middle getFileNameUrl is used for obtaining destination file execution route, and getFileName obtains destination file title, getRate Page test case number and statistics correct number, failure quantity are obtained, the content in the xml of getXmlContent modifications obtains It takes.After the detail list encapsulation realized and be put in storage using spring+mybastis, and test result is obtained in storage to database.
After the completion of interface testing framework test execution, the parsing of interface testing class encapsulates the test result, and will solution In test result storage to database after analysis, encapsulation.Wherein, the test result after the encapsulation may include following field: Tested interface message, the ID of test case, the title of test case, the number of test case, test case, it is contemplated that test knot Fruit, actual test result, the execution time of test assignment, the success rate of test case, test case execute sum, failure Test case quantity.
It should be pointed out that being generated when the ID of test case is executed every time, a test case may execute repeatedly, Therefore a test case likely corresponds to the ID of multiple test cases.
It is alternatively possible to test result be encapsulated as to detail list and result table respectively, then by detail list and result table point It does not store in database.
Detail list qw_atp_detail (
`testobject`varchar (255) NOT NULL COMMENT' measurands ',
`runid`varchar (50) NOT NULL COMMENT' execute id',
`casename`varchar (255) NOT NULL COMMENT'case titles ',
`inputparam`varchar (255) NOT NULL COMMENT' input parameters ',
`outputparam`varchar (1000) NOT NULL COMMENT' output parameters (output result explanation) ',
`result`varchar (255) NOT NULL COMMENT' implementing results ',
`caseid`varchar (50) NOT NULL COMMENT'case numbers ',
The `runtime`datetime DEFAULT NULL COMMENT' execution times '),
As a result table qw_atp_result (
`projectname`varchar (255) NOT NULL COMMENT' project names ',
`successrate`varchar (10) NOT NULL COMMENT' success rates ',
Detailurl`varchar (255) DEFAULT NULL COMMENT' details redirected link ',
The `runtime`datetime NOT NULL COMMENT' execution times ',
`projectid`varchar (50) NOT NULL COMMENT' project id',
`runid`varchar (50) NOT NULL COMMENT' execute id',
`totalcase`varchar (10) DEFAULT NULL COMMENT' execution use-cases sum ',
`failcase`varchar (10) DEFAULT NULL COMMENT' unsuccessfully use number of cases '.
Corresponding test result also can be sent mail to the system under test (SUT) by Jenkins testing tools according to configuration information Responsible person.Therefore, the embodiment of the present invention can execute interface automated procedures automatically using Jenkins, monitor this daily and connect Mouthful executive condition, if the automatic test of interface not over, can send out mail out remind corresponding personnel.
According to various embodiments recited above, it can be seen that the present invention creates test times by using by continuous integrating Business, and the technological means of the configuration information of the test assignment is configured, it cannot achieve constantly automatic test to solve The problem of.That is, in the prior art, calling FitNesse interface testing frameworks that unlatching FitNesse is required for connect every time Mouth test page, automation can just be executed by clicking the testing button of the page manually.And the present invention is by continuous integrating tool Test assignment is created, and configures the configuration information of the test assignment, the configuration information of the test assignment is then based on, passes through The test assignment is run, calling interface test class is carried out, with implementation of test cases, to obtain test result.Therefore, of the invention The method that embodiment provides can be continued using Jenkins, automatically trigger the characteristics of test assignment, and combine FitNesse, Wiki language editor's test cases can be used using Fitness frames, test case is parsed using Slim engines, calls test class Operation principle, therefore FitNesse is deployed on Jenkins so that Jenkins is executed accordingly automatically according to configuration information Test assignment, and by test result storage in database, and send mail to related personnel.
Method provided in an embodiment of the present invention executes automatic test using interface testing framework, eliminates in manual testing Human error, and saved manual testing input time and manpower, greatly saved human cost.
Fig. 2 is the signal according to the main flow of the method for an interface automatic test that can refer to embodiment of the invention Figure.As another embodiment of the present invention, the method for the interface automatic test may include:
FitNesse and Jenkins are built in test environment;
Test assignment is created by Jenkins, and configures the configuration information of the test assignment, the configuration information packet It includes:It is deployed with the IP address and port numbers of the host of FitNesse, is tested interface message, the execution time of test assignment is responsible for The email address of people;
Based on the configuration information of the test assignment, when reaching the execution time of the test assignment, Jenkins's touches Hair device executes the test assignment automatically, to trigger the Slim engines of FitNesse so that Slim engine calling interface testing classes, And test case is parsed, to obtain test result;
Test result is fed back in the results page of FitNesse and the results page of Jenkins;
By the parsing of interface testing class, packaging and testing as a result, by the test result storage after parsing, encapsulation to database In;
According to the email address in the configuration information, by mail he by the test result with being sent to the mailbox Location.
Method provided in an embodiment of the present invention utilizes FitNesse, and automatic test is realized to the interface of operation system, and In conjunction with the continuous integrating feature of Jenkins, automatic deployment and structure automatic test, and utilize the spy of FitNesse itself Point, it is only necessary to maintenance test data, without spending a lot of time maintenance test script, when reducing the input of test script Between, to achieve the effect that get twice the result with half the effort.The present invention is saved greatly the communication cost because between exploitation and test, entirely Face automatic deployment program has saved time cost for the internet works software of iteration speed quickly.
It should be pointed out that in the specific of one method that can refer to interface automatic test described in embodiment of the present invention Implementation content has been described in detail in the method for interface automatic test described above, therefore has not been said again in this duplicate contents It is bright.
Fig. 3 is the device of interface automatic test according to the ... of the embodiment of the present invention, as shown in figure 3, the interface automates The device 300 of test includes building module 301, creation module 302 and test module 303, builds module 301 wherein described and is used for Interface testing framework and continuous integrating tool are built in test environment;The creation module 302 is used to pass through continuous integrating work Tool creates test assignment, and configures the configuration information of the test assignment;The test module 303 is used to appoint based on the test The configuration information of business carrys out calling interface test class, with implementation of test cases, to be surveyed by running the test assignment Test result.
Optionally, the interface testing framework can be FitNesse, and optionally, the continuous integrating tool can be Jenkins.Specifically, another embodiment as the present invention, the module 301 of building first dispose test environment, Environment deployment including test client and the deployment at testing service end can install corresponding software, ring according to test document Border variable setting;Then FitNesse and Jenkins are built in test environment, to install FitNesse on Jenkins Plug-in unit.
As another embodiment of the present invention, creation module 302 creates one on Jenkins and is based on interface testing frame The test assignment of frame can be named as FitNesse Test.Then, correlation is carried out to the test assignment on Jenkins to set It sets.The configuration information of the test assignment includes:It is deployed with the IP address and port numbers of the host of interface testing framework, it is tested to connect Message ceases, the execution time of test assignment.Optionally, the configuration information can also include:The filename and text of test result Part type.
Specifically, in the configuration page of the test assignment, " Execute is selected in " structure "-" increasing structure " Then FitNesse tests " options select " FitNesse instance isalready running " option, then fill out It is as follows to enter every terms of information:
Input is deployed with the IP address of the host of FitNesse in " FitNesse Host ";
Input is deployed with the port numbers of the host of FitNesse in " FitNesse Port ";
Input is tested interface message in " Target Page ";
Result.xml is inputted in " Path to FitNesse xml results file ".
It should be pointed out that result.xml is a filename, it is the text for storing FitNesse automatic test results Part, Jenkins can find this document according to this filename in FitNesse, to be opened up in the results page of Jenkins Show test result.
Further, " Build periodically " is selected in " structure trigger ", being inputted in " schedule " needs Execute the time of test assignment.
As yet another embodiment of the present invention, the test module 303 based on the test assignment for matching confidence Breath, when reaching the execution time of the test assignment, test assignment described in the trigger automatic running of continuous integrating tool, with Trigger the analytics engine of interface testing framework so that analytics engine calling interface test class, and test case is parsed, to obtain Test result.
In an embodiment of the present invention, implementing result is returned by the method for String types, expection is returned the result It is compared with actually returning the result, verification returns the result whether meet expection.Specifically, after test case executes, In the results page of interface testing framework, whether comparison expected results are consistent with test result, if it is inconsistent, being surveyed to this Test result mark is red, is defined as failure, and implementing result records a miss data;If consistent, execution passes through, and executes knot Fruit records a successful data.Correspondingly, test result can also feed back the results page in continuous integrating tool.
Optionally, described device further includes feedback module, and the feedback module is used for through the parsing of interface testing class, encapsulation Test result after parsing, encapsulation is stored into database, and test result is fed back in interface testing framework by test result Results page and continuous integrating testing tool results page;Wherein, it includes following to store to the test result in database Field:Tested interface message, the ID of test case, the title of test case, the number of test case, test case, it is contemplated that Test result, actual test result, the execution time of test assignment, the execution of the success rate of test case, test case is total Number, the test case quantity of failure.
Specifically, interface testing class parsexml is used for parsing the test result, and wherein getFileNameUrl is used for Destination file execution route is obtained, getFileName obtains destination file title, and getRate obtains page test case number And count correct number, failure quantity, the content obtaining in the xml of getXmlContent modifications.Use spring+ Mybastis realizes storage, and after the detail list encapsulation that test result is obtained in storage to database.
The configuration information includes:The email address of responsible person.Specifically, " E-mail is operated after structure The email address of input relevant person in charge in " Recipients " in Notification ".Optionally described device further includes Sending module, the sending module are used for according to the email address in the configuration information, by mail he by the test As a result it is sent to the email address.
According to various embodiments recited above, it can be seen that the present invention is surveyed by using by continuous integrating instrument creation Trial is engaged in, and configures the technological means of the configuration information of the test assignment, is constantly automated to solve cannot achieve The problem of test.That is, in the prior art, calling FitNesse interface testing frameworks to be required for opening every time The FitNesse interface testing pages, automation can just be executed by clicking the testing button of the page manually.And the present invention is by holding Sequel configures the configuration information of the test assignment at instrument creation test assignment, is then based on matching for the test assignment Confidence ceases, and by running the test assignment, carrys out calling interface test class, with implementation of test cases, to obtain test result. Therefore, method provided in an embodiment of the present invention can be continued using Jenkins, automatically trigger the characteristics of test assignment, and be tied FitNesse is closed, Wiki language editor's test cases can be used using Fitness frames, parsing test using Slim engines uses Example, calls the operation principle of test class, therefore FitNesse is deployed on Jenkins so that Jenkins is according to configuration information Automatically corresponding test assignment is executed, and test result is stored into database, and sends mail to related personnel.
It should be noted that the specific implementation content of the device in interface automatic test of the present invention, in institute above It states and has been described in detail in the method for interface automatic test, therefore no longer illustrate in this duplicate contents.
Fig. 4 shows the dress of the method or interface automatic test that can apply interface automatic test of the embodiment of the present invention The exemplary system architecture 400 set.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405. Network 404 between terminal device 401,402,403 and server 405 provide communication link medium.Network 404 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be interacted by network 404 with server 405 with using terminal equipment 401,402,403, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart mobile phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user The shopping class website browsed provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to receiving To the data such as information query request analyze etc. processing, and (such as target push information, product are believed by handling result Breath --- merely illustrative) feed back to terminal device.
It should be noted that the method for the interface automatic test that the embodiment of the present invention is provided is generally by server 405 It executes, correspondingly, the device of the interface automatic test is generally located in server 405.
It should be understood that the number of the terminal device, network and server in Fig. 4 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 5, it illustrates the computer systems 500 suitable for the terminal device for realizing the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 5 is only an example, to the function of the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various actions appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
It is connected to I/O interfaces 505 with lower component:Importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loud speaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also according to needing to be connected to I/O interfaces 505.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on driver 510, as needed in order to be read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, it according to embodiment disclosed by the invention, may be implemented as counting above with reference to the process of flow chart description Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart. In such embodiment, which can be downloaded and installed by communications portion 509 from network, and/or from can Medium 511 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 501, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two arbitrarily combines.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or arbitrary above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more conducting wires, just It takes formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type and may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, can be any include computer readable storage medium or storage journey The tangible medium of sequence, the program can be commanded the either device use or in connection of execution system, device.And at this In invention, computer-readable signal media may include in a base band or as the data-signal that a carrier wave part is propagated, Wherein carry computer-readable program code.Diversified forms may be used in the data-signal of this propagation, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By instruction execution system, device either device use or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to:Wirelessly, electric wire, optical cable, RF etc. or above-mentioned Any appropriate combination.
Flow chart in attached drawing and block diagram, it is illustrated that according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part for a part for one module, program segment, or code of table, above-mentioned module, program segment, or code includes one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depended on the functions involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module can also be arranged in the processor, for example, can be described as:A kind of processor packet It includes and builds module, creation module and test module, wherein the title of these modules is not constituted under certain conditions to the module The restriction of itself.
As on the other hand, the present invention also provides a kind of computer-readable medium, which can be Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes:Interface testing framework and continuous integrating tool are built in test environment;Pass through continuous integrating instrument creation Test assignment, and configure the configuration information of the test assignment;Based on the configuration information of the test assignment, described in operation Test assignment carrys out calling interface test class, with implementation of test cases, to obtain test result.
Technical solution according to the ... of the embodiment of the present invention, because using by continuous integrating instrument creation test assignment, and match The technological means of the configuration information of the test assignment is set, is asked so overcoming and cannot achieve the technology of constantly automatic test Topic, the present invention are can be continued using continuous integrating tool, automatically trigger the characteristics of test assignment, and combining interface testing frame Frame can use Wiki language editor's test cases using interface testing framework, parse test case using analytics engine, call and survey The operation principle of class is tried, therefore interface testing framework is deployed in continuous integrating tool so that continuous integrating tool is according to configuration Information executes corresponding test assignment automatically, and test result is stored into database, and sends mail to related personnel.
Above-mentioned specific implementation mode, does not constitute limiting the scope of the invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and replacement can occur.It is any Modifications, equivalent substitutions and improvements made by within the spirit and principles in the present invention etc., should be included in the scope of the present invention Within.

Claims (12)

1. a kind of method of interface automatic test, which is characterized in that including:
Interface testing framework and continuous integrating tool are built in test environment;
By continuous integrating instrument creation test assignment, and configure the configuration information of the test assignment;
Carry out calling interface test class, by running the test assignment to execute survey based on the configuration information of the test assignment Example on probation, to obtain test result.
2. according to the method described in claim 1, it is characterized in that, the configuration information includes:It is deployed with interface testing framework Host IP address and port numbers, be tested interface message, the execution time of test assignment;And/or the interface testing framework Selected from FitNesse;And/or the continuous integrating tool is selected from Jenkins.
3. method according to claim 1 or 2, which is characterized in that the configuration information based on the test assignment passes through fortune The row test assignment, carrys out calling interface test class, with implementation of test cases, to obtain test result, including:
Based on the configuration information of the test assignment, when reaching the execution time of the test assignment, continuous integrating tests work Test assignment described in the trigger automatic running of tool, to trigger the analytics engine of interface testing framework so that analytics engine calls Interface testing class, and test case is parsed, to obtain test result.
4. according to the method described in claim 1, it is characterized in that, further including:
By the parsing of interface testing class, packaging and testing as a result, by the test result storage to database after parsing, encapsulation, and Test result is fed back into the results page in the results page and continuous integrating tool of interface testing framework;
Wherein, it includes following field to store to the test result in database:Tested interface message, the ID of test case, test The title of use-case, the number of test case, test case, it is contemplated that test result, actual test result, test assignment holds Row time, the success rate of test case, test case execute sum, the test case quantity of failure.
5. according to the method described in any one of claim 1-4, which is characterized in that the configuration information includes:Responsible person Email address;
The method further includes:According to the email address in the configuration information, the test result is sent out by mail he It send to the email address.
6. a kind of device of interface automatic test, which is characterized in that including:
Module is built, for building interface testing framework and persistently collection trial work tool in test environment;
Creation module for passing through continuous integrating instrument creation test assignment, and configures the configuration information of the test assignment;
Test module is used for the configuration information based on the test assignment, by running the test assignment, carrys out calling interface survey Class is tried, with implementation of test cases, to obtain test result.
7. device according to claim 6, which is characterized in that the configuration information includes:It is deployed with interface testing framework Host IP address and port numbers, be tested interface message, the execution time of test assignment;And/or the interface testing framework Selected from FitNesse;And/or the continuous integrating tool is selected from Jenkins.
8. the device described according to claim 6 or 7, which is characterized in that the test module is used for:
Based on the configuration information of the test assignment, when reaching the execution time of the test assignment, continuous integrating tool Test assignment described in trigger automatic running, to trigger the analytics engine of interface testing framework so that analytics engine calling interface Test class, and test case is parsed, to obtain test result.
9. device according to claim 6, which is characterized in that further include:
Feedback module, for passing through the parsing of interface testing class, packaging and testing as a result, will parse, the test result after encapsulation stores The results page in the results page and continuous integrating tool of interface testing framework is fed back into database, and by test result;
Wherein, it includes following field to store to the test result in database:Tested interface message, the ID of test case, test The title of use-case, the number of test case, test case, it is contemplated that test result, actual test result, test assignment holds Row time, the success rate of test case, test case execute sum, the test case quantity of failure.
10. according to the device described in any one of claim 6-9, which is characterized in that the configuration information includes:Responsible person Email address;
Described device further includes:
Sending module, for according to the email address in the configuration information, being sent the test result by mail he To the email address.
11. a kind of electronic equipment, which is characterized in that including:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors so that one or more of processors are real The now method as described in any in claim 1-5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1-5 is realized when row.
CN201810076537.4A 2018-01-26 2018-01-26 A kind of method and apparatus of interface automatic test Pending CN108334449A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810076537.4A CN108334449A (en) 2018-01-26 2018-01-26 A kind of method and apparatus of interface automatic test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810076537.4A CN108334449A (en) 2018-01-26 2018-01-26 A kind of method and apparatus of interface automatic test

Publications (1)

Publication Number Publication Date
CN108334449A true CN108334449A (en) 2018-07-27

Family

ID=62926435

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810076537.4A Pending CN108334449A (en) 2018-01-26 2018-01-26 A kind of method and apparatus of interface automatic test

Country Status (1)

Country Link
CN (1) CN108334449A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109408391A (en) * 2018-11-06 2019-03-01 北京京航计算通讯研究所 Software System Integrated Testing system based on continuous integrating technology
CN110083523A (en) * 2019-03-13 2019-08-02 中国平安人寿保险股份有限公司 Interface test method, device, computer installation and readable storage medium storing program for executing
CN110399308A (en) * 2019-08-01 2019-11-01 杭州安恒信息技术股份有限公司 A kind of method and apparatus for the automatic implementation of test cases realized based on mail
CN110456777A (en) * 2019-08-20 2019-11-15 广州小鹏汽车科技有限公司 The test method and system of vehicle control device
CN110716878A (en) * 2019-10-11 2020-01-21 赛诺贝斯(北京)营销技术股份有限公司 Automatic interface testing method, device and system
CN110795332A (en) * 2018-08-03 2020-02-14 北京京东尚科信息技术有限公司 Automatic testing method and device
CN110795328A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Interface testing method and device
CN110888000A (en) * 2018-09-10 2020-03-17 北京松果电子有限公司 RBDP interface availability detection method, platform, display terminal and system
CN111444101A (en) * 2020-03-27 2020-07-24 成都嗨学梅里教育科技有限公司 Method and device for automatically creating product test defects
CN111813659A (en) * 2020-06-09 2020-10-23 四川虹美智能科技有限公司 UI and interface based automatic test method, device, equipment and readable medium
CN112350879A (en) * 2019-08-07 2021-02-09 北京京东尚科信息技术有限公司 Data communication equipment test management method, device, system and storage medium
CN112527665A (en) * 2020-12-18 2021-03-19 上海万向区块链股份公司 Method and system for processing dirty data generated by assertion based on FitNesse framework
CN112597051A (en) * 2020-12-30 2021-04-02 北京华胜天成科技股份有限公司 Method and device for obtaining test result, electronic equipment and storage medium
CN112650686A (en) * 2020-12-30 2021-04-13 北京华胜天成科技股份有限公司 Method and device for obtaining test result, electronic equipment and storage medium
CN112783776A (en) * 2021-01-27 2021-05-11 上海淇玥信息技术有限公司 Interface routing-based test method and device and electronic equipment
CN113535841A (en) * 2021-08-04 2021-10-22 杭州遥望网络科技有限公司 Data verification method, device and equipment and computer readable storage medium
CN113742250A (en) * 2021-11-05 2021-12-03 广州易方信息科技股份有限公司 Automatic interface testing method and device
CN115858397A (en) * 2023-02-03 2023-03-28 江苏银承网络科技股份有限公司 APP automatic test method and device and automatic test system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130055028A1 (en) * 2011-08-31 2013-02-28 Ebay Inc. Methods and systems for creating software tests as executable resources
CN105446878A (en) * 2015-11-09 2016-03-30 上海爱数信息技术股份有限公司 Continuous program automated testing method
CN105786696A (en) * 2014-12-26 2016-07-20 阿里巴巴集团控股有限公司 Test method and device
CN107368428A (en) * 2017-09-07 2017-11-21 马上消费金融股份有限公司 A kind of method for testing software and software testing system
CN107506298A (en) * 2017-07-28 2017-12-22 杭州销冠网络科技有限公司 A kind of monitoring method and system for business on line

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130055028A1 (en) * 2011-08-31 2013-02-28 Ebay Inc. Methods and systems for creating software tests as executable resources
CN105786696A (en) * 2014-12-26 2016-07-20 阿里巴巴集团控股有限公司 Test method and device
CN105446878A (en) * 2015-11-09 2016-03-30 上海爱数信息技术股份有限公司 Continuous program automated testing method
CN107506298A (en) * 2017-07-28 2017-12-22 杭州销冠网络科技有限公司 A kind of monitoring method and system for business on line
CN107368428A (en) * 2017-09-07 2017-11-21 马上消费金融股份有限公司 A kind of method for testing software and software testing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
木心月: ""jenkins上集成fitnesse"", 《HTTPS://WWW.CNBLOGS.COM/MUXINYUE/P/4242046.HTML》 *

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795328A (en) * 2018-08-01 2020-02-14 北京京东尚科信息技术有限公司 Interface testing method and device
CN110795332A (en) * 2018-08-03 2020-02-14 北京京东尚科信息技术有限公司 Automatic testing method and device
CN110888000A (en) * 2018-09-10 2020-03-17 北京松果电子有限公司 RBDP interface availability detection method, platform, display terminal and system
CN110888000B (en) * 2018-09-10 2022-02-08 北京小米松果电子有限公司 RBDP interface availability detection method, platform, display terminal and system
CN109408391A (en) * 2018-11-06 2019-03-01 北京京航计算通讯研究所 Software System Integrated Testing system based on continuous integrating technology
CN110083523A (en) * 2019-03-13 2019-08-02 中国平安人寿保险股份有限公司 Interface test method, device, computer installation and readable storage medium storing program for executing
CN110399308A (en) * 2019-08-01 2019-11-01 杭州安恒信息技术股份有限公司 A kind of method and apparatus for the automatic implementation of test cases realized based on mail
CN112350879A (en) * 2019-08-07 2021-02-09 北京京东尚科信息技术有限公司 Data communication equipment test management method, device, system and storage medium
CN112350879B (en) * 2019-08-07 2023-06-27 北京京东尚科信息技术有限公司 Data communication equipment test management method, device, system and storage medium
CN110456777A (en) * 2019-08-20 2019-11-15 广州小鹏汽车科技有限公司 The test method and system of vehicle control device
CN110456777B (en) * 2019-08-20 2022-03-18 广州小鹏汽车科技有限公司 Test method and system of vehicle controller
CN110716878A (en) * 2019-10-11 2020-01-21 赛诺贝斯(北京)营销技术股份有限公司 Automatic interface testing method, device and system
CN110716878B (en) * 2019-10-11 2023-09-26 赛诺贝斯(北京)营销技术股份有限公司 Automatic interface testing method, device and system
CN111444101A (en) * 2020-03-27 2020-07-24 成都嗨学梅里教育科技有限公司 Method and device for automatically creating product test defects
CN111813659A (en) * 2020-06-09 2020-10-23 四川虹美智能科技有限公司 UI and interface based automatic test method, device, equipment and readable medium
CN112527665A (en) * 2020-12-18 2021-03-19 上海万向区块链股份公司 Method and system for processing dirty data generated by assertion based on FitNesse framework
CN112650686A (en) * 2020-12-30 2021-04-13 北京华胜天成科技股份有限公司 Method and device for obtaining test result, electronic equipment and storage medium
CN112597051A (en) * 2020-12-30 2021-04-02 北京华胜天成科技股份有限公司 Method and device for obtaining test result, electronic equipment and storage medium
CN112783776A (en) * 2021-01-27 2021-05-11 上海淇玥信息技术有限公司 Interface routing-based test method and device and electronic equipment
CN113535841A (en) * 2021-08-04 2021-10-22 杭州遥望网络科技有限公司 Data verification method, device and equipment and computer readable storage medium
CN113742250A (en) * 2021-11-05 2021-12-03 广州易方信息科技股份有限公司 Automatic interface testing method and device
CN115858397A (en) * 2023-02-03 2023-03-28 江苏银承网络科技股份有限公司 APP automatic test method and device and automatic test system

Similar Documents

Publication Publication Date Title
CN108334449A (en) A kind of method and apparatus of interface automatic test
CN102693183B (en) Method and system for realizing automatic software testing
CN108459953A (en) test method and device
CN109446071A (en) Interface test method, interface test device, electronic equipment and storage medium
CN105989443A (en) Intelligent-mobile-terminal-based communication line inspection system
CN109479061A (en) Compliance violates detection
CN107506451A (en) abnormal information monitoring method and device for data interaction
CN106599164A (en) Support for a parameterized query/view in complex event processing
van Beek et al. Digital forensics as a service: Stepping up the game
CN110196790A (en) The method and apparatus of abnormal monitoring
CN109933509A (en) A kind of method and apparatus for realizing automatic test defect management
CN109976997A (en) Test method and device
CN108804327A (en) A kind of method and apparatus of automatic Data Generation Test
CN108073506A (en) Test method and device
CN110275826A (en) Automated testing method, device and computer readable storage medium
CN109685089A (en) The system and method for assessment models performance
CN109656744A (en) The method and apparatus for realizing data check and injection are explained based on Java
CN110780856B (en) Electricity data release platform based on micro-service
CN107635001A (en) Web scripts abnormality eliminating method and device
CN110019158A (en) A kind of method and apparatus of monitoring data quality
CN109992496A (en) A kind of data processing method and device for automatic test
CN109002385A (en) Method for testing pressure and device for data flow system
CN107622006A (en) System and method for testing mobile device
CN100407663C (en) Universal testing system and method for telecommunication intelligent service
CN109145813A (en) A kind of image matching algorithm test method and device

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
CB02 Change of applicant information

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant after: Jingdong Digital Technology Holding Co., Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant before: Beijing Jingdong Financial Technology Holding Co., Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20180727

RJ01 Rejection of invention patent application after publication