Skip to content

Improve README description #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 49 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,53 @@
# self-python
python/self testing framework
# Playwright Python Example

## setup
- clone repo
- create python virtual environment: `python -m venv venv`
- activate environment: `source venv/bin/activate`
This project contains UI and API tests for the [DemoQA](https://demoqa.com) QA training platform. Tests are written with [Pytest](https://docs.pytest.org/) and use [Playwright](https://playwright.dev/python/) for browser automation and API requests.

## run tests
- install requirements: `pip install -r requierements.txt`
- run tests: `pytest`
## Setup

## Alternative way of running tests
- `make install`
- `make test`, `make-test-ui` etc. (see [Makefile](./Makefile))
1. Clone this repository.
2. Create and activate a virtual environment:
```bash
python -m venv venv
source venv/bin/activate
```
3. Install dependencies and Playwright browsers:
```bash
pip install -r requirements.txt
playwright install --with-deps
```
4. Copy `.env.example` to `.env` and adjust the `DOMAIN` variable if needed.

## misc
- after running `make test` reports will be generated under [reports](./reports) folder
## Running tests

To run all tests use `pytest`:

```bash
pytest
```

You can run specific test types using markers:

```bash
pytest -m ui # run UI tests only
pytest -m api # run API tests only
```

The provided `Makefile` offers shortcuts:

```bash
make install # install dependencies
make test # run tests and generate reports
```

### Reports

After running `make test` reports are stored in the `reports` directory (HTML under `reports/html` and JUnit XML under `reports/xml`).

## Docker

A `Dockerfile` is available to execute the tests inside a container:

```bash
docker build -t playwright-tests .
docker run --rm playwright-tests
```
Loading