You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Pets workshop
2
2
3
-
This repository contains the project for two guided workshops to explore various GitHub features. The project is a website for a fictional dog shelter, with a [Flask](https://flask.palletsprojects.com/en/stable/) backend using [SQLAlchemy](https://www.sqlalchemy.org/) and [Astro](https://astro.build/) frontend using [Svelte](https://svelte.dev/) for dynamic pages.
3
+
This repository contains the project for two guided workshops to explore various GitHub features. The project is a website for a fictional dog shelter, with a [Flask](https://flask.palletsprojects.com/en/stable/) backend using [SQLAlchemy](https://www.sqlalchemy.org/) and an [Astro](https://astro.build/) frontend using [Tailwind CSS](https://tailwindcss.com/).
Copy file name to clipboardExpand all lines: client/e2e-tests/README.md
+22-6Lines changed: 22 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,11 @@ Make sure you have installed dependencies:
18
18
npm install
19
19
```
20
20
21
+
You also need Python 3 with Flask dependencies installed:
22
+
```bash
23
+
pip install -r ../server/requirements.txt
24
+
```
25
+
21
26
### Running Tests
22
27
23
28
```bash
@@ -34,33 +39,44 @@ npm run test:e2e:headed
34
39
npm run test:e2e:debug
35
40
```
36
41
42
+
## Test Architecture
43
+
44
+
Tests run against the real Flask server with a separate test database seeded with deterministic data. When Playwright starts, it:
45
+
46
+
1. Seeds a test database (`server/e2e_test_dogshelter.db`) with known dogs and breeds
47
+
2. Starts the Flask server using the test database
48
+
3. Starts the Astro dev server pointing at the Flask server
49
+
4. Runs all e2e tests against the live application
50
+
51
+
The test data is defined in `server/utils/seed_test_database.py`.
52
+
37
53
## Test Coverage
38
54
39
55
The tests cover the following core functionality:
40
56
41
57
### Homepage Tests
42
58
- Page loads with correct title and content
43
59
- Dog list displays properly
44
-
- Loading states work correctly
45
-
- Error handling for API failures
46
60
47
61
### About Page Tests
48
62
- About page content displays correctly
49
63
- Navigation back to homepage works
50
64
51
65
### Dog Details Tests
52
66
- Navigation from homepage to dog details
67
+
- Full dog details display correctly
53
68
- Navigation back from dog details to homepage
54
69
- Handling of invalid dog IDs
55
70
56
71
### API Integration Tests
57
-
- Successful API responses
58
-
- Empty dog list handling
59
-
- Network error handling
72
+
- Dogs render correctly on the homepage
73
+
- Dog details render correctly
74
+
- 404 handling for non-existent dogs
75
+
- Navigation from card to detail page
60
76
61
77
## Configuration
62
78
63
-
Tests are configured in `../playwright.config.ts` and automatically start the application servers using the existing `scripts/start-app.sh` script before running tests.
79
+
Tests are configured in `../playwright.config.ts` and automatically start the Flask and Astro servers before running tests.
0 commit comments