Skip to content

verify Android App Automation Workflow #2

verify Android App Automation Workflow

verify Android App Automation Workflow #2

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: verify Android App Automation Workflow
on:
workflow_dispatch:
jobs:
job_id:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Get current date
id: date
uses: Kaven-Universe/github-action-current-date-time@v1
with:
format: "YYYY-MM-DD"
- name: BrowserStack Env Setup
uses: 'browserstack/github-actions/setup-env@master'
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: Upload iOS App
id: ios_app_upload
uses: fjogeleit/http-request-action@v1
with:
url: https://api-cloud.browserstack.com/app-automate/upload
method: POST
username: ${{ secrets.BROWSERSTACK_USERNAME }}
password: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
data: '{ "custom_id": "SAMPLE_ANDROID_APP" }'
files: '{ "file": "${{ github.workspace }}/src/main/resources/android/apps/wdio.apk" }'
- name: test with Maven
run: mvn clean test "-DreportTitle=Sample Android Automation Test Report" -DrunMode=cloud -Dplatform=android -DsuiteFile=testng.xml
- name: Check Automation report was generated
id: check_files
uses: andstor/file-existence-action@v2
with:
files: "reports/test-suite-report.html"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test_execution_results
path: reports/
- name: send summary report email
uses: dawidd6/action-send-mail@v3
if: always()
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: 'sample Android Automation Test Report - ${{ steps.date.outputs.time }}'
body: Build job of ${{github.repository}} completed successfully.Below is the Result summary. for Complete Details, Download the attached report.
html_body: file://target/surefire-reports/emailable-report.html
to: ${{ secrets.EMAIL_RECIPIENT_LIST }}
cc: ${{ secrets.EMAIL_CC_LIST }}
from: ${{ secrets.EMAIL_USERNAME }}
attachments: reports/test-suite-report.html