Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Merge pull request #425 from admin-ch/release/version-4.10.0 #218

Merge pull request #425 from admin-ch/release/version-4.10.0

Merge pull request #425 from admin-ch/release/version-4.10.0 #218

name: Build Browserstack UI-Test Wallet
on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- main
- 'release/**'
jobs:
build-app-and-upload:
runs-on: ubuntu-latest
outputs:
app-url: ${{ steps.upload-app.outputs.app-url }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build with Gradle
uses: ./.github/actions/gradle_docker
with:
gradle-cmd: wallet:assembleAbnRelease -PkeystorePassword=${{secrets.KEYSTORE_PASSWORD}} -PkeyAliasPassword=${{secrets.KEY_ALIAS_PASSWORD}}
- name: upload artefact to Browserstack
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/app" -F "file=@wallet/build/outputs/apk/abn/release/wallet-abn-release.apk" >> appResponse.json
- id: upload-app
run: echo ::set-output name=app-url::$(jq -r '.app_url' appResponse.json)
build-test-suite-and-upload:
runs-on: ubuntu-latest
outputs:
test-url: ${{ steps.upload-test-suite.outputs.test-url }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build with Gradle
uses: ./.github/actions/gradle_docker
with:
gradle-cmd: wallet:assembleAbnDebugAndroidTest -PkeystorePassword=${{secrets.KEYSTORE_PASSWORD}} -PkeyAliasPassword=${{secrets.KEY_ALIAS_PASSWORD}}
- name: upload artefact to Browserstack
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/test-suite" -F "file=@wallet/build/outputs/apk/androidTest/abn/debug/wallet-abn-debug-androidTest.apk" >> testSuiteResponse.json
- id: upload-test-suite
run: echo ::set-output name=test-url::$(jq -r '.test_suite_url' testSuiteResponse.json)
run-tests:
runs-on: ubuntu-latest
needs: [build-app-and-upload, build-test-suite-and-upload]
steps:
- name: run normal tests
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"app":"${{ needs.build-app-and-upload.outputs.app-url }}", "testSuite":"${{ needs.build-test-suite-and-upload.outputs.test-url }}", "devices":["Samsung Galaxy S10e-9.0"] , "language":"de", "annotation":["ch.admin.bag.covidcertificate.common.browserstack.Normal"] }' -H "Content-Type:application/json"
- name: run airplane tests
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"app":"${{ needs.build-app-and-upload.outputs.app-url }}", "testSuite":"${{ needs.build-test-suite-and-upload.outputs.test-url }}", "devices":["Samsung Galaxy S10e-9.0"] , "networkProfile":"airplane-mode", "annotation":["ch.admin.bag.covidcertificate.common.browserstack.AirplaneMode"] }' -H "Content-Type:application/json"
- name: run bad network tests
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"app":"${{ needs.build-app-and-upload.outputs.app-url }}", "testSuite":"${{ needs.build-test-suite-and-upload.outputs.test-url }}", "devices":["Samsung Galaxy S10e-9.0"] , "networkProfile":"2g-gprs-lossy", "annotation":["ch.admin.bag.covidcertificate.common.browserstack.BadNetwork"] }' -H "Content-Type:application/json"
- name: run onboarding test
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"app":"${{ needs.build-app-and-upload.outputs.app-url }}", "testSuite":"${{ needs.build-test-suite-and-upload.outputs.test-url }}", "devices":["Samsung Galaxy S10e-9.0"] , "language":"de", "annotation":["ch.admin.bag.covidcertificate.common.browserstack.Onboarding"] }' -H "Content-Type:application/json"
- name: run onboarding test offline
run: curl -u ${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESSKEY }} -X Post "https://api-cloud.browserstack.com/app-automate/espresso/v2/build" -d '{"app":"${{ needs.build-app-and-upload.outputs.app-url }}", "testSuite":"${{ needs.build-test-suite-and-upload.outputs.test-url }}", "devices":["Samsung Galaxy S10e-9.0"] , "language":"de", "networkProfile":"airplane-mode", "annotation":["ch.admin.bag.covidcertificate.common.browserstack.Onboarding"] }' -H "Content-Type:application/json"