This project is a simple web application designed to demonstrate integration with Dev Proxy and end-to-end testing using Playwright.
- Static web app served from the
public/directory - End-to-end tests written with Playwright (
tests/directory) - Example Playwright configuration and test scripts
- Easily runnable with minimal setup
- Dev Proxy integration for API mocking and network simulation
-
Install dependencies
npm install
-
Install Dev Proxy
-
Start Dev Proxy
devproxy
The
.devproxyfolder contains configuration files for Dev Proxy, enabling API mocking and network simulation during development and testing.devproxyrc.json: Main configuration file specifying plugins and settings.- MockResponsePlugin: Mocks API responses using rules defined in
mocks.json. - LatencyPlugin: Simulates network latency with configurable delay.
- urlsToWatch: Only requests to
https://api.blog.com/*are intercepted. - mockResponsePlugin.mocksFile: Points to the
mocks.jsonfile for mock data. - latencyPlugin: Sets minimum and maximum delay (200–800ms) for responses.
- MockResponsePlugin: Mocks API responses using rules defined in
mocks.json: Contains mock API responses. For example, a GET request tohttps://api.blog.com/postsreturns a list of blog posts with sample data.
This setup allows you to run the web app and Playwright tests against consistent, controlled API responses and network conditions, making it ideal for local development and CI environments.
-
Run the web app
npm start
[!NOTE] Ensure Dev Proxy is running before executing tests.
-
Install Microsoft Edge for Playwright
npm run install:msedge
-
Run Playwright Tests
npm test
This project includes a GitHub Actions workflow (.github/workflows/test.yml) to demonstrate testing of Dev Proxy integration with Playwright in CI environments.
Workflow highlights:
- Checks out the repository and sets up Node.js 20
- Installs dependencies and Microsoft Edge for Playwright
- Installs and starts Dev Proxy
- Installs the Dev Proxy root certificate for Chromium-based browsers
- Runs Playwright end-to-end tests
- Outputs Dev Proxy logs for troubleshooting
This workflow ensures that your application and tests run in a controlled environment with Dev Proxy, simulating real-world API and network conditions automatically on every run.
To test the workflow locally:
- Install the GitHub Local Actions extension in VS Code.
- If running on macOS with Apple Silicon, set the
container-architectureoption tolinux/amd64and enable it. Learn more. - Execute the
Test Dev Proxy integration with Playwrightworkflow. Learn more

