Parrot API mocking Parrot API mocking

Developer Tools
Version: 6.4.4
Last Update: 2023-03-25

Overview

Parrot API mocking is a Chrome extension developed by Ruud Landman. According to the data from Chrome web store, current version of Parrot API mocking is 6.4.4, updated on 2023-03-25.
144 users have installed this extension. 3 users have rated this extension with an average rating of .

Hassle-free mocking of xhr and fetch calls.

Mocking your API responses like a pro.
Parrot now on manifest version 3!

Parrot allows you to mock any asynchronous API call you want. It does this by wrapping both Fetch and XMLHttpRequest in such way that the actual call will always be done, but the response will be substituted by the mock data you specified. This ensures that you will not suffer from any CORS related issues.

*** When to use this extension? ***

Parrot might be useful for at least any of the following scenarios:

- You are developing a front end that needs to connect to some back end API, but that back end API has not yet been developed or is down.

- You want to give a live demo but the back end API needed is currently not available or broken.

- You would not only like to test the happy flow, but would also like to see how your front end behaves given any possible alternate scenario or edge case.

- You are experiencing a nasty bug but have no way of reproducing it easily using the real back end system. You would like to tweak the response to check if any unexpected response could be the cause of your issue.

*** How to use this extension? ***

Start by just pressing the Add button to define a mocked response for a specific request. A line will show up on which you can define the HTTP verb/method and the URL-fragment of the request you would like to be mocked. The URL fragment is defined with a regular expression, allowing you to make any matching requirement as loose or strict as you would like it to be.

On that same line you can then define the status code of your response, the exact response type and the payload to be returned.

Once the extension detects the method/URL you expressed, the regular call will still be done. However, once the actual response has been received, no matter it's actual result, it will be replaced by the mocked response you defined.

NB
Next to being JSON, for any response now also TRANSFORM can be specified.
In this case a plain JavaScript function can be defined that will receive the original response, can do some transformations and will then return the transformed response.

Example:

(resp) => {
resp.someProperty = 'someValue';
return resp;
}

*** CORS mitigation ***

As stated, the actual call will first be done, directly followed by substitution of the response. By doing so any CORS related issues are mitigated automatically.

*** Timing your calls by adding a delay ***

Particularly for checking for, or debugging of, potential race condition issues, for any request a delay (expressed in milliseconds) can be specified. This delay will be taken into account before the response is returned to the client that made the request. By carefully timing request/response cycles you can make sure that responses will be received in the exact order you would like them to be.

*** Export and Import your mock definitions ***

The set of mock definitions can also be exported to the file system using the Export button. This allows you to share your mock data with others and also allows you to create/maintain sets of mock definitions. Exported files can easily be reimported by using the Import button. Imported files will be appended to any currently existing mock definitions in the extension, allowing you to stack multiple sets on top of each other.

*** Multiple mock definitions ***

When determining the mock data to be substituted, there can be multiple definitions matching the given URL and method. In this case, Parrot will just use the last mock definition found.

*** Notification when mock data has been used ***

Every time mock data has been substituted, a small notification will show up. This behavior can be turned off using the popup dialog.

*** Network viewer ***

Parrot will show all asynchronous calls in a compact view directly attached to your content page. This network view offers you the possibility to show and mock any response with the click of one single button. The overview also directly shows which responses were mocked and which responses were original.

*** Localhost ***

Localhost resources will not be mocked by Parrot since normally those resources will be mocked anyway.

Rating

3 ratings

Total Installs

144

Information

Last Update

2023-03-25

Current Version

6.4.4

Size

3.67MiB

Author

Ruud Landman

Website

None

Category

Developer Tools

Parrot API mocking Alternatives

Latest Reviews

See More

avatar Henk Bouwensen
2022-04-10

A real life saver. Next to fully replacing a response you can also process it using plain JavaScript! Really love this extension.

avatar kami kamyar
2022-06-08

good job

avatar Peter Brons
2022-12-19

Great tool! Real easy to use and handles the mocking like charm. 5 out of 5!

avatar Peter Brons
2022-12-19

Great tool! Real easy to use and handles the mocking like charm. 5 out of 5!

avatar kami kamyar
2022-06-08

good job