Skip to content

Commit 9e0146c

Browse files
alejsdevtiangolo
andauthored
📝 Add End-to-End Testing with Playwright to frontend README.md (#1279)
Co-authored-by: Sebastián Ramírez <[email protected]>
1 parent d9a21d3 commit 9e0146c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- 💃 Using TypeScript, hooks, Vite, and other parts of a modern frontend stack.
1414
- 🎨 [Chakra UI](https://chakra-ui.com) for the frontend components.
1515
- 🤖 An automatically generated frontend client.
16+
- 🧪 [Playwright](https://playwright.dev) for End-to-End testing.
1617
- 🦇 Dark mode support.
1718
- 🐋 [Docker Compose](https://www.docker.com) for development and production.
1819
- 🔒 Secure password hashing by default.

frontend/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,33 @@ The frontend code is structured as follows:
115115
* `frontend/src/hooks` - Custom hooks.
116116
* `frontend/src/routes` - The different routes of the frontend which include the pages.
117117
* `theme.tsx` - The Chakra UI custom theme.
118+
119+
## End-to-End Testing with Playwright
120+
121+
The frontend includes initial end-to-end tests using Playwright. To run the tests, you need to have the Docker Compose stack running. Start the stack with the following command:
122+
123+
```bash
124+
docker compose up -d
125+
```
126+
127+
Then, you can run the tests with the following command:
128+
129+
```bash
130+
npx playwright test
131+
```
132+
133+
You can also run your tests in UI mode to see the browser and interact with it running:
134+
135+
```bash
136+
npx playwright test --ui
137+
```
138+
139+
To stop and remove the Docker Compose stack and clean the data created in tests, use the following command:
140+
141+
```bash
142+
docker compose down -v
143+
```
144+
145+
To update the tests, navigate to the tests directory and modify the existing test files or add new ones as needed.
146+
147+
For more information on writing and running Playwright tests, refer to the official [Playwright documentation](https://playwright.dev/docs/intro).

0 commit comments

Comments
 (0)