Interface testing method and device, electronic equipment and medium

An interface test and interface technology, applied in the field of data processing, can solve problems such as high development costs and inflexible test frameworks, and achieve the effect of saving development costs

Pending Publication Date: 2020-06-05
BEIJING 58 INFORMATION TECH
View PDF7 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In view of the above problems, an interface testing method, device, electronic equipment and computer-readable storage medium are proposed to solve the problem that the existing testing framework is not flexible enough, and the development cost of using the existing testing framework for interface testing is relatively high

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Interface testing method and device, electronic equipment and medium
  • Interface testing method and device, electronic equipment and medium
  • Interface testing method and device, electronic equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0041] refer to figure 1 , which shows a flow chart of an interface testing method in Embodiment 1 of the present invention, which may specifically include:

[0042] Step 101, encapsulating the request method of the Rest-Assured framework, the assertion method and the annotation method of the TestNG framework, to obtain a custom framework for interface testing.

[0043] The Rest-Assured (Representational State Transfer-Assured, representational state transfer testing framework) framework is a Java DSL based on REST service testing (a computer programming language with limited expressiveness for a certain field), which can simplify A process for testing and validating REST services built on top of HTTP Builder, a network request / response builder. The Rest-Assured framework supports sending POST, GET, PUT, DELETE, OPTIONS, PATCH and HEAD requests, and can verify the relevant information of the request.

[0044] The TestNG (Test Next Generation, next-generation testing) framewo...

Embodiment 2

[0065] refer to figure 2 , which shows a flow chart of an interface testing method in Embodiment 2 of the present invention, which may specifically include:

[0066] Step 201, the request method class of the Rest-Assured framework, the assertion method class and annotation method class of the TestNG framework, the test case base class, the test case execution result base class, the test cases of the Rest-Assured framework and the TestNG framework The execution method class is encapsulated to obtain a custom framework for the interface test.

[0067] In the embodiment of the present invention, the custom framework includes encapsulated test case base class, encapsulated test case execution result base class, encapsulated request method enumeration class, encapsulated assertion method enumeration class, encapsulated test report generation Annotated method classes, test case execution method classes of the encapsulated Rest-Assured framework and TestNG framework.

[0068]Among...

Embodiment 3

[0083] refer to image 3 , which shows a structural block diagram of an interface testing device in Embodiment 3 of the present invention, which may specifically include:

[0084] The encapsulation module 301 is used to encapsulate the request method of the Rest-Assured framework, the assertion method and the annotation method of the TestNG framework, and obtain a custom framework for interface testing;

[0085] The request module 302 is configured to provide a request parameter to the interface to be tested by using the request method encapsulated in the custom framework, and obtain a return value of the interface to be tested based on the request parameter;

[0086] An assertion module 303, configured to use the assertion method encapsulated in the custom framework to verify the return value and obtain a verification result;

[0087] The report generating module 304 is configured to generate configuration information of a test report by using the annotation method encapsula...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses an interface testing method and device, electronic equipment and a medium. The method comprises the following steps of: packaging a request method of a Rest-Assured framework,an assertion method of a TestNG framework and an annotation method of the TestNG framework; obtaining a custom framework for interface testing; adopting a request method packaged in the custom framework to provide request parameters for the to-be-tested interface, obtaining a return value of the to-be-tested interface based on the request parameter; adopting an assertion method packaged in a custom framework to verify return values, obtaining verification results, generating configuration information of the test report by adopting an annotation method packaged in a custom framework; and generating a test report according to the verification result and the configuration information, thereby combining the Rest-Assured framework and the TestNG framework, packaging a simple and universal custom framework, realizing execution of the to-be-tested interface, realizing verification through assertion, and saving development cost of separately using an existing test framework.

Description

technical field [0001] The invention relates to the technical field of data processing, in particular to an interface testing method, an interface testing device, an electronic device and a computer-readable storage medium. Background technique [0002] Interface testing is a type of testing that tests the interfaces between system components. Interface testing is mainly used to detect the interaction points between external systems and internal subsystems. The focus of the test is to check the exchange of data, the process of delivery and control management, and the mutual logical dependencies between the systems. [0003] Interfaces are generally divided into two types: internal interfaces of the program and external interfaces of the system. Among them, the external interface of the system: For example, if you want to obtain resources or information from other websites or servers, others will definitely not share the database with you. He can only provide you with a met...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3684
Inventor 马雪娇
Owner BEIJING 58 INFORMATION TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products