⚠️ Work in Progress: This project is currently under development.
Record and serve back a mock version of a website. It is particularly useful to work with a mock when using website automation tools like Selenium or Playwright. The mock helps to avoid unnecessary interactions with a website's actual servers during development and testing phases.
-
Traffic Capture: Records web interactions for later use, capturing the dynamic behavior of the site.
-
Mock Server: Replays captured data, offering a functioning interactive mock of the original website running in a browser for testing and development purposes.
-
Export Standalone Server: Provides the capability to export a standalone server setup. This is ideal for integrating the mock website into other projects or for isolated testing environments.
Before installing Mockasite, ensure that you have the build package installed. You can install it using pip:
pip install buildThen run the following command in the project's root directory to install mockasite:
make install
-
Capture Mode: Use
mockasite --captureto record and serve back a mock version of a website. To open the browser to a specific URL use--url <URL>. -
Review Capture: Use
mockasite --review-captureto review the last capture. -
Delete Capture: Use
mockasite --delete-captureto delete the last capture. -
Process: Use
mockasite --processto process the last capture. This will extract and dump HTTP request and response data into a structured directory format. -
Review Processed: Use
mockasite --review-processedto review processed files. -
Delete Processed: Use
mockasite --delete-processedto delete processed files. -
Playback Mode: Use
mockasite --playbackto replay processed data as a functioning interactive mock of the original site. -
Export Functionality: Use
mockasite --exportto export a standalone server that serves the mock website.
Mockasite is released under the MIT License. See the LICENSE file for more details.