This project demonstrates end-to-end (E2E) testing of a PyShiny application using Playwright. It aims to provide a practical example of how to automate testing for a Python-based web app, covering UI interactions and verifying functionality.
- Demonstrates usage of Playwright with PyShiny.
- Shows how to test easily available UI components like radio buttons.
- And how to test components that require javascript to interact with, like sliders.
- Includes examples of parameterized tests.
- Python 3.10+
- Poetry for dependency management
- Clone the repository:
git clone https://github.com/Appsilon/pyshiny-e2e-playwright.git
cd pyshiny-e2e-playwright- Install dependencies using Poetry:
poetry install
poetry run playwright installThese commands will create a virtual environment and install all required dependencies.
To start the PyShiny app:
poetry run shiny run app.pyEnsure the app is running at http://localhost:8000 (or your configured port).
To execute the E2E tests with Playwright:
poetry run pytestMake sure your app is running before executing the tests as they require the app to be accessible.
Appsilon | appsilon.com

