This directory contains the Playwright test suite for Situ E. Chen's website. Follow these steps to run the tests locally.
- Node.js (version 14 or higher)
- npm (comes with Node.js)
-
Navigate to the tests directory:
cd tests -
Install dependencies:
npm install
-
Install Playwright browsers:
npx playwright install
There are several ways to run the tests:
-
Run all tests in headless mode:
npm test -
Run tests with UI mode (recommended for debugging):
npm run test:ui
-
Run tests in debug mode:
npm run test:debug
-
Run tests in headed mode (browser visible):
npm run test:headed
homepage.spec.ts: Tests for the homepageblog.spec.ts: Tests for the blog pagecontact.spec.ts: Tests for the contact page
Test results and reports are stored in the test-results directory. After running tests, you can find:
- Screenshots of failed tests
- Test execution traces
- HTML reports
If you encounter any issues:
- Make sure all dependencies are installed correctly
- Check that you're in the correct directory (tests/)
- Ensure you have the correct Node.js version
- Try clearing the test-results directory and running tests again