File tree Expand file tree Collapse file tree 7 files changed +36
-31
lines changed
Expand file tree Collapse file tree 7 files changed +36
-31
lines changed Original file line number Diff line number Diff line change @@ -37,16 +37,12 @@ RUN apt-get install -y libnss3 \
3737 libxss1 \
3838 libasound2
3939
40- RUN mkdir /playwright_tests
41- WORKDIR /playwright_tests
42- COPY * /playwright_tests/
40+ ADD requirements.txt /
4341
4442RUN pip install --upgrade pip && \
4543 pip install virtualenv && \
4644 virtualenv --python=/usr/bin/python3 /opt/venv && \
4745 . /opt/venv/bin/activate && \
4846 python3.7 -m pip install -r requirements.txt --quiet
4947
50- ADD . /playwright_tests
51-
52- CMD . /opt/venv/bin/activate && sh execute_tests.sh
48+ WORKDIR /app
Original file line number Diff line number Diff line change @@ -8,10 +8,12 @@ Just a [Playwright Python](https://github.com/Microsoft/playwright-python) tool
88I didn't enjoy this tool, cause it's very complicated. It totally looks like it just has been translated
99from JS Playwright and need to wright on Python usign JS style. So annoying. But this tools is pretty
1010fast.
11- ###
11+
1212Anyway, I won't recommend this tool to young Python AQA engineers.
1313
1414### [ Video] ( https://drive.google.com/file/d/1K2uUlXASjPOiCbCbYkqmuHN26em7bPHs/view?usp=sharing )
1515
1616## Docker (need to finish)
17- Execute tests - ` run_docker.sh `
17+ Execute tests - ` docker-compose run tests `
18+
19+ Rebuild container - ` docker-compose build --no-cache setup `
Original file line number Diff line number Diff line change 1+ version : ' 3'
2+ services :
3+ tests :
4+ image : playw_python
5+ command : ./execute_tests.sh
6+ depends_on :
7+ - setup
8+ volumes :
9+ - .:/app
10+ setup :
11+ build :
12+ context : .
13+ dockerfile : Dockerfile
14+ image : playw_python
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- rm -r allure-results/*
2+ source venv/bin/activate
3+ echo " Installing dependeincies"
4+ pip install -r requirements.txt --quiet
5+
6+ echo " Removing old Allure results"
7+ rm -r allure-results/* || echo " No results"
8+
39HEADLESS=true
10+
11+ echo " Start tests"
412pytest -n auto tests --alluredir allure-results
13+ echo " Test finished"
514
6- allure generate allure-results --clean -o allure-report
15+ echo " Generating report"
16+ allure generate allure-results --clean -o allure-report
17+ echo " Execute 'allure serve' in the command line"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ def event_loop():
2121
2222@pytest .fixture (scope = 'session' )
2323async def page ():
24- browser = await chromium .launch (headless = os .getenv ('HEADLESS' , False ))
24+ headless = True if os .getenv ('HEADLESS' ).lower () == 'true' else False
25+ browser = await chromium .launch (headless = headless )
2526 page = await browser .newPage ()
2627 global PAGE
2728 PAGE = page
Original file line number Diff line number Diff line change 11import allure
2+ import pytest
23from allure_commons ._allure import step
34
45from page_objects .registation .registration_object import RegistrationPage
You can’t perform that action at this time.
0 commit comments