From 575fa6a51da63b85710ca537c91f636121cd4c06 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Fri, 16 Aug 2024 13:13:23 +0500 Subject: [PATCH 1/2] LT mobile configs --- .github/workflows/LT_android_workflow.yml | 2 +- .github/workflows/LT_ios_workflow.yml | 135 ++++++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/LT_ios_workflow.yml diff --git a/.github/workflows/LT_android_workflow.yml b/.github/workflows/LT_android_workflow.yml index 2f7b60f3..c4dfe1ce 100644 --- a/.github/workflows/LT_android_workflow.yml +++ b/.github/workflows/LT_android_workflow.yml @@ -120,7 +120,7 @@ jobs: source $HOME/.bp-venv/bin/activate python -m pytest -v --driver Appium \ --selenium-host '${{secrets.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@hub.lambdatest.com' \ - --variables './env_configs/android_mobile_LT.json' \ + --variables './env_configs/lamdatest/android_mobile_LT.json' \ --tags="$TAGS" --html=report.html \ --self-contained-html diff --git a/.github/workflows/LT_ios_workflow.yml b/.github/workflows/LT_ios_workflow.yml new file mode 100644 index 00000000..41dac90d --- /dev/null +++ b/.github/workflows/LT_ios_workflow.yml @@ -0,0 +1,135 @@ +name: LT - IOS App Tests + +env: + TAGS: "ios_mobile_tests" + LT_USER: ${{secrets.LT_USERNAME}} + LT_ACCESS_KEY: ${{secrets.LT_ACCESS_KEY}} + USING_ENV: "LAMDATEST" + +on: + schedule: + - cron: '0 19 * * *' + workflow_dispatch: + inputs: + tags: + description: Gherkin Tags + required: true + default: android_mobile_tests + +jobs: + scheduled-regression: + if: github.event_name == 'schedule' + strategy: + max-parallel: 1 + fail-fast: false + matrix: + include: + - name: IOS Mobile + tags: 'android_mobile_tests' + config_file: ./env_configs/lamdatest/ios_mobile_LT.json + html_report: ios-mobile + + name: ${{ matrix.name }} - Regression + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Start Tunnel + uses: LambdaTest/LambdaTest-tunnel-action@v2 + with: + user: ${{secrets.LT_USERNAME}} + accessKey: ${{secrets.LT_ACCESS_KEY}} + tunnelName: "androidPytestTunnel" + verbose: true + + - name: Check out code + uses: actions/checkout@v4 + + - name: Setup dependencies + run: | + sh setup_install.sh + + - name: Run All Tests + run: | + env + source $HOME/.bp-venv/bin/activate + + python -m pytest -v --driver Appium --selenium-host '${{secrets.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@hub.lambdatest.com' \ + --variables ${{ matrix.config_file }} --tags="${{ matrix.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 }} + path: | + ./*.html + ./output/ + ./assets/ + if: ${{ always() }} + + manual-run: + if: github.event_name != 'schedule' + name: Manual - ${{ inputs.tags }} + runs-on: ubuntu-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: Start Tunnel + uses: LambdaTest/LambdaTest-tunnel-action@v2 + with: + user: ${{secrets.LT_USERNAME}} + accessKey: ${{secrets.LT_ACCESS_KEY}} + tunnelName: "iosPytestTunnel" + verbose: true + + - name: Check out code + id: co_code + uses: actions/checkout@v4 + + - name: Setup dependencies + id: setup_dependencies + if: steps.co_code.outcome == 'success' + run: | + sh setup_install.sh + + - name: Run Manual Job 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.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@hub.lambdatest.com' \ + --variables './env_configs/lamdatest/ios_mobile_LT.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: pytest-results + path: | + ./*.html + ./output/ + ./assets/ + if: ${{ always() }} From 1c84509b1e19f23d47ef4da19edb0cb8aa547083 Mon Sep 17 00:00:00 2001 From: tauqirsarwar1 Date: Fri, 16 Aug 2024 13:21:56 +0500 Subject: [PATCH 2/2] LT mobile configs --- env_configs/lamdatest/android_mobile_LT.json | 2 +- env_configs/lamdatest/io_mobile_LT.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/env_configs/lamdatest/android_mobile_LT.json b/env_configs/lamdatest/android_mobile_LT.json index 38d1d854..cd9bfd8a 100644 --- a/env_configs/lamdatest/android_mobile_LT.json +++ b/env_configs/lamdatest/android_mobile_LT.json @@ -6,4 +6,4 @@ "isRealMobile": "True", "app": "lt://APP10160522261723794660137359" } -} +} \ No newline at end of file diff --git a/env_configs/lamdatest/io_mobile_LT.json b/env_configs/lamdatest/io_mobile_LT.json index 12049064..0f27a83d 100644 --- a/env_configs/lamdatest/io_mobile_LT.json +++ b/env_configs/lamdatest/io_mobile_LT.json @@ -4,6 +4,6 @@ "deviceName": "iPhone 15 Plus", "platformVersion": "17", "isRealMobile": "True", - "app": "lt://APP10160522261723794660137359" + "app": "lt://APP10160502001723796357350632" } }