当前位置:网站首页>Chinese postman? Really powerful!
Chinese postman? Really powerful!
2022-07-05 18:39:00 【InfoQ】
It can't be done efficiently
Current situation of interface management
One 、 Common solutions
- Use Swagger management API file
- Use Postman debugging API
- Use MockJs Tools such as Mock API data
- Use JMeter do API automated testing
Two 、 The problem is
- Developers in Swagger After defining the document , Interface debugging also needs to go Postman Define it again .
- The front-end development Mock When it comes to data MockJs Define it again , You also need to set it manually Mock The rules .
- Testers need to go to JMeter Define it again .
- Front end according to MockJs Mock The data is developed , Back end according to Swagger The defined interface document is developed , They all passed the test , I thought I could go online right away , As a result, a variety of problems were found :
- The interface changed during development , Only modified Swagger, But they didn't synchronize the changes in time MockJs.
- The interface data type of back-end development is inconsistent with the document , It's hard to see the problem with the naked eye .
- Again , Test in JMeter Well written test cases , When it's really running, you'll find all kinds of inconsistencies .
- Time is long. , The inconsistencies will get more and more serious .
Apifox Solution
One 、 How to solve these problems
1、Apifox location
Apifox = Postman + Swagger + Mock + JMeter
2、Apifox Purpose
3、Apifox function
- Interface design:Apifox Interface documentation followsOpenApi3.0 ( primary Swagger)、JSON SchemaAt the same time , It's very easy to use
visualization
Document management function , Zero learning cost , Very efficient . And support online sharing of interface documents .
- Data model: Reusable data structure , Defining interfaces
Return data structure
AndRequest parameter data structure
( only JSON and XML Pattern ) You can directly reference . Support model direct nested reference , direct JSON/XML Smart import , Support oneOf、allOf And other advanced combination modes .
- Interface debugging:Postman Some functions , For example, environment variables 、 In front of / Post script 、Cookie/Session Global Shared And so on ,Apifox There are , And ratio Postman More efficient and easy to use . After the interface runs, click
Save as use case
Button , It can generateInterface use cases
, Interface use cases can be run directly later , No more parameters need to be entered , Very convenient . Custom script 100% compatible Postman grammar , And support running javascript、java、python、php、js、BeanShell、go、shell、ruby、lua And other language codes .
- Interface use cases: Usually, an interface has multiple use cases , such as
The parameters are correct
Use cases 、Parameter error
Use cases 、Data is empty
Use cases 、Different data states
Use cases, etc . The correctness of data will be automatically verified when running the interface case , Using interface use cases to debug interfaces is very efficient .
- Interface data Mock: built-inMock.jsRules engine , Very convenient mock All kinds of data , And you can define the data structure and write mock The rules . Support adding “ expect ”, According to the request parameters, different mock data . most important of all Apifox
Zero configuration
that will do Mock Very human data , The details are introduced later in this paper .
- Database operation: Support reading database data , Used as an interface request parameter . Support reading database data , Used to verify ( Assertion ) Whether the interface request is successful .
- Interface automation testing: Provide interface set testing , You can choose the interface ( Or interface use cases ) Quickly create test sets . At present, more functions of interface automation test are still under development , Coming soon ! The goal is : JMeter Some functions are basically , And use it better .
- Quick debugging: similar Postman Interface debugging mode , It is mainly used for temporary debugging
No documentation required
The interface of , You can quickly debug without defining the interface in advance .
- Code generation: Define according to the interface and data model , Automatic system generation
Interface request code
、Front end business code
AndBack end business code
.
- Teamwork:Apifox Born for teamwork , Interface cloud real-time synchronous update , ripe
The team / project / Member rights
management , Meet the needs of various enterprises .
Two 、Apifox It's not just about getting through the data
1、 Interface support “ Use case management ”
The right use case
Parameter error use case
Data is empty use case
Different data state use cases
2、“ Data model ” Definition 、 quote
3、 During debugging “ Automatic verification ” data structure
4、“ visualization ” Set assertion
5、“ visualization ” Set extraction variables
6、 Support database operations
7、“ Zero configuration ”Mock Very human data
Zero configuration
Zero configuration
high efficiency
Zero configuration
- Apifox According to the data structure in the interface definition 、 data type , Automatic generation mock The rules .
- Apifox Built in intelligence mock Rule base , According to the field name 、 Field data type , Intelligent optimization automatically generated mock The rules . Such as : The name contains the string
image
Ofstring
The type field , Automatically mock Give a picture address URL; Include stringtime
Ofstring
The type field , Automatically mock Give a time string ; Include stringcity
Ofstring
The type field , Automatically mock Name a city .
- Apifox According to the built-in rules , Can automatically identify pictures 、 Head portrait 、 user name 、 cell-phone number 、 website 、 date 、 Time 、 Time stamp 、 mailbox 、 Province 、 City 、 Address 、IP Etc , thus Mock Very human data .
- In addition to the built-in mock The rules , Users can also customize the rule base , Meet a variety of personalized needs . Support use
Regular expressions
、wildcard
To match field name customization mock The rules .
8、 Generate online interface documentation
9、 Code auto generation
Custom code template
10、 Import 、 export
- Support export
OpenApi (Swagger)
、Markdown
、Html
And so on , Because you can exportOpenApi
Format data , So you can use OpenApi (Swagger) Rich ecological tools to complete a variety of interface related things .
- Support import
OpenApi (Swagger)
、Postman
、apiDoc
、HAR
、RAML
、RAP2
、YApi
、Eolinker
、NEI
、DOClever
、ApiPost
、Apizza
、ShowDoc
、API Blueprint
、I/O Docs
、WADL
、Google Discovery
And so on , Facilitate the migration of old projects .
- Support
Timed automatic
ImportOpenApi (Swagger)
、apiDoc
、Apifox
Format data .
3、 ... and 、 Follow up function planning
- Release Apifox WEB edition , Support the use of... On the browser side Apifox.
- Interface performance test support ( similar JMeter).
- Support plug-in market , You can develop your own plug-ins .
- to open up Apifox API, Allow developers to pass through API call Apifox The function of .
- Support more interface protocols , Such as
GraphQL
、gRPC
、websocket
etc. .
- Support offline use , Project can choose online synchronization ( Teamwork ) Or just local storage ( Stand alone offline use ).
Four 、 more Apifox Function screenshot
nothing 、 Apifox Download address
边栏推荐
猜你喜欢
解决 contents have differences only in line separators
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD
ConvMAE(2022-05)
rust统计文件中单词出现的次数
About Estimation with Cross-Validation
Use of websocket tool
node_exporter内存使用率不显示
如何获取飞机穿过雷达两端的坐标
websocket 工具的使用
Simulate the hundred prisoner problem
随机推荐
[PM2 details]
Copy the linked list with random pointer in the "Li Kou brush question plan"
Introduction to Resampling
c语言简便实现链表增删改查「建议收藏」
Reptile 01 basic principles of reptile
jdbc读大量数据导致内存溢出
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
技术分享 | 接口测试价值与体系
彻底理解为什么网络 I/O 会被阻塞?
ConvMAE(2022-05)
瞅一瞅JUC提供的限流工具Semaphore
LeetCode 6111. Spiral matrix IV
Lombok @builder annotation
Let more young people from Hong Kong and Macao know about Nansha's characteristic cultural and creative products! "Nansha kylin" officially appeared
RPC协议详解
New words new words new words new words [2]
sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
buuctf-pwn write-ups (9)
使用JMeter录制脚本并调试
@Extension, @spi annotation principle