From 30546f7c833e9d7159a156a215f56a283905bb48 Mon Sep 17 00:00:00 2001 From: Dor Blayzer <59066376+Dor-bl@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:59:12 +0100 Subject: [PATCH 1/5] Update branches for unit tests workflow --- .github/workflows/unit-tests.yml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..09a3e18e --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,40 @@ +name: Mock Unit Tests + +on: + push: + branches: [ "master"] + pull_request: + branches: [ "master" ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ "3.10", "3.11" ] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + + # 1. Install the library itself (so the tests can import 'AppiumLibrary') + pip install . + + # 2. Install specific test dependencies if they exist + if [ -f utest/requirements.txt ]; then pip install -r utest/requirements.txt; fi + + # 3. Install 'mock' if it's not included in requirements (common for older unit tests) + pip install mock + + - name: Run Mock Tests + # This discovers and runs all Python unit tests in the 'utest' folder + run: python -m unittest discover utest From 9ec01ab69d32b5c686658b9f48a89a952e7c5841 Mon Sep 17 00:00:00 2001 From: Dor Blayzer <59066376+Dor-bl@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:03:34 +0100 Subject: [PATCH 2/5] Update unit tests workflow to use pytest --- .github/workflows/unit-tests.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 09a3e18e..ba3947a0 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -4,7 +4,7 @@ on: push: branches: [ "master"] pull_request: - branches: [ "master" ] + branches: [ "master"] jobs: test: @@ -25,16 +25,14 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip + pip install pytest mock - # 1. Install the library itself (so the tests can import 'AppiumLibrary') + # Install the library itself pip install . - # 2. Install specific test dependencies if they exist if [ -f utest/requirements.txt ]; then pip install -r utest/requirements.txt; fi - - # 3. Install 'mock' if it's not included in requirements (common for older unit tests) - pip install mock - name: Run Mock Tests - # This discovers and runs all Python unit tests in the 'utest' folder - run: python -m unittest discover utest + run: | + # -v gives verbose output so you can see exactly which tests pass/fail + pytest -v utest/ From 4c0bf8f75028c7f4c0d6dfdec4c9ffd73c85ea09 Mon Sep 17 00:00:00 2001 From: Dor Blayzer <59066376+Dor-bl@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:06:41 +0100 Subject: [PATCH 3/5] Include pytest-cov in unit test workflow Added 'pytest-cov' to the dependencies for coverage. --- .github/workflows/unit-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index ba3947a0..f0cd03fe 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -25,7 +25,8 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip - pip install pytest mock + # Added 'pytest-cov' to fix the error + pip install pytest mock pytest-cov # Install the library itself pip install . From b0c1362858de63bc7e9a0a9c28a270d28f5b0462 Mon Sep 17 00:00:00 2001 From: Dor Blayzer <59066376+Dor-bl@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:10:22 +0100 Subject: [PATCH 4/5] Update test directory from 'utest/' to 'tests/' --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f0cd03fe..26b358c2 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -36,4 +36,4 @@ jobs: - name: Run Mock Tests run: | # -v gives verbose output so you can see exactly which tests pass/fail - pytest -v utest/ + pytest -v tests/ From 468b32d8b01fdc6ca3af7af7fc81353d7ecdd197 Mon Sep 17 00:00:00 2001 From: Dor Blayzer <59066376+Dor-bl@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:14:07 +0100 Subject: [PATCH 5/5] Add 'main' branch to unit tests workflow --- .github/workflows/unit-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 26b358c2..5f1032a4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,9 +2,9 @@ name: Mock Unit Tests on: push: - branches: [ "master"] + branches: [ "master", "main"] pull_request: - branches: [ "master"] + branches: [ "master", "main"] jobs: test: