Skip to content

Chromeshades/race-official-playwright

Repository files navigation

R.A.C.E Playwright End-to-End Testing

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.

Contact

I'm happy to answer questions, collaborate, or hear your feedback!

Key Features

  • 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.

Getting Started

  1. Clone the repository:

    git clone https://github.com/Chromeshades/race-official-playwright.git
    cd race-official-playwright
    
  2. Install dependencies:

    npm install
    npx playwright install chromium #  This downloads the Chromium browser needed for testing.
    
  3. Write tests:

    • Place tests in the specs directory.
    • Follow the page object model structure for consistency.
    • Use fixtures to manage test data.
  4. Run tests:

    npx playwright test
    

    You can also run tests in headed mode (with a visible browser):

    Bash

    npx playwright test --headed
    
    
  5. View test report:

    • After running tests, Playwright generates a report in HTML format.

Configuration

  • 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.

GitHub Actions

This repository uses GitHub Actions to automatically run tests on pull requests. Check the .github/workflows directory for details on the workflow configuration.

Best Practices

  • 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.

Contributing

If you'd like to contribute to this project, please fork the repository and submit a pull request.

Disclaimer

This project is a work in progress and intended for educational purposes. The tests may not cover all aspects of the Race Social website.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.