当前位置:网站首页>My network relationship with "apifox"

My network relationship with "apifox"

2022-06-24 15:54:00 harry666

I and “Apifox ” Network love

Dear friends , at the very time “ Get along well with Apifox Solicitation activities ” In full swing , I also want to take this opportunity to share with you Love Story: I and Apifox Network love .

1 introduction

Briefly introduce the characters of the story :

role full name explain
Man 1 A Zhe The hero of the story “ I ”, yes PMS A rising star in the field , It has supported the normal operation of tens of thousands of hotels ".
Girl one Ruihu Apifox, nickname : Fox
matchmaker Brother Liu Test leader ( He did it for my life , On " matchmaker " )
ex-girlfriend Postman
Once we Jmeter, swaggerUI,MeterSphere, SoapUI, Katalon Studio,Robotframework

PS: Gender is the need of the story , Nothing is more serious ~

2 origin

Years ago , Liu Ge, the person in charge of the test, said “ To ensure that the quality of each iteration goes online , In addition to the original functions (UI) Beyond the level of testing , Must take API Interface automation test on the agenda . Earlier intervention in interface testing , Software defects can be found earlier , And the interface test is more stable ! Every time he comes back and runs, doesn't he smell good blabla”. Since then he has been driving as “ matchmaker ” The runaway mode of . Among the objects introduced, the most impressive ones are :Jmeter,swaggerUI,MeterSphere,soapUI, Katalon Studio,Robotframework,Postman . These children's shoes believed to be tested are quite familiar . Every flower goes into every eye , Both have advantages and disadvantages , I will not start to say . In the process of getting along with each other ,Jmeter Finally, she became a best friend , We often play together during pressure measurement ; Should I say something , I have to mention it Postman, After all “ The former ”. Must give the picture : Postman There are many advantages :

  • ① Support http、https agreement , Interface debugging is very excellent
  • ② Keep a history , It is convenient to organize test cases and support multi terminal synchronous test cases
  • ③ Support reading csv,json Data files
  • ④ Support the creation of different permissions Workspaces, Able to support teamwork ( According to the size of the team and the functional modules of team collaboration ), But the free version of team cooperation support is almost the same as none , Bad review ... Let's not talk about our shortcomings in public ; Brother Liu combined with my specific situation , Also for the next ” object ” Several requirements are specified :
  • ① Must support teamwork well ,
  • ② Zero learning cost
  • ③ Convenient to do API automated testing
  • ④ Be able to operate the database
  • ⑤ To be able to MOCK data
  • ⑥ Look good

You can't say I am a zhezha , Indeed, after several twists and turns, I found that it was really not the most appropriate .

3 Meet and want to know

Some people say ” Past life 500 The second time I look back, I will meet you in this life ”; An accident , Brother Liu will take you (Apifox) Into my vision . you 're right , Just because I saw you in the crowd , Never forget your face . From the moment we look at each other , I know this is “ edge ”!

  • A Zhe :“ Hello , I am a zhe ”
  • Apifox:“ Hello , I am Xiaohu ” ...

4 Know each other and love each other

After meeting , I tried everything I could to find out 、 Try to , Just to enter your world , Also take you to know my world ; Enhance understanding , Bring each other closer . After this period of running in , We're in love , Love so deep , Love so seriously ! I know all your good .

4.1 Apifox Download and install

Apifox Support Desktop and WEB edition , Subject to various networks 、 Hardware and other environmental impacts , After a long period of use , I recommend that you download the desktop version directly and install it , A more stable . Xiaohu supports each Windows,macOS,Linux System desktop version .

4.2 Create teams and projects

Create your own team and project , The first thing you need to do is Apifox Sign up for an account ( Email registration ), You can also directly scan the wechat code to log in , This method is also the recommended login method . Either way, the operation is very simple. Just follow the prompts , Don't go into . It's very interesting Apifox Supports a variety of appearances , That is to say, she has a very wide range of color combinations You can choose your favorite interface style when registering the login interface ( appearance 、 Main color 、 Any font size ):

With an account, you can create your own team and project :

If there are multiple teams You can drag to change the position , The same applies to multiple projects :

One more word about the project can make it easy for you to clone 、 Move 、 Delete the project , To delete an item, you need to manually enter the item name for confirmation , This design is very good , Avoid misoperation and kill the project at once :

4.3 Invite members / Set the permissions

Since we need teamwork , It is necessary for team members to come in ,Apifox Provides 3 Medium invitation method : Link requirements 、 Mailbox requirements 、 Account invitation , Either operation is more convenient .

4.4 Interface document design

Use Apifox The design interface is convenient and fast , follow OpenAPI standard , Full Visualization . Move the cursor to the... Of the created item Location , Click on 【 New interface 】, Then according to the design requirements of the interface , Fill in the interface path 、 name 、 grouping 、 state 、 Parameters 、 Those responsible 、 label 、 service 、 Request parameters 、 Return the response and its corresponding data structure .

There is also a bright spot in the design document , Namely Use of custom interface document fields , We want the interface documentation Follow Product requirements document One-to-one correspondence , So we customized in the interface document “Confluence Requirements link ”:

If the function has been implemented , stay Apifox Add interface documents in , There's a quick way , adopt JSON/XML Intelligent identification / Fast import , useful :

4.5 Interface data import

Before API Most of it is in Postman and RAP On ,Apifox The function of importing data is very powerful , Almost all the data formats you use support , This has to be liked ! A lot of my data comes from Postman and RAP, First from Postman and RAP Export data on . And then through 【 Project settings 】 Of 【 Import data ( Manual import )】 Import data into Apifox; Normal operation after import . It's just Postman During import , Found a small problem , The request parameters of some of my interfaces are exported by default form-data Format , And we are all JSON Of , This problem needs further study WHY.

4.6 Interface debugging

4.6.1 Apifox Debugging ” Automatic verification ”:

The basic operation of Xiaohu debugging interface is as follows Postman There is no difference in operation . And there are many highlights during debugging , For example, when debugging Fox Meeting ” Automatic verification ” data structure , According to the definition of the interface document ,“ Automatic verification “” Whether the returned data structure is correct . No script required very nice .

4.6.2 Apifox Debugging ” Environmental Science 、 Variable management ”:

It is inevitable to use different environments when debugging , Environment variable needs to be set 、 Global variables 、 Global parameters ,Apifox They are all available and easy to operate .

4.6.3 Apifox Debugging ” Assertion ”

4.6.4 Apifox Debugging ” Interface dependency ”

( The request of the next interface depends on the data returned by the previous interface ). Take our project for example , Some of our interfaces will use the information returned by the login interface token value , How do you do that ? as follows :

Login interface 【 The rear operation 】 Extract variables :

The login interface used by an interface of a zhe project returns token value , Add the previously extracted variables to the request parameters :

4.7 The test case

Apifox It is very convenient to organize and manage test cases in , Execute on the interface document 【 function 】 operation , then 【 Save as use case 】 A test case will be generated ; And the example will automatically follow the interface change .

Modify request parameters , Click on send out Save as use case , Use cases can be regenerated , And so on One interface can easily design multiple positive exception test cases .

4.8 Interface MOCK data

Apifox The highlight is , intelligence MOCK The data is very user-friendly , Our testers use... More often than not “ Automatic generation ” function .

4.9 automated testing

The organization of automated test cases and the organization and management of test suites are the focus of our test partners .

Brother Liu is also recommended to use in the test group “ from 【 Interface use cases 】 Import ( recommend )”,【 Interface management 】 Organize the test cases related to each interface in the module , And then to 【 automated testing 】 The module organizes test cases for requirement scenarios .

Test reports will be produced after test cases or test suites are run

The test report is easy to view 、 export :

4.10 API Hub

Xiaohu has brought many third-party platforms , Such as enterprise wechat 、 The opening of nails, etc API , I believe that through their study and Research , You can make yourself better .

5 To be together

People in love are always you and me , Easy to be carried away by love . But we are rational , Apifox Already excellent , But there is still much room for improvement , such as :

  • It should support offline use -- This can be used for reference Impression notes offline 、 After collaboration, you can “ Sync ” note
  • Strengthen the support of stress testing , at present Apifox Support for pressure measurement is weak
  • Continuous integration -- I feel that the convenience of continuous integration is not enough , There's room for optimization
  • Add to gRPC、WebSocket And other protocol interfaces

Someone said ”1000 Projects have 1000 A little fox ”, May I “ Fox ” Meeting 、 Get to know each other 、 Know each other 、 Love will last a lifetime .

原网站

版权声明
本文为[harry666]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206241431469756.html