Skip to content

Commit a587089

Browse files
author
Roman Pobotin
authored
Complete Test Framework Overhaul: POM Architecture, Custom HTML Reporter, and Advanced Testing Features (#2)
* Refactor page object structure and add base components for Playwright tests * Refactor project structure, update Python version to 3.12, and enhance test organization with new page objects * Update pylint configuration to use the correct command and ignore virtual environment * Update CI configuration and requirements to streamline dependency installation * Add virtual environment setup to CI configuration * Update CI configuration to install dependencies with system site packages * Update headless mode condition to include GITHUB_RUN environment variable * Update pytest command to run tests directory explicitly
1 parent 21acebe commit a587089

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10827
-350
lines changed

.github/pull_request_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@
1717
### Notes:
1818
- @Goraved should be added to the assignees;
1919
- Tests should be passed;
20-
- Linter should be passed.

.github/workflows/pylint.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/pytest.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: [ 3.8 ]
11+
python-version: [ 3.12 ]
1212

1313
steps:
1414
- uses: actions/checkout@v2
@@ -18,13 +18,14 @@ jobs:
1818
python-version: ${{ matrix.python-version }}
1919
- name: Install dependencies
2020
run: |
21+
curl -LsSf https://astral.sh/uv/install.sh | sh
2122
python -m pip install --upgrade pip
2223
pip install flake8 pytest
23-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
24+
if [ -f requirements.txt ]; then uv pip install -r requirements.txt --upgrade --system; fi
2425
- name: Install browsers
2526
run: python -m playwright install
2627
- name: Test with pytest
2728
env:
2829
GITHUB_RUN: True
2930
run: |
30-
pytest
31+
pytest tests

.pre-commit-config.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.5.0
4+
hooks:
5+
# Run the linter.
6+
- id: ruff
7+
args: [ --fix ]
8+
9+
- repo: local
10+
hooks:
11+
- id: code-smell-check
12+
name: Check code smells in pytest tests
13+
entry: bash
14+
language: system
15+
pass_filenames: false
16+
args:
17+
- "-c"
18+
- |
19+
# Run analysis
20+
output=$(python utils/code_smells.py --dir=tests)
21+
22+
echo "$output"
23+
24+
percentage=$(echo "$output" | grep "Percentage of 'smelly' tests: " | awk '{print $5}' | sed 's/%//')
25+
26+
# Check if percentage is numeric
27+
if ! [[ "$percentage" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then
28+
echo "Failed to determine the percentage of 'smelly' tests. Make sure the output contains the expected line."
29+
exit 1
30+
fi
31+
32+
# Now safely compare - if percentage is 50% or higher, block the commit
33+
result=$(echo "$percentage >= 50" | bc)
34+
if [ "$result" -eq 1 ]; then
35+
echo "Too many 'smelly' tests (${percentage}%). Commit blocked!"
36+
exit 1
37+
else
38+
echo "Acceptable level of 'smelly' tests (${percentage}%). Commit allowed."
39+
fi
40+
41+
always_run: true
42+
verbose: true
43+
44+
- id: framework-unit-tests
45+
name: Run framework unit tests
46+
entry: pytest
47+
language: system
48+
pass_filenames: false
49+
args: [
50+
"-m unit",
51+
"-v"
52+
]
53+
always_run: true
54+
verbose: true

.pylintrc

Lines changed: 0 additions & 8 deletions
This file was deleted.

Dockerfile

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)