This repository contains Playwright end-to-end (E2E) tests for the R.A.C.E website which will eventually become https://race.social. These tests are designed to ensure the core functionality and user experience of the website remain intact throughout development.
I'm happy to answer questions, collaborate, or hear your feedback!
- Email: jason@race.social
- GitHub: Chromeshades
- LinkedIn: Jason Brown
- Page Object Model: Organizes tests for better maintainability and readability.
- Fixtures: Sets up consistent test data and environments.
- TypeScript: Provides type safety and improved code structure.
- GitHub Actions: Automates test execution on every code change.
-
Clone the repository:
git clone https://github.com/Chromeshades/race-official-playwright.git cd race-official-playwright
-
Install dependencies:
npm install npx playwright install chromium # This downloads the Chromium browser needed for testing.
-
Write tests:
- Place tests in the
specs
directory. - Follow the page object model structure for consistency.
- Use fixtures to manage test data.
- Place tests in the
-
Run tests:
npx playwright test
You can also run tests in headed mode (with a visible browser):
Bash
npx playwright test --headed
-
View test report:
- After running tests, Playwright generates a report in HTML format.
- playwright.config.ts: Modify this file to customize your test environment, set browser options, and configure other settings.
- fixtures: Store your test fixtures here.
- page: Store your page objects here.
This repository uses GitHub Actions to automatically run tests on pull requests. Check the .github/workflows
directory for details on the workflow configuration.
- Keep tests focused: Test one specific feature or user flow per test.
- Name tests descriptively: Use clear, meaningful names for your test cases.
- Use assertions wisely: Make sure your tests verify the expected outcomes.
- Regularly update tests: As the website evolves, keep your tests up-to-date.
If you'd like to contribute to this project, please fork the repository and submit a pull request.
This project is a work in progress and intended for educational purposes. The tests may not cover all aspects of the Race Social website.