Mocking API
AKA Mockingbird - A simple mocking API
Overview
Mockingbird allows you to upload captured web session traffic, (captured from your browser as a HAR file) and turn the session traffic into a API.
prerequisites
Mockingbird is a separate repository due to the size if HAR files. You can view the repo here: https://gitlab.com/investec/digital/web/cloudflare/io-mockingbird/
Capturing web session traffic
When you follow a user journey on a website, your browser stores all requests and responses and can be exported
Right-click in the browser window or tab and select Inspect
Click the Network tab in the panel that appears
Navigate to the URL you want to traffic
Click the download button Download (Export HAR appears when you hold the pointer over it)
Name the file appropriately (e.g. private-client-make-a-payment.har), the file name will be your
keyto access your mock apiClick Save
Deploying mocks
Add your mock to
./mocksdirectoryrun
node tools/process-har.jsto test your HAR can be parsedCommit and create a merge request
Watch the pipeline to make sure it deploys
Mock API requests
Set a header
{store: 'YOUR_KEY_HERE'}, this header is used to target your mockMake a request to
platform.investec.com/proxy/*