Unlock instant, AI-driven research and patent intelligence for your innovation.

Mock test method and device, electronic equipment and medium

A test method and configuration file technology, applied in the fields of electronic equipment and media, devices, and mock test methods, can solve problems such as low support, limited use scenarios, and no mock test methods.

Pending Publication Date: 2021-07-30
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF0 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] At present, mock.js is used to process the virtual interface separately from the front and back of the webpage application in the industry. The mock method of mock.js is to mock by writing js code in the front-end code, but its usage scenarios are limited, such as in black box testing Cannot be used in joint debugging scenarios
Moreover, the mock data is maintained through development. When mocking complex data such as tables, it is necessary to understand and adapt complex rules before parsing. mock.js relies on js code, and the support is not high.
[0004] In the process of implementing the disclosed concept, the inventors found that there are at least the following problems in related technologies: when using the cross-platform framework React Native to develop mobile pages, since mock.js cannot be used in the mobile React Native framework, there is no other The open source mock test method that can be used in React Native needs a mature mock test method to solve the problems of unstable back-end interface or complex third-party interface existing in the React Native framework of the mobile terminal.

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
  • Mock test method and device, electronic equipment and medium
  • Mock test method and device, electronic equipment and medium
  • Mock test method and device, electronic equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0033] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. It should be understood, however, that these descriptions are exemplary only, and are not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Also, in the following description, descriptions of well-known structures and techniques are omitted to avoid unnecessarily obscuring the concept of the present disclosure.

[0034] The terminology used herein is for the purpose of describing particular embodiments only, and is not intended to be limiting of the present disclosure. The terms "comprising", "comprising", etc. used herein indicate the presence of stated features, ...

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 provides a mock testing method and device, electronic equipment and a medium, and relates to the field of data testing or interface testing. The mock test method is applied to a React Native framework, and comprises the following steps: a client sends a global network request for calling a server interface by using a feed function in the React Native framework; a local network request is intercepted in the global network request, input parameters of the local network request are extracted, and the input parameters comprise a request address and a configuration object; according to a pre-configured configuration file, judging whether a mock service interface is configured in the request address; if yes, receiving mock virtual response data returned by the request address through the mock service interface; otherwise, canceling interception of the local network request data, and receiving real response data returned from the server interface based on the local network request.

Description

technical field [0001] The disclosure relates to the field of data testing or interface testing, and in particular to a mock testing method, device, electronic equipment and media. Background technique [0002] Mock testing is a common debugging method in software engineering. It uses virtual objects to simulate objects that do not agree with the structure or are not easy to obtain, so as to achieve higher test coverage. In projects where the mock test is mainly used to separate the front and back ends, the front-end page development uses the mock test to call a virtual interface, simulate the return data of the interface, and complete the development of the page content without relying on external interaction. [0003] At present, mock.js is used to process the virtual interface separately from the front and back of the webpage application in the industry. The mock method of mock.js is to mock by writing js code in the front-end code, but its usage scenarios are limited, su...

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/36G06F16/955G06F16/958
CPCG06F11/3688G06F16/955G06F16/958
Inventor 王俊宏罗涛赵海强
Owner INDUSTRIAL AND COMMERCIAL BANK OF CHINA