Skip to content

Commit 5017295

Browse files
authored
Merge pull request #2 from qa-repos/codex/update-readme-file
Improve README description
2 parents 282061c + f2bb7ce commit 5017295

File tree

1 file changed

+49
-14
lines changed

1 file changed

+49
-14
lines changed

README.md

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
1-
# self-python
2-
python/self testing framework
1+
# Playwright Python Example
32

4-
## setup
5-
- clone repo
6-
- create python virtual environment: `python -m venv venv`
7-
- activate environment: `source venv/bin/activate`
3+
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.
84

9-
## run tests
10-
- install requirements: `pip install -r requierements.txt`
11-
- run tests: `pytest`
5+
## Setup
126

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

17-
## misc
18-
- after running `make test` reports will be generated under [reports](./reports) folder
20+
## Running tests
21+
22+
To run all tests use `pytest`:
23+
24+
```bash
25+
pytest
26+
```
27+
28+
You can run specific test types using markers:
29+
30+
```bash
31+
pytest -m ui # run UI tests only
32+
pytest -m api # run API tests only
33+
```
34+
35+
The provided `Makefile` offers shortcuts:
36+
37+
```bash
38+
make install # install dependencies
39+
make test # run tests and generate reports
40+
```
41+
42+
### Reports
43+
44+
After running `make test` reports are stored in the `reports` directory (HTML under `reports/html` and JUnit XML under `reports/xml`).
45+
46+
## Docker
47+
48+
A `Dockerfile` is available to execute the tests inside a container:
49+
50+
```bash
51+
docker build -t playwright-tests .
52+
docker run --rm playwright-tests
53+
```

0 commit comments

Comments
 (0)