Skip to content

Commit

Permalink
Develop (#63)
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
Tauqir Sarwar authored Mar 22, 2024
2 parents 2c0b190 + e0229ef commit eff2237
Show file tree
Hide file tree
Showing 92 changed files with 473 additions and 437 deletions.
266 changes: 133 additions & 133 deletions .github/workflows/api_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,140 +1,140 @@
name: API Workflow

env:
TAGS: "api"
BROWSERSTACK_USER: ${{secrets.BROWSERSTACK_API_USERNAME}}
BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}}
TAGS: "api"
BROWSERSTACK_USER: ${{secrets.BROWSERSTACK_API_USERNAME}}
BROWSERSTACK_ACCESS_KEY: ${{secrets.BROWSERSTACK_ACCESS_KEY}}

on:
schedule:
- cron: '0 21 * * *'
workflow_dispatch:
inputs:
tags:
description: 'Tags'
required: true
default: 'api'
schedule:
- cron: '0 21 * * *'
workflow_dispatch:
inputs:
tags:
description: 'Tags'
required: true
default: 'api'

jobs:
run-api-test-schedule:
if: github.event_name == 'schedule'
name: API Regression
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Check out code
uses: actions/checkout@v4

- name: Setup dependencies
run: |
sh setup_install.sh
- name: Run tests
run: |
if [ "${{ github.event.inputs.tags }}" != "" ]
then
TAGS="${{ github.event.inputs.tags }}"
fi
source $HOME/.bp-venv/bin/activate
sh local_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Allure Report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_results: allure-results
allure_history: allure-history

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: |
./*.html
./output/
./assets/
if: ${{ always() }}

run-api-test-on-local:
if: github.event_name != 'schedule'
name: API Regression
runs-on: ubuntu-latest
steps:

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Check out code
uses: actions/checkout@v4

- name: Setup dependencies
run: |
sh setup_install.sh
- name: Run tests
run: |
if [ "${{ github.event.inputs.tags }}" != "" ]
then
TAGS="${{ github.event.inputs.tags }}"
fi
source $HOME/.bp-venv/bin/activate
sh local_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Allure Report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_results: allure-results
allure_history: allure-history

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: |
./*.html
./output/
./assets/
if: ${{ always() }}
run-api-test-schedule:
if: github.event_name == 'schedule'
name: API Regression
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Check out code
uses: actions/checkout@v4

- name: Setup dependencies
run: |
sh setup_install.sh
- name: Run tests
run: |
if [ "${{ github.event.inputs.tags }}" != "" ]
then
TAGS="${{ github.event.inputs.tags }}"
fi
source $HOME/.bp-venv/bin/activate
sh ci_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Allure Report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_results: allure-results
allure_history: allure-history

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: |
./*.html
./output/
./assets/
if: ${{ always() }}

run-api-test-on-local:
if: github.event_name != 'schedule'
name: API Regression
runs-on: ubuntu-latest
steps:

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Check out code
uses: actions/checkout@v4

- name: Setup dependencies
run: |
sh setup_install.sh
- name: Run tests
run: |
if [ "${{ github.event.inputs.tags }}" != "" ]
then
TAGS="${{ github.event.inputs.tags }}"
fi
source $HOME/.bp-venv/bin/activate
sh ci_run_api.sh "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}"
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Allure Report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_results: allure-results
allure_history: allure-history

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history

- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: |
./*.html
./output/
./assets/
if: ${{ always() }}
5 changes: 0 additions & 5 deletions .github/workflows/docker_android_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ jobs:
screencapture screenshot.jpg
$ANDROID_HOME/platform-tools/adb exec-out screencap -p > emulator.png
- name: Check out code
id: co_code
if: steps.start_emulator.outcome == 'success'
uses: actions/checkout@v4

- name: Setup dependencies
id: setup_dependencies
if: steps.co_code.outcome == 'success'
Expand Down
66 changes: 50 additions & 16 deletions .github/workflows/ui_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,8 @@ jobs:
- name: Run All Tests
run: |
env
source $HOME/.bp-venv/bin/activate
python -m pytest -v --driver Remote --selenium-host '${{secrets.BROWSERSTACK_API_USERNAME}}:${{secrets.BROWSERSTACK_ACCESS_KEY}}@hub-cloud.browserstack.com' \
--variables ${{ matrix.config_file }} --tags="${{ matrix.tags }}" \
--base-url="${{ matrix.baseurl }}" \
--capability headless False \
--reruns 1 --reruns-delay 5 \
--html=report.html \
--self-contained-html -n ${{ matrix.concurrent_thread }} \
source $HOME/.bp-venv/bin/activate
sh ci_run_web.sh ${{secrets.BROWSERSTACK_API_USERNAME}} ${{secrets.BROWSERSTACK_ACCESS_KEY}} "${{ matrix.config_file }}" "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" "$BASE_URL" $concurrent_thread
# --pytest-testrail-export-test-results \
# --testrail-project-id "${{ env.TESTRAIL_PROJECT_ID }}" \
# --pytest-testrail-test-plan-id "${{ env.TEST_PLAN_ID }}" \
Expand All @@ -183,6 +176,29 @@ jobs:
with:
local-testing: stop
if: ${{ always() }}
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages-1
path: gh-pages-1

- name: Allure Report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages-1
allure_results: allure-results
allure_history: allure-history

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }}
PUBLISH_BRANCH: gh-pages-1
PUBLISH_DIR: allure-history

- name: Upload HTML run report in the Artifacts Folder
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -302,20 +318,38 @@ jobs:
env
source $HOME/.bp-venv/bin/activate
python -m pytest -v --driver Remote \
--selenium-host '${{secrets.BROWSERSTACK_API_USERNAME}}:${{secrets.BROWSERSTACK_ACCESS_KEY}}@hub-cloud.browserstack.com' \
--variables "$BROWSER" \
--capability headless False \
--reruns 1 --reruns-delay 5 \
--tags="$TAGS" --base-url="$BASE_URL" --html=report.html \
--self-contained-html -n $concurrent_thread
sh ci_run_web.sh ${{secrets.BROWSERSTACK_API_USERNAME}} ${{secrets.BROWSERSTACK_ACCESS_KEY}} "$BROWSER" "$TAGS" "${{secrets.SLACK_WEBHOOK_URL}}" "${{secrets.TEAMS_WEBHOOK_URL}}" "$BASE_URL" $concurrent_thread
- name: BrowserStackLocal Stop
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop
if: ${{ always() }}

- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages-1
path: gh-pages-1

- name: Allure Report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages-1
allure_results: allure-results
allure_history: allure-history

- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v3
with:
PERSONAL_TOKEN: ${{ secrets.PYTEST_TOKEN }}
PUBLISH_BRANCH: gh-pages-1
PUBLISH_DIR: allure-history

- name: Upload HTML run report in the Artifacts Folder
uses: actions/upload-artifact@v4
with:
Expand Down
Loading

0 comments on commit eff2237

Please sign in to comment.