From 89877411537d1ddd73214266ffd3f28eb901cd05 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 16:43:04 +0500 Subject: [PATCH 01/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 158be6a6..e08d2df7 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -1,7 +1,7 @@ name: Docker Android Tests Workflow env: - TAGS: "ios_mobile_test" + TAGS: "android_mobile_test" USING_DOCKER: 'True' on: @@ -104,17 +104,17 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - - name: AVD cache - uses: actions/cache@v4 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd-29 +# - name: AVD cache +# uses: actions/cache@v4 +# id: avd-cache +# with: +# path: | +# ~/.android/avd/* +# ~/.android/adb* +# - name: create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' +# if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 From 91b1b607f04fae3e629e9a82324f6cb8f3b68757 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 16:49:26 +0500 Subject: [PATCH 02/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index e08d2df7..25a61ec9 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -117,7 +117,7 @@ jobs: # if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 29 + api-level: 27 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -127,7 +127,7 @@ jobs: id: start_emulator uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 29 + api-level: 27 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true From e0d230a1997e51fe8b725471f66a22eb3f1ecf56 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 16:59:56 +0500 Subject: [PATCH 03/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 25a61ec9..5994cf3e 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -119,7 +119,7 @@ jobs: with: api-level: 27 force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-window -gpu -grpc-use-jwt swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false script: echo "Generated AVD snapshot for caching." @@ -129,7 +129,7 @@ jobs: with: api-level: 27 force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true - name: Setup dependencies From 2e5877ad1ee392be3965b01e9b11f303a9004b01 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:09:04 +0500 Subject: [PATCH 04/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 5994cf3e..38cbb744 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -117,7 +117,7 @@ jobs: # if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 27 + api-level: 34 force-avd-creation: false emulator-options: -no-window -gpu -grpc-use-jwt swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -127,7 +127,7 @@ jobs: id: start_emulator uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 27 + api-level: 34 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true From b59dcdf30fb40b0c423c477892c68bdcec2d14d5 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:12:11 +0500 Subject: [PATCH 05/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 38cbb744..caa90587 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -117,7 +117,7 @@ jobs: # if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 34 + api-level: 25 force-avd-creation: false emulator-options: -no-window -gpu -grpc-use-jwt swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -127,7 +127,7 @@ jobs: id: start_emulator uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 34 + api-level: 25 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true From 3b8d91dc4cd67e2af410ddc0041067ba3ca86a3c Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:15:35 +0500 Subject: [PATCH 06/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index caa90587..789eabd8 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -67,7 +67,7 @@ jobs: docker-manual-android-run: if: github.event_name != 'schedule' name: Manual - ${{ inputs.tags }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Validate Input Parameter id: validate_input @@ -117,7 +117,7 @@ jobs: # if: steps.avd-cache.outputs.cache-hit != 'true' uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 25 + api-level: 29 force-avd-creation: false emulator-options: -no-window -gpu -grpc-use-jwt swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false @@ -127,7 +127,7 @@ jobs: id: start_emulator uses: reactivecircus/android-emulator-runner@v2 with: - api-level: 25 + api-level: 29 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true From 55d48b32c182db105b16a0264f829ee3843df160 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:18:25 +0500 Subject: [PATCH 07/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 789eabd8..61dbf188 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -98,11 +98,11 @@ jobs: sleep 5 appium -v - - name: Enable KVM - run: | - echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules - sudo udevadm control --reload-rules - sudo udevadm trigger --name-match=kvm +# - name: Enable KVM +# run: | +# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules +# sudo udevadm control --reload-rules +# sudo udevadm trigger --name-match=kvm # - name: AVD cache # uses: actions/cache@v4 From 6b1b8176191fc13eec25ad2cd8fc713340486e83 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:24:13 +0500 Subject: [PATCH 08/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 38 +++---------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 61dbf188..ca06c073 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -98,39 +98,13 @@ jobs: sleep 5 appium -v -# - name: Enable KVM -# run: | -# echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules -# sudo udevadm control --reload-rules -# sudo udevadm trigger --name-match=kvm - -# - name: AVD cache -# uses: actions/cache@v4 -# id: avd-cache -# with: -# path: | -# ~/.android/avd/* -# ~/.android/adb* -# - - - name: create AVD and generate snapshot for caching -# if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 + - name: Run connected tests + uses: ReactiveCircus/android-emulator-runner@v2 with: - api-level: 29 - force-avd-creation: false - emulator-options: -no-window -gpu -grpc-use-jwt swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." - - - name: start emulator - id: start_emulator - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 29 - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true + api-level: 30 + target: google_apis + arch: x86_64 + script: ./gradlew connectedCheck - name: Setup dependencies id: setup_dependencies From 21c1bdc4ab091c600b6567b7a459175b97902b11 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:33:21 +0500 Subject: [PATCH 09/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index ca06c073..054e5b90 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -101,10 +101,9 @@ jobs: - name: Run connected tests uses: ReactiveCircus/android-emulator-runner@v2 with: - api-level: 30 + api-level: 29 target: google_apis arch: x86_64 - script: ./gradlew connectedCheck - name: Setup dependencies id: setup_dependencies From 9e8a16d7adc14a421dda1c108fabd6dd8856f7e2 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:43:57 +0500 Subject: [PATCH 10/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 30 ++++++++++--------- android_local_run.sh | 5 ++++ 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100755 android_local_run.sh diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 054e5b90..24debe64 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -89,6 +89,20 @@ jobs: if: steps.setup_python.outcome == 'success' uses: actions/checkout@v4 + - name: Setup dependencies + id: setup_dependencies + if: steps.co_code.outcome == 'success' + run: | + sh install.sh + + - name: Setup Java + id: setup_java + if: steps.setup_dependencies.outcome == 'success' + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Install and Run Appium Server id: setup_appium if: steps.co_code.outcome == 'success' @@ -101,23 +115,11 @@ jobs: - name: Run connected tests uses: ReactiveCircus/android-emulator-runner@v2 with: - api-level: 29 + api-level: 30 target: google_apis arch: x86_64 +# script: ./android_local_run.sh - - name: Setup dependencies - id: setup_dependencies - if: steps.co_code.outcome == 'success' - run: | - sh install.sh - - - name: Setup Java - id: setup_java - if: steps.co_code.outcome == 'success' - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - name: Run Env Job Tests id: run_manual_job diff --git a/android_local_run.sh b/android_local_run.sh new file mode 100755 index 00000000..fbef14fe --- /dev/null +++ b/android_local_run.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +# Run API tests +python -m pytest -v -s --disable-warnings --gherkin-terminal-reporter --driver=Appium --html="./output/reports/" --self-contained-html \ +--variables="configs/android_mobile_docker.json" --reruns 1 --reruns-delay 2 --tags="android_mobile_tests" \ No newline at end of file From f46f0730465a136b156a2a10b16289c45813bef8 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:51:42 +0500 Subject: [PATCH 11/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 24debe64..4ce3abf8 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -89,41 +89,42 @@ jobs: if: steps.setup_python.outcome == 'success' uses: actions/checkout@v4 - - name: Setup dependencies - id: setup_dependencies - if: steps.co_code.outcome == 'success' - run: | - sh install.sh - - - name: Setup Java + - name: Set up JDK 11 id: setup_java - if: steps.setup_dependencies.outcome == 'success' - uses: actions/setup-java@v4 + if: steps.co_code.outcome == 'success' + uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: '21' + java-version: 11 + distribution: 'adopt' + cache: 'gradle' - name: Install and Run Appium Server id: setup_appium - if: steps.co_code.outcome == 'success' + if: steps.setup_java.outcome == 'success' run: | npm install -g appium appium --log-level info & sleep 5 appium -v - - name: Run connected tests + - name: Run Emulator + id: run_emulator uses: ReactiveCircus/android-emulator-runner@v2 with: api-level: 30 target: google_apis arch: x86_64 -# script: ./android_local_run.sh + script: ./gradlew connectedCheck + - name: Setup dependencies + id: setup_dependencies + if: steps.run_emulator.outcome == 'success' + run: | + sh install.sh - name: Run Env Job Tests id: run_manual_job - if: steps.start_emulator.outcome == 'success' + if: steps.setup_dependencies.outcome == 'success' run: | TAGS="${{ github.event.inputs.tags }}" env From 1d05049cbecdaef36b1037fd21799db60acd2e44 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 17:52:51 +0500 Subject: [PATCH 12/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 4ce3abf8..fd1ca993 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -112,7 +112,7 @@ jobs: uses: ReactiveCircus/android-emulator-runner@v2 with: api-level: 30 - target: google_apis + target: default arch: x86_64 script: ./gradlew connectedCheck From 3420f4e22fc0fa8bde3a6c469714929fc2079401 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 18:01:36 +0500 Subject: [PATCH 13/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index fd1ca993..612df7b9 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -112,9 +112,12 @@ jobs: uses: ReactiveCircus/android-emulator-runner@v2 with: api-level: 30 + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true target: default arch: x86_64 - script: ./gradlew connectedCheck + script: echo "Generated AVD" - name: Setup dependencies id: setup_dependencies From 00f8d5ffa0cfc0f4f1764ccb176c402898b35088 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 18:01:55 +0500 Subject: [PATCH 14/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 612df7b9..d83b2cbf 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -96,7 +96,6 @@ jobs: with: java-version: 11 distribution: 'adopt' - cache: 'gradle' - name: Install and Run Appium Server id: setup_appium From 3656c53494bd1736836e37f7bc9a84c4e04820bd Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 18:02:21 +0500 Subject: [PATCH 15/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index d83b2cbf..03011a00 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -95,7 +95,6 @@ jobs: uses: actions/setup-java@v3 with: java-version: 11 - distribution: 'adopt' - name: Install and Run Appium Server id: setup_appium From e01a565d218248efb052f6e3909c43357603dfcf Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 18:03:50 +0500 Subject: [PATCH 16/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 03011a00..8e369d93 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -92,9 +92,10 @@ jobs: - name: Set up JDK 11 id: setup_java if: steps.co_code.outcome == 'success' - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'temurin' + java-version: 21 - name: Install and Run Appium Server id: setup_appium From ae9396b9001b1ffbe00bd4ada8470e7d5f772724 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 18:05:18 +0500 Subject: [PATCH 17/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 8e369d93..751e573e 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -89,7 +89,7 @@ jobs: if: steps.setup_python.outcome == 'success' uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK 21 id: setup_java if: steps.co_code.outcome == 'success' uses: actions/setup-java@v4 From 62c400a404367fed65fb02a1ce0e135ae20645f3 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 19:07:16 +0500 Subject: [PATCH 18/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 751e573e..0e0db209 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -124,7 +124,7 @@ jobs: run: | sh install.sh - - name: Run Env Job Tests + - name: Run Tests id: run_manual_job if: steps.setup_dependencies.outcome == 'success' run: | From c497be6879fa1e9d2449589a3156411efb162fbc Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 19:17:13 +0500 Subject: [PATCH 19/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 2 +- configs/android_mobile_docker.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index 0e0db209..b81eb928 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -1,7 +1,7 @@ name: Docker Android Tests Workflow env: - TAGS: "android_mobile_test" + TAGS: "android_mobile_tests" USING_DOCKER: 'True' on: diff --git a/configs/android_mobile_docker.json b/configs/android_mobile_docker.json index 7edf3918..a57b4fb4 100644 --- a/configs/android_mobile_docker.json +++ b/configs/android_mobile_docker.json @@ -2,7 +2,7 @@ "capabilities": { "browserstack": "False", "deviceName": "emulator-5554", - "platformName": "Android", + "platformName": "android", "app": "app files/builds/Android-MyDemoAppRN.1.3.0.build-244.apk", "noReset": false, "newCommandTimeout": 3600 From a18a9bc9534b1da653d84f05b588db956efceed7 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Tue, 19 Mar 2024 19:20:11 +0500 Subject: [PATCH 20/20] Docker Mobile Android --- .github/workflows/docker_android_workflow.yml | 78 +++++++++++++------ 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker_android_workflow.yml b/.github/workflows/docker_android_workflow.yml index b81eb928..94a6e21b 100644 --- a/.github/workflows/docker_android_workflow.yml +++ b/.github/workflows/docker_android_workflow.yml @@ -12,52 +12,86 @@ on: tags: description: Gherkin Tags required: true - default: android_mobile_test + default: android_mobile_tests jobs: scheduled-regression: if: github.event_name == 'schedule' - strategy: - max-parallel: 1 - fail-fast: false - matrix: - include: - - name: Android Mobile - tags: 'android_mobile_tests' - config_file: ./configs/android_mobile_BS.json - html_report: android-mobile - testrail_configuration_name: 'Samsung Galaxy S23 Ultra' - name: ${{ matrix.name }} - Regression - runs-on: ubuntu-latest + runs-on: macos-latest steps: + - name: Validate Input Parameter + id: validate_input + run: | + if [[ -z "${{ github.event.inputs.tags }}" ]]; then + echo "Invalid input: 'tags' is required but not provided." + exit 1 + fi + - name: Setup Python + id: setup_python + if: steps.validate_input.outcome == 'success' uses: actions/setup-python@v5 with: python-version: "3.9" - name: Check out code + id: co_code + if: steps.setup_python.outcome == 'success' uses: actions/checkout@v4 + - name: Set up JDK 21 + id: setup_java + if: steps.co_code.outcome == 'success' + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + + - name: Install and Run Appium Server + id: setup_appium + if: steps.setup_java.outcome == 'success' + run: | + npm install -g appium + appium --log-level info & + sleep 5 + appium -v + + - name: Run Emulator + id: run_emulator + uses: ReactiveCircus/android-emulator-runner@v2 + with: + api-level: 30 + force-avd-creation: false + emulator-options: -no-snapshot-save -no-window -grpc-use-jwt -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none + disable-animations: true + target: default + arch: x86_64 + script: echo "Generated AVD" + - name: Setup dependencies + id: setup_dependencies + if: steps.run_emulator.outcome == 'success' run: | sh install.sh - - name: Run All Tests + - name: Run Tests + id: run_manual_job + if: steps.setup_dependencies.outcome == 'success' run: | + TAGS="${{ github.event.inputs.tags }}" env - source $HOME/.bp-venv/bin/activate - - python -m pytest -v --driver Appium --selenium-host '${{secrets.BROWSERSTACK_API_USERNAME}}:${{secrets.BROWSERSTACK_ACCESS_KEY}}@hub-cloud.browserstack.com' \ - --variables ${{ matrix.config_file }} --tags="${{ matrix.tags }}" \ - --html=report.html \ - --self-contained-html \ - + source $HOME/.bp-venv/bin/activate + python -m pytest -v --driver Appium --selenium-host 'localhost' --selenium-port '4723' \ + --variables './configs/android_mobile_docker.json' + --tags="$TAGS" \ + --html=report.html \ + --self-contained-html \ - name: Upload HTML run report in the Artifacts Folder uses: actions/upload-artifact@v4 with: - name: ${{ matrix.html_report }} + name: pytest-results path: | ./*.html ./output/