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.jsoninrequestlydirectory with above exported file. Make sure you name it asrules.json. If you are movingrequestlydirectory from project root to a different location, you need to updateREQUESTLY_FOLDER_PATHincypress.config.js. -
Set
baseUrlincypress.config.jsfile as your application URL. -
Modify or add tests in
cypress/e2edirectory. -
Run tests using command:
npm run testBy default, it runs on Chrome browser. To run on Edge browser:
npm run test:edgeNote: To enable extension in browser, Cypress needs to run in headed mode.