Skip to content

Commit aba9c7d

Browse files
author
dmy.berezovskyi
committed
Added git hub env description for README.md
1 parent 92d4a27 commit aba9c7d

File tree

3 files changed

+58
-44
lines changed

3 files changed

+58
-44
lines changed

.github/workflows/report.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Report Test Results
2+
3+
on:
4+
workflow_run:
5+
workflows: [ build ]
6+
types: [ completed ]
7+
8+
permissions:
9+
checks: write
10+
11+
jobs:
12+
checks:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Download Test Report
17+
uses: dawidd6/action-download-artifact@v2
18+
with:
19+
name: junit-test-results
20+
workflow: ${{ github.event.workflow.id }}
21+
run_id: ${{ github.event.workflow_run.id }}
22+
23+
- name: Publish Test Report
24+
uses: mikepenz/action-junit-report@v3
25+
with:
26+
commit: ${{ github.event.workflow_run.head_sha }}
27+
report_paths: '**/build/test-results/test/TEST-results.xml'
28+
detailed_summary: true # Include detailed report summary
29+
include_passed: true # Include passed tests in the report
30+
check_name: 'JUnit Test Results'
31+
fail_on_failure: true # Fail the job if there are test failures

.github/workflows/run_tests.yaml

Lines changed: 25 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,44 @@
1-
name: Selenium Tests
1+
name: Build and Run Tests
22

33
on:
4-
workflow_dispatch: # Allows running manually
5-
schedule:
6-
- cron: '0 0 * * *' # Run each day at 00:00 UTC
4+
pull_request:
75

86
jobs:
9-
selenium-tests:
10-
runs-on: macos-latest
11-
env:
12-
DEV_URL: ${{ vars.DEV_URL }}
13-
STAG_URL: ${{ vars.STAG_URL }}
14-
15-
permissions:
16-
checks: write
7+
build:
8+
name: Build and Run Tests
9+
runs-on: ubuntu-latest
1710

1811
steps:
19-
- name: Checkout repository
12+
- name: Checkout Code
2013
uses: actions/checkout@v3
2114

22-
- name: Setup Python
15+
- name: Set up Python
2316
uses: actions/setup-python@v3
2417
with:
2518
python-version: "3.10"
2619

27-
- name: Install Chrome and WebDriver if not already installed
28-
run: |
29-
if ! command -v google-chrome &>/dev/null; then
30-
echo "Installing Chrome"
31-
brew install --cask google-chrome
32-
else
33-
echo "Chrome is already installed"
34-
fi
35-
36-
- name: Install Poetry
37-
run: |
38-
python -m pip install --upgrade pip
39-
pip install poetry
20+
- name: Cache Dependencies
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/.cache/pip
24+
key: python-cache-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
25+
restore-keys: |
26+
python-cache-${{ runner.os }}-
4027
41-
- name: Install dependencies with Poetry
28+
- name: Install Dependencies
4229
run: |
43-
poetry install
30+
python -m pip install --upgrade pip
31+
pip install -r requirements.txt
4432
45-
- name: Run tests
33+
- name: Run Tests
4634
run: |
47-
poetry run pytest --verbose --junit-xml=test-results.xml --capture=tee-sys
48-
49-
- name: Publish Test Report
50-
uses: mikepenz/action-junit-report@v3
51-
if: success() || failure()
52-
with:
53-
report_paths: '**/test-results.xml'
54-
detailed_summary: true
55-
include_passed: true
35+
pytest --junit-xml=build/test-results/test/TEST-results.xml --verbose
36+
continue-on-error: true # Ensures that test results are collected even if some tests fail
5637

57-
- name: Upload Screenshots
58-
if: failure()
38+
- name: Upload Test Report
5939
uses: actions/upload-artifact@v3
40+
if: always() # Always run this step even if tests fail
6041
with:
61-
name: screenshots
62-
path: reports/screenshots/*
42+
name: junit-test-results
43+
path: build/test-results/test/TEST-results.xml
44+
retention-days: 1

.idea/simple-python-selenium-framework.iml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)