Skip to content

Commit d38cdbc

Browse files
Version 2.4.0 (#59)
1 parent 95307f2 commit d38cdbc

402 files changed

Lines changed: 3437 additions & 1383 deletions

File tree

Some content is hidden

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

.github/actions/setup/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 'Setup Environment'
2+
description: 'Set up tests and extract tox environment variable'
3+
4+
inputs:
5+
python-version:
6+
description: 'Python version for tox environment'
7+
required: true
8+
9+
outputs:
10+
tox-env:
11+
description: 'Extracted tox environment variable'
12+
value: ${{ steps.extract-tox-env.outputs.tox_env }}
13+
14+
runs:
15+
using: 'composite'
16+
steps:
17+
18+
- name: Set up Python ${{ inputs.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ inputs.python-version }}
22+
23+
- name: Setup Tox
24+
shell: bash
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install tox==3.28.0
28+
29+
- name: Extract tox env
30+
id: extract-tox-env
31+
shell: bash
32+
run: |
33+
tox_env_variable=$(echo "${{ inputs.python-version }}" | sed -E 's/^([0-9]+)\.([0-9]+)(\..*)?/\1\2/')
34+
echo "tox_env=${tox_env_variable}" >> $GITHUB_OUTPUT
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Teardown'
2+
description: 'Handle test results and upload artifacts'
3+
4+
inputs:
5+
browser-name:
6+
description: 'Browser name used in tests'
7+
required: true
8+
tox-env:
9+
description: 'Tox environment variable'
10+
required: true
11+
engine:
12+
description: 'Tests engine'
13+
required: true
14+
15+
runs:
16+
using: 'composite'
17+
steps:
18+
- name: Upload Allure Report as Artifact
19+
uses: actions/upload-artifact@v4
20+
with:
21+
name: allure-report-${{ inputs.browser-name }}-${{ inputs.engine }}-${{ inputs.tox-env }}
22+
path: allure-report
23+
retention-days: 1
24+
25+
- name: Print Appium Logs on Failure
26+
if: ${{ inputs.engine == 'appium' }}
27+
shell: bash
28+
run: |
29+
echo "=== Appium Logs ==="
30+
cat appium.log
31+
32+
- name: Check Test Results
33+
shell: bash
34+
run: |
35+
echo "❌ Tests failed! Please check the pytest output in the step above for details."
36+
exit 1
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Appium Android Chrome Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
android-tests:
10+
runs-on: ubuntu-24.04
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Environment
17+
id: setup
18+
uses: ./.github/actions/setup
19+
with:
20+
python-version: '3.8'
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '22.12.0'
25+
26+
- name: Install Appium & UiAutomator2 Driver
27+
run: |
28+
npm install -g npm@10.9.0
29+
npm install -g appium@2.14.0
30+
appium driver install uiautomator2@3.9.0
31+
# npm install -g appium-doctor # Uncomment for debug
32+
# appium-doctor # Uncomment for debug
33+
34+
- name: Start Appium Server in the Background
35+
run: |
36+
nohup appium --allow-insecure chromedriver_autodownload > appium.log 2>&1 &
37+
38+
- name: Enable KVM
39+
run: |
40+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
41+
sudo udevadm control --reload-rules
42+
sudo udevadm trigger --name-match=kvm
43+
44+
# https://github.com/ReactiveCircus/android-emulator-runner
45+
- uses: reactivecircus/android-emulator-runner@v2.33.0
46+
name: Android Tests
47+
id: tests
48+
continue-on-error: true
49+
with:
50+
script: tox -e py38-android-web -- -v --alluredir=allure-report -m='not low' --reruns=2
51+
api-level: 33
52+
target: google_apis
53+
arch: x86_64
54+
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim
55+
56+
- name: Teardown (Allure Report and Error Handling)
57+
if: ${{ steps.tests.outcome == 'failure' }}
58+
uses: ./.github/actions/teardown
59+
with:
60+
browser-name: "chrome"
61+
tox-env: "38"
62+
engine: "appium"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Appium iOS Safari Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
ios-tests:
10+
runs-on: macos-15
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Environment
17+
id: setup
18+
uses: ./.github/actions/setup
19+
with:
20+
python-version: '3.8'
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '22.12.0'
25+
26+
- name: Install Appium & UiAutomator2 Driver
27+
run: |
28+
npm install -g npm@10.9.0
29+
npm install -g appium@2.14.0
30+
appium driver install xcuitest@7.35.1
31+
32+
- name: Start Appium Server in the Background
33+
run: |
34+
nohup appium > appium.log 2>&1 &
35+
36+
- name: Run Appium Safari tests
37+
id: tests
38+
run: |
39+
tox -e py38-ios-web -- -v --alluredir=allure-report -m='not low' --reruns=2
40+
continue-on-error: true
41+
42+
- name: Teardown (Allure Report and Error Handling)
43+
if: ${{ steps.tests.outcome == 'failure' }}
44+
uses: ./.github/actions/teardown
45+
with:
46+
browser-name: "safari"
47+
tox-env: "38"
48+
engine: "appium"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update Screenshot References
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commit_sha:
7+
description: 'Commit sha for artifacts lookup'
8+
required: true
9+
10+
jobs:
11+
screenshots_updating:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
persist-credentials: false
18+
token: ${{ secrets.PAT }}
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.8'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install Pillow==9.4.0 requests==2.32.3
29+
30+
- name: Run script
31+
run: |
32+
python tests/adata/pull_ci_artifacts.py ${{ github.event.inputs.commit_sha }} -t ${{ secrets.PAT }}
33+
34+
- name: Configure Git
35+
run: |
36+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
37+
git config --global user.name "GitHub Actions"
38+
39+
- name: Commit changes
40+
run: |
41+
git add .
42+
git commit -m "Screenshots updated for ${{ github.event.inputs.commit_sha }}" || echo "No changes to commit"
43+
44+
- name: Set up Git for authentication
45+
run: |
46+
git config --global url."https://${{ secrets.PAT }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
47+
48+
- name: Push changes
49+
run: |
50+
git push origin ${{ github.ref }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Playwright Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
playwright-docker:
10+
runs-on: ubuntu-24.04
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
browser-name: [ "chrome", "firefox", "safari" ]
16+
python-version: [ "3.8", "3.12.7" ] # 3.12.8 (latest) Throws unexpected error inside container
17+
18+
container:
19+
image: mcr.microsoft.com/playwright/python:v1.41.0-jammy
20+
options: --ipc=host
21+
22+
steps:
23+
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Environment
28+
id: setup
29+
uses: ./.github/actions/setup
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
# Needed for Firefox
34+
- name: Set HOME to /root
35+
run: |
36+
echo "HOME=/root" >> $GITHUB_ENV
37+
38+
- name: Run Playwright ${{ matrix.browser-name }} tests with py${{ matrix.python-version }}
39+
id: tests
40+
run: |
41+
tox -e py${{ steps.setup.outputs.tox-env }}-playwright-${{ matrix.browser-name }} -- --headless -v --alluredir=allure-report --reruns=2
42+
continue-on-error: true
43+
44+
- name: Teardown (Allure Report and Error Handling)
45+
if: ${{ steps.tests.outcome == 'failure' }}
46+
uses: ./.github/actions/teardown
47+
with:
48+
browser-name: ${{ matrix.browser-name }}
49+
tox-env: ${{ steps.setup.outputs.tox-env }}
50+
engine: "playwright"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Selenium Safari Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Trigger on push to any branch
7+
8+
jobs:
9+
selenium-safari:
10+
runs-on: macos-13
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: [ "3.8", "3.12" ]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Environment
22+
id: setup
23+
uses: ./.github/actions/setup
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Enable Safari Remote Automation
28+
run: |
29+
safaridriver --version
30+
sudo safaridriver --enable
31+
32+
- name: Run Selenium Safari tests with py${{ matrix.python-version }}
33+
id: tests
34+
run: |
35+
tox -e py${{ steps.setup.outputs.tox-env }}-selenium-safari -- -v --alluredir=allure-report --reruns=2 -m='not low'
36+
continue-on-error: true
37+
38+
- name: Teardown (Allure Report and Error Handling)
39+
if: ${{ steps.tests.outcome == 'failure' }}
40+
uses: ./.github/actions/teardown
41+
with:
42+
browser-name: "safari"
43+
tox-env: ${{ steps.setup.outputs.tox-env }}
44+
engine: "selenium"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Selenium Selenoid Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Trigger on push to any branch
7+
8+
jobs:
9+
selenium-selenoid:
10+
runs-on: ubuntu-24.04
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
image: [ "selenoid/chrome:128.0", "selenoid/firefox:125.0"]
16+
python-version: [ "3.8", "3.12" ]
17+
18+
services:
19+
selenoid:
20+
image: ${{ matrix.image }}
21+
options: --privileged --memory=4g
22+
ports:
23+
- 4444:4444
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Environment
30+
id: setup
31+
uses: ./.github/actions/setup
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Extract Browser Name
36+
run: |
37+
browser_name=$(echo "${{ matrix.image }}" | sed -E 's|.*/([^:]+):.*|\1|')
38+
echo "BROWSER=${browser_name}" >> $GITHUB_ENV
39+
40+
- name: Run Selenium ${{ env.BROWSER }} tests with py${{ matrix.python-version }}
41+
id: tests
42+
run: |
43+
tox -e py${{ steps.setup.outputs.tox-env }}-selenium-${{ env.BROWSER }} -- --env remote --headless -v --alluredir=allure-report --reruns=2
44+
continue-on-error: true
45+
46+
- name: Teardown (Allure Report and Error Handling)
47+
if: ${{ steps.tests.outcome == 'failure' }}
48+
uses: ./.github/actions/teardown
49+
with:
50+
browser-name: ${{ env.BROWSER }}
51+
tox-env: ${{ steps.setup.outputs.tox-env }}
52+
engine: "selenium"

0 commit comments

Comments
 (0)