Automated tests are the primary verification method for this repository.
- Install Python dependencies:
pip install -r requirements-dev.txt- Run the full suite:
pytest- Run with coverage (same command used in CI):
pytest --cov=application --cov-report=term-missing- tests/conftest.py: shared fixtures (test client, isolated in-memory DB, seed data)
- tests/test_models.py: unit tests for User, Course, Enrollment
- tests/test_routes.py: integration tests for login/register/enrollment/courses
- tests/test_api.py: API endpoint tests for
/apiand/api/<idx>
Use this quick click-through when you want a UI confidence check in addition to pytest:
- Follow the steps in CONTRIBUTING.md, then bring up the environment with
docker compose up -d --build. - Go to home page. The web page should load.
- Go to the courses page. The web page should load and show 5 courses.
- Go to the registration page. The web page should load with a form.
- Fill in the form with some data, and hit "Register Now". You should be redirected to the home page.
- Go to the login page. The web page should load with a login form.
- Fill in the form with the data from earlier, and hit "Login". You should be redirected to the home page.
- Go to the courses page and click "Enroll" for a course. You should be redirected to the enrollment page.
- Click the Logout navigation button and you should be logged out.
The repository includes an automated UI walkthrough that mirrors the manual flow above.
npm install
npx playwright install chromiumdocker compose up -d --builddocker compose run --rm e2e-testsFrom Makefile:
make e2e-dockernpm run e2e:walkthroughFor a faster walkthrough (normal input speed, no extra per-character typing delay):
npm run e2e:walkthrough:fastFrom Makefile:
make e2e-fastFor a viewer-friendly recording pace, use slow motion:
npm run e2e:walkthrough:demoThis executes e2e/ui-walkthrough.spec.js against
http://127.0.0.1:5000.
npm run e2e: all Playwright tests (headless)npm run e2e:headed: all Playwright tests (headed)npm run e2e:report: open HTML test reportdocker compose run --rm e2e-tests: run walkthrough from Docker containernpm run e2e:walkthrough:fast: walkthrough with fast form input (PW_FAST_INPUT=1)npm run e2e:walkthrough:demo: walkthrough withPW_SLOWMO=400for demosmake e2e-docker: Docker-only walkthrough via Makefile targetmake e2e-fast: fast walkthrough via Makefile targetmake e2e-demo: demo walkthrough via Makefile target
Playwright outputs video and trace artifacts under test-results/.
Convert the generated .webm video to GIF:
ffmpeg -i test-results/ui-walkthrough-UI-walkthrough-from-TESTING-md-chromium/video.webm -vf "fps=12,scale=900:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=128[p];[s1][p]paletteuse=dither=bayer:bayer_scale=5" docs/walkthrough.gif