Skip to content

About example repo to showcase integration of playwright and pytest with testbeats

License

Notifications You must be signed in to change notification settings

test-results-reporter/example-playwright-pytest-testbeats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Playwright Pytest Project with TestBeats Integration

This is an example project demonstrating how to run Playwright tests with Pytest and report results, presumably to TestBeats.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
  2. Create a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate
  3. Install dependencies: This project uses uv for dependency management.

    uv sync pyproject.toml
  4. Install Playwright browsers:

    playwright install

Running Tests

To run the tests, use Pytest:

pytest --output=reports --screenshot=only-on-failure --junitxml=reports/junit.xml

This will execute the tests found in files like test_example.py.

Reporting Results to TestBeats

This project is configured to generate a JUnit XML report, which is a common format for test reporting tools like TestBeats.

  1. Generate JUnit XML report: Pytest can generate a JUnit XML report using the --junitxml flag.

    pytest --junitxml=reports/junit.xml

    Make sure the reports directory exists, or create it:

    mkdir -p reports
  2. Upload to TestBeats: The method for uploading reports/junit.xml to TestBeats depends on your specific TestBeats setup. This typically involves:

    • Using a TestBeats CLI tool.
    • A CI/CD integration that automatically picks up the report.

    Please refer to the TestBeats documentation for the specific command or procedure to upload the JUnit XML file.

    Example (conceptual - replace with actual TestBeats command):

    npx testbeats@latest publish --slack <slack-webhook-url> --junit reports/junit.xml

Contributing

Please feel free to submit issues and pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details, which mentions TestBeats.

About

About example repo to showcase integration of playwright and pytest with testbeats

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages