Skip to content

Commit

Permalink
Develop (#157)
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 19, 2024
2 parents 62d2b42 + d7b52d0 commit 64680eb
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/LT_android_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

on:
schedule:
- cron: '0 21 * * *'
- cron: '30 18 * * *'
workflow_dispatch:
inputs:
tags:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
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' \
python -m pytest -v --driver Appium --selenium-host '${{secrets.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@mobile-hub.lambdatest.com' \
--variables ${{ matrix.config_file }} --tags="${{ matrix.tags }}" \
--html=report.html \
--self-contained-html \
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
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' \
--selenium-host '${{secrets.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@mobile-hub.lambdatest.com' \
--variables './env_configs/lamdatest/android_mobile_LT.json' \
--tags="$TAGS" --html=report.html \
--self-contained-html
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/LT_ios_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:

on:
schedule:
- cron: '0 19 * * *'
- cron: '30 20 * * *'
workflow_dispatch:
inputs:
tags:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
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' \
python -m pytest -v --driver Appium --selenium-host '${{secrets.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@mobile-hub.lambdatest.com' \
--variables ${{ matrix.config_file }} --tags="${{ matrix.tags }}" \
--html=report.html \
--self-contained-html \
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
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' \
--selenium-host '${{secrets.LT_USERNAME}}:${{secrets.LT_ACCESS_KEY}}@mobile-hub.lambdatest.com' \
--variables './env_configs/lamdatest/ios_mobile_LT.json' \
--tags="$TAGS" --html=report.html \
--self-contained-html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/LT_ui_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

on:
schedule:
- cron: '0 * * * *'
- cron: '30 22 * * *'
workflow_dispatch:
inputs:
tags:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"capabilities": {
"platformName": "ios",
"platformName": "iOS",
"deviceName": "iPhone 15 Plus",
"platformVersion": "17",
"isRealMobile": "True",
Expand Down
23 changes: 23 additions & 0 deletions main/frontend/frontend_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,29 @@ def driver_kwargs(capabilities, host, port, **kwargs): # noqa

appium.driver_kwargs = driver_kwargs

elif os.environ.get("USING_ENV", "") == 'LAMDATEST' and session_capabilities.get("platformName", "").lower() in (
"android", "ios"):
value, options = driver_options_factory

for k, v in session_capabilities.items():
options.set_capability(k, v)

def driver_kwargs(capabilities, host, port, **kwargs): # noqa
_ = capabilities
if value in ("chrome", "edge", "firefox"):
browser_options = kwargs.get(f"{value}_options", None)
browser_options_arguments = getattr(browser_options, "arguments", [])
browser_options_capabilities = getattr(browser_options, "capabilities", {})
options.capabilities.update(browser_options_capabilities)
options.arguments.extend([x for x in browser_options_arguments if x not in options.arguments])

executor = f"https://{host}/wd/hub"
kwargs = {"command_executor": executor, "options": options}

return kwargs

appium.driver_kwargs = driver_kwargs

# To pass options for local Android and iOS test executions
elif session_capabilities.get("platformName", "").lower() in ("android", "ios"):
value, options = driver_options_factory
Expand Down

0 comments on commit 64680eb

Please sign in to comment.