Skip to content

Commit

Permalink
LT mobile configs (#156)
Browse files Browse the repository at this point in the history
### To be filled by the PR creator:

* A brief description of the changes made - 

* Do we have clean latest run report (Docker or Browserstack) attached
with this PR?
  * [ ] Yes
  * [ ] No (Please explain why)

* Does the PR contain changes to any core file?
  * [ ] Yes (Needs approval from at least 1 people)
  * [ ] No

* Is it
  * [ ] New Testcase
  * [ ] Fix


### To be filled by the PR reviewer:

* [ ] Verify the attached run report passed in GitHub Actions (Docker or
Browserstack run)

* General
    * [ ] Use the best strategy to locate the elements
    * [ ] Comments wherever the code is not readable by itself
    * [ ] Use of the right data structure for the use case
    * [ ] Reuse logic/functionality as much as possible
    * [ ] Cleanup of any test data that is generated by the tests
    * [ ] No static waits
  • Loading branch information
tauqirsarwar1 authored Aug 16, 2024
2 parents ecb4d8d + 1c84509 commit 62d2b42
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/LT_android_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
135 changes: 135 additions & 0 deletions .github/workflows/LT_ios_workflow.yml
Original file line number Diff line number Diff line change
@@ -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() }}
2 changes: 1 addition & 1 deletion env_configs/lamdatest/android_mobile_LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"isRealMobile": "True",
"app": "lt://APP10160522261723794660137359"
}
}
}
2 changes: 1 addition & 1 deletion env_configs/lamdatest/io_mobile_LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"deviceName": "iPhone 15 Plus",
"platformVersion": "17",
"isRealMobile": "True",
"app": "lt://APP10160522261723794660137359"
"app": "lt://APP10160502001723796357350632"
}
}

0 comments on commit 62d2b42

Please sign in to comment.