Why mock test ?
When the business dependent relational interface is not developed , In order to ensure that the test schedule of the project is not affected by the tester , We need to construct a virtual interface to carry out a series of interface tests

<> One , open postman, establish mock server

There's one in the upper left corner New, There will be a drop-down list after clicking , Choose the one inside Mock Server

Check Request-Body( Request content )

fill in mock Test each request parameter

Then click Next, next step

create mock server

Enter the generated x-api-key Value page

Entering this page for the first time will let you log in , Just input your email account and password

** After entering, Zhang looks like this . click Generate API Key **

In the pop-up box , Fill in the corresponding content , And generate such a api -key

take api - key value Save and copy ( be careful , this key The value appears only once , After copying, you'd better create a new notepad and stick it in )

go back to postman in , The previously created mock server In my pop-up window , click Close

<> Two , Fill in the parameters in the interface , complete mock test

click mock Test set 2 , We just created a new request

Switch the environment to the one we created at the beginning mock service The named one

fill in body Enter the reference , after send lower , You can see our custom parameter result

there body Enter the reference , It's customized before

supplement : If you need to change the output parameter or input parameter , Click on the Examples You can modify it

If you have any questions , Please leave a message at the bottom of the blog , Little friends will know everything

Technology