Postman's "replacement" postwoman function experience

In normal work, whether you are a development engineer or a test engineer, you should have used postman when doing interface testing. Postman was originally a plug-in on chrome, and then gradually evolved into a desktop application, which is much more convenient and convenient to use.

In addition to basic functions such as requesting interfaces, postman also has some advanced usages, such as: setting environment variables, asserting test on interface return values, setting interface pre- and post-scripts, Mock interface, interface runner setting interface loop The number of executions (note that the execution here is not concurrent execution, but sequential execution) and so on. However, in real work scenarios, we hope that the entire team can share the same interface configuration, which will help interface joint debugging and testing, and improve work efficiency.

The concept of Team is added in postman, and a corresponding workspace can be created for each team, and then corresponding colleagues can be invited to join the team, so that everyone can see the interface under the team workspace. It's just that postman has restrictions on the common version, and there are clear requirements for the number of interfaces in the team and the number of calls to the Mock interface. As shown below:

For the current project, the number of interfaces can reach the upper limit every minute, so for a better experience, payment is an option. However, postman's fees are relatively expensive, and the price list is shown in the figure below:

Postwoman appeared to fight against Postman's charges: "You charge, but I don't charge, not only don't charge, I also open source." The description information of postwoman on github is: "A free, fast and beautiful API request builder (web alternative to Postman) used by 62k+ developers.". Translated into Chinese is: "an open source, fast and beautiful interface requester, which has been used by 62,000 developers, and is a web-side alternative to Postman".

Next, let's take a look at postwoman's user experience and functional design, whether it is really as powerful as it says:

install postwoman

postwoman is mainly developed using vue. It has two installation methods, one is to use the command line npm command to install, and the other is to use docker. I personally recommend that you use the docker method to install, it’s nothing, the main reason is that it’s convenient, and you don’t need to install other tools. You can directly pull the image of postwoman and run it. The command is as follows:

$ docker pull liyasthomas/postwoman  # 拉取postwoman的镜像
$ docker run -p 3000:3000 liyasthomas/postwoman  # 启动镜像

After execution, if no error is reported, you can directly access postwoman. The default port number is 3000. If you deploy on your own computer, you can directly access it through http://ip:3000 . Its main page looks like this:

Main function introduction of postwoman

postwoman has five major functions (as shown in the figure above), namely:

  • Home
  • RealTime (real-time request)
  • GraphQL (API Query Language)
  • Document (document/interface description)
  • Settings

The following is an introduction to the above five major categories of functions:

Home

The homepage mainly requests and manages the common http(s) interface. This is similar to the function of postman's request interface, which can create Collections collections, create environment variables, write Pre-request Script and Tests for assertion verification of results, etc.

However, it should be noted that postwoman does not use a database, but saves the data created by the user to the browser's local Storage. That is to say, if you clear the browser cache, the data previously saved in local storage will also be cleared.

It needs to be explained that postwoman can log in with github and Google accounts, but I can’t pull up the login authorization page when I verify locally (F12 should be a failure of a certain interface request, due to network reasons), you can try it locally.

RealTime (real-time request)

This should be a unique function of postwoman, which can be used for request verification of long connection services, such as: WebSocket (starting with wss://), SSE, http://Socket.IO , MQTT. Among them, we should be familiar with WebSocket and MQTT. The interface display of MQTT request is as follows:

It can be seen that after the mqtt connection is established, you can also subscribe to a topic, or send a message to a topic. This function is still commonly used in daily work. For example: MQTT used to download a special desktop tool to operate and view normally.

GraphQL (API Query Language)

A knowledge point GraphQL is involved here, which is a language proposed by facebook for API query. What are the usage scenarios for GraphQL? For example, we will encounter certain interfaces in our usual work, and we want to request a certain information, but it returns a lot of additional information. For example: a product menu request interface originally only needs to return the basic information of the product, but it may return information such as the creator of the product, user comments, and detailed descriptions.

There are many reasons for this situation. For example, in order to be compatible with PC and mobile interfaces, the interface design becomes larger and larger. Or for some weird needs, it is necessary to display different styles and content of products according to different conditions. Can we return different content according to the different parameters of our request? GraphQL is used to do this. Its official document has a sentence: "ask exactly what you want.".

A specific example is given in postwoman, as shown in the following figure:

Document (document/interface description)

This function can import any exported postwoman collection, and then view it in the form of a document, as follows:

Personally, I feel that this function design is not very useful. The only scenario I can think of is that the collection exported by others can be imported, and we can view the basic interface definition.

Settings

There is nothing special about the setting module, they are relatively basic configurations, such as: you can configure account login, theme color of the overall interface, and enable proxy settings.

Summarize

Frankly speaking, postwoman is not as powerful as I imagined. At first, I thought it should provide all the functions of the paid version of PostMan, so that it would be interesting to fight against postman. However, postwoman also has some useful functions, such as: you can test mqtt and websocket, and support GraphQL. In addition, the better thing about postwoman is that it is open source, so we can do some customization based on it and develop an interface test platform suitable for the company.

But what disappoints me the most about postwoman is that it doesn't use a database, but just saves the interface data in localStorage, which is very inconvenient, and there is no way to synchronize data between teams. In addition, it does not provide control over the data permissions of the interface (the database is not used, and there is no way to control it).

However, if you just use it yourself and don't want to install a postman client software, then postwoman is also a good choice.

Finally: The complete software testing video tutorial below has been organized and uploaded, and friends who need it can get it by themselves [Guaranteed 100% free]

insert image description here

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

picture

Acquisition of complete set of information

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/130948233