Requestly enables you to setup rules to modify parts of network requests like URL, headers, response.
If you use Cypress as the automation framework for end-to-end testing of your web application, you might want to integrate Requestly extension in the browser to unlock all its powers.
Here are the easy steps you can follow:
- Clone this project.
git clone git@github.com:requestly/requestly-cypress-template.git
- Install the dependencies.
npm install
-
Export your rules from Requestly: https://app.requestly.io/rules/my-rules
-
Replace
rules.json
inrequestly
directory with above exported file. Make sure you name it asrules.json
. If you are movingrequestly
directory from project root to a different location, you need to updateREQUESTLY_FOLDER_PATH
incypress.config.js
. -
Set
baseUrl
incypress.config.js
file as your application URL. -
Modify or add tests in
cypress/e2e
directory. -
Run tests using command:
npm run test
By default, it runs on Chrome
browser. To run on Edge
browser:
npm run test:edge
Note: To enable extension in browser, Cypress needs to run in headed mode.