Skip to content

Commit b60f208

Browse files
authored
[CI] Run BrowserStack tests in a separate job
1 parent cfc81e4 commit b60f208

File tree

1 file changed

+152
-122
lines changed

1 file changed

+152
-122
lines changed

.github/workflows/gradle.yml

Lines changed: 152 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -333,128 +333,6 @@ jobs:
333333
echo No SAUCELABS_USER and/or SAUCELABS_KEY, SauceLabs system tests will be skipped
334334
fi
335335
336-
- name: BrowserStack - Mobile - Web - System tests
337-
if: matrix.platform == 'macos-latest'
338-
env:
339-
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
340-
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
341-
shell: bash
342-
run: |
343-
if [[ -n $BROWSERSTACK_USER && -n $BROWSERSTACK_KEY ]]; then
344-
declare -a profiles=( iphone android )
345-
for profile in "${profiles[@]}"; do
346-
./gradlew :vividus-tests:debugStories -Pvividus.configuration.suites=health_check \
347-
-Pvividus.configuration.profiles=browserstack/web/phone/${profile},web/phone/${profile} \
348-
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
349-
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY}
350-
done
351-
else
352-
echo No BROWSERSTACK_USER and/or BROWSERSTACK_KEY, Browserstack phone system tests will be skipped
353-
fi
354-
355-
- name: BrowserStack - Desktop - Web - System tests
356-
if: matrix.platform == 'macos-latest'
357-
env:
358-
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
359-
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
360-
shell: bash
361-
run: |
362-
if [[ -n $BROWSERSTACK_USER && -n $BROWSERSTACK_KEY ]]; then
363-
declare -a profiles=( iexplore chrome firefox edge safari )
364-
for profile in "${profiles[@]}"; do
365-
./gradlew :vividus-tests:debugStories -Pvividus.configuration.suites=health_check \
366-
-Pvividus.configuration.profiles=browserstack/web,web/desktop/${profile} \
367-
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
368-
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
369-
-Pvividus.selenium.grid.capabilities.bstack\:options.buildName="VIVIDUS BrowserStack Integration Tests"
370-
done
371-
else
372-
echo No BROWSERSTACK_USER and/or BROWSERSTACK_KEY, Browserstack integration tests will be skipped
373-
fi
374-
375-
- name: BrowserStack - iOS - Mobile App - Run system tests
376-
if: matrix.platform == 'macos-latest'
377-
env:
378-
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
379-
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
380-
GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }}
381-
shell: bash
382-
run: |
383-
if [[ -n $BROWSERSTACK_USER && -n $BROWSERSTACK_KEY ]]; then
384-
./gradlew :vividus-tests:debugStories -Pvividus.configuration.environments= \
385-
-Pvividus.configuration.suites=system/mobile_app/healthcheck/browserstack \
386-
-Pvividus.configuration.profiles=browserstack/mobile_app/ios,mobile_app/ios \
387-
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
388-
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
389-
-Pvividus.selenium.grid.capabilities.bstack\:options.buildName="VIVIDUS iOS System Tests" \
390-
-Pvividus.allure.history-directory=output/history/bs-ios-system-tests \
391-
-Pvividus.allure.report-directory=output/reports/bs-ios-allure \
392-
-Pvividus.allure.executor.name="Github Actions (Vividus)" \
393-
-Pvividus.allure.executor.type=github \
394-
-Pvividus.allure.executor.url=https://github.com/vividus-framework/vividus/actions \
395-
-Pvividus.allure.executor.build-order=${GITHUB_RUN_ID} \
396-
-Pvividus.allure.executor.build-name="BrowserStack iOS System Tests ${GITHUB_RUN_ID}" \
397-
-Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
398-
-Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
399-
-Pvividus.allure.executor.report-name="BrowserStack iOS System tests report" \
400-
-Pvividus.variables.app-url=bs://f968061a2fc9680eff592d87e2b1cfe623a79459 \
401-
-Pvividus.notifications.base.comment="VIVIDUS CI - BrowserStack iOS System Tests" \
402-
-Pvividus.notifications.base.report-link=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
403-
-Pvividus.notifications.base.project=vividus-tests \
404-
-Pvividus.notifications.mail.host=smtp.gmail.com \
405-
-Pvividus.notifications.mail.port=587 \
406-
407-
-Pvividus.notifications.mail.password=${GMAIL_PASSWORD} \
408-
409-
-Pvividus.notifications.mail.recipient="[email protected], [email protected]" \
410-
-Pvividus.notifications.mail.security-protocol=STARTTLS
411-
else
412-
echo No BROWSERSTACK_USER and/or BROWSERSTACK_KEY variables, System tests will be skipped
413-
fi
414-
415-
- name: BrowserStack - iOS - Mobile App - Publish system tests report
416-
if: matrix.platform == 'macos-latest' && always()
417-
uses: actions/upload-artifact@v4
418-
with:
419-
name: BrowserStack - System Tests - Report - iOS
420-
path: vividus-tests/output/reports/bs-ios-allure
421-
422-
- name: BrowserStack - Android - Mobile App - Run system tests
423-
if: matrix.platform == 'macos-latest'
424-
env:
425-
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
426-
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
427-
shell: bash
428-
run: |
429-
if [[ -n $BROWSERSTACK_USER && -n $BROWSERSTACK_KEY ]]; then
430-
./gradlew :vividus-tests:debugStories -Pvividus.configuration.environments= \
431-
-Pvividus.configuration.suites=system/mobile_app/healthcheck/browserstack \
432-
-Pvividus.configuration.profiles=browserstack/mobile_app/android,mobile_app/android \
433-
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
434-
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
435-
-Pvividus.selenium.grid.capabilities.bstack\:options.buildName="VIVIDUS Android System Tests" \
436-
-Pvividus.allure.history-directory=output/history/bs-android-system-tests \
437-
-Pvividus.allure.report-directory=output/reports/bs-android-allure \
438-
-Pvividus.allure.executor.name="Github Actions (Vividus)" \
439-
-Pvividus.allure.executor.type=github \
440-
-Pvividus.allure.executor.url=https://github.com/vividus-framework/vividus/actions \
441-
-Pvividus.allure.executor.build-order=${GITHUB_RUN_ID} \
442-
-Pvividus.allure.executor.build-name="BrowserStack Android System Tests ${GITHUB_RUN_ID}" \
443-
-Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
444-
-Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
445-
-Pvividus.allure.executor.report-name="BrowserStack Android System tests report" \
446-
-Pvividus.variables.app-url=bs://9d822d48132d61d848244f4822901ecd91b6cba2
447-
else
448-
echo No BROWSERSTACK_USER and/or BROWSERSTACK_KEY variables, System tests will be skipped
449-
fi
450-
451-
- name: BrowserStack - Android - Mobile App - Publish system tests report
452-
if: matrix.platform == 'macos-latest' && always()
453-
uses: actions/upload-artifact@v4
454-
with:
455-
name: BrowserStack - System Tests - Report - Android
456-
path: vividus-tests/output/reports/bs-android-allure
457-
458336
- name: Validate fail fast
459337
if: matrix.platform == 'macos-latest'
460338
shell: bash
@@ -824,6 +702,158 @@ jobs:
824702
restore-keys: |
825703
mobile-tests-on-saucelabs-history-cache-
826704
705+
system-tests-on-browserstack:
706+
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
707+
runs-on: ubuntu-latest
708+
709+
steps:
710+
- name: Checkout (including submodules and tags)
711+
uses: actions/checkout@v4
712+
with:
713+
submodules: recursive
714+
fetch-depth: 0
715+
716+
- name: Restore cached ~/.gradle/caches
717+
uses: actions/cache/restore@v4
718+
with:
719+
path: ~/.gradle/caches
720+
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }}
721+
restore-keys: |
722+
${{ runner.os }}-gradle-caches-
723+
724+
- name: Restore cached ~/.gradle/wrapper
725+
uses: actions/cache/restore@v4
726+
with:
727+
path: ~/.gradle/wrapper
728+
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('vividus-build-system/**/wrapper/gradle-wrapper.properties') }}
729+
restore-keys: |
730+
${{ runner.os }}-gradle-wrapper-
731+
732+
- name: Restore cached tests history
733+
uses: actions/cache/restore@v4
734+
with:
735+
path: vividus-tests/output/history
736+
key: tests-on-browserstack-history-cache-${{ github.sha }}
737+
restore-keys: |
738+
tests-on-browserstack-history-cache-
739+
740+
- name: Set up JDK 23
741+
uses: actions/setup-java@v4
742+
with:
743+
distribution: 'temurin'
744+
java-version: 23
745+
746+
- name: BrowserStack - Mobile - Web - System tests
747+
env:
748+
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
749+
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
750+
shell: bash
751+
run: |
752+
declare -a profiles=( iphone android )
753+
for profile in "${profiles[@]}"; do
754+
./gradlew :vividus-tests:debugStories -Pvividus.configuration.suites=health_check \
755+
-Pvividus.configuration.profiles=browserstack/web/phone/${profile},web/phone/${profile} \
756+
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
757+
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY}
758+
done
759+
760+
- name: BrowserStack - Desktop - Web - System tests
761+
env:
762+
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
763+
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
764+
shell: bash
765+
run: |
766+
declare -a profiles=( iexplore chrome firefox edge safari )
767+
for profile in "${profiles[@]}"; do
768+
./gradlew :vividus-tests:debugStories -Pvividus.configuration.suites=health_check \
769+
-Pvividus.configuration.profiles=browserstack/web,web/desktop/${profile} \
770+
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
771+
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
772+
-Pvividus.selenium.grid.capabilities.bstack\:options.buildName="VIVIDUS BrowserStack Integration Tests"
773+
done
774+
775+
- name: BrowserStack - iOS - Mobile App - Run system tests
776+
env:
777+
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
778+
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
779+
GMAIL_PASSWORD: ${{ secrets.GMAIL_PASSWORD }}
780+
shell: bash
781+
run: |
782+
./gradlew :vividus-tests:debugStories -Pvividus.configuration.environments= \
783+
-Pvividus.configuration.suites=system/mobile_app/healthcheck/browserstack \
784+
-Pvividus.configuration.profiles=browserstack/mobile_app/ios,mobile_app/ios \
785+
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
786+
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
787+
-Pvividus.selenium.grid.capabilities.bstack\:options.buildName="VIVIDUS iOS System Tests" \
788+
-Pvividus.allure.history-directory=output/history/bs-ios-system-tests \
789+
-Pvividus.allure.report-directory=output/reports/bs-ios-allure \
790+
-Pvividus.allure.executor.name="Github Actions (Vividus)" \
791+
-Pvividus.allure.executor.type=github \
792+
-Pvividus.allure.executor.url=https://github.com/vividus-framework/vividus/actions \
793+
-Pvividus.allure.executor.build-order=${GITHUB_RUN_ID} \
794+
-Pvividus.allure.executor.build-name="BrowserStack iOS System Tests ${GITHUB_RUN_ID}" \
795+
-Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
796+
-Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
797+
-Pvividus.allure.executor.report-name="BrowserStack iOS System tests report" \
798+
-Pvividus.variables.app-url=bs://f968061a2fc9680eff592d87e2b1cfe623a79459 \
799+
-Pvividus.notifications.base.comment="VIVIDUS CI - BrowserStack iOS System Tests" \
800+
-Pvividus.notifications.base.report-link=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
801+
-Pvividus.notifications.base.project=vividus-tests \
802+
-Pvividus.notifications.mail.host=smtp.gmail.com \
803+
-Pvividus.notifications.mail.port=587 \
804+
805+
-Pvividus.notifications.mail.password=${GMAIL_PASSWORD} \
806+
807+
-Pvividus.notifications.mail.recipient="[email protected], [email protected]" \
808+
-Pvividus.notifications.mail.security-protocol=STARTTLS
809+
810+
- name: BrowserStack - iOS - Mobile App - Publish system tests report
811+
if: always()
812+
uses: actions/upload-artifact@v4
813+
with:
814+
name: BrowserStack - System Tests - Report - iOS
815+
path: vividus-tests/output/reports/bs-ios-allure
816+
817+
- name: BrowserStack - Android - Mobile App - Run system tests
818+
env:
819+
BROWSERSTACK_USER: ${{ secrets.BROWSERSTACK_USER }}
820+
BROWSERSTACK_KEY: ${{ secrets.BROWSERSTACK_KEY }}
821+
shell: bash
822+
run: |
823+
./gradlew :vividus-tests:debugStories -Pvividus.configuration.environments= \
824+
-Pvividus.configuration.suites=system/mobile_app/healthcheck/browserstack \
825+
-Pvividus.configuration.profiles=browserstack/mobile_app/android,mobile_app/android \
826+
-Pvividus.selenium.grid.username=${BROWSERSTACK_USER} \
827+
-Pvividus.selenium.grid.password=${BROWSERSTACK_KEY} \
828+
-Pvividus.selenium.grid.capabilities.bstack\:options.buildName="VIVIDUS Android System Tests" \
829+
-Pvividus.allure.history-directory=output/history/bs-android-system-tests \
830+
-Pvividus.allure.report-directory=output/reports/bs-android-allure \
831+
-Pvividus.allure.executor.name="Github Actions (Vividus)" \
832+
-Pvividus.allure.executor.type=github \
833+
-Pvividus.allure.executor.url=https://github.com/vividus-framework/vividus/actions \
834+
-Pvividus.allure.executor.build-order=${GITHUB_RUN_ID} \
835+
-Pvividus.allure.executor.build-name="BrowserStack Android System Tests ${GITHUB_RUN_ID}" \
836+
-Pvividus.allure.executor.build-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
837+
-Pvividus.allure.executor.report-url=https://github.com/vividus-framework/vividus/actions/runs/${GITHUB_RUN_ID} \
838+
-Pvividus.allure.executor.report-name="BrowserStack Android System tests report" \
839+
-Pvividus.variables.app-url=bs://9d822d48132d61d848244f4822901ecd91b6cba2
840+
841+
- name: BrowserStack - Android - Mobile App - Publish system tests report
842+
if: always()
843+
uses: actions/upload-artifact@v4
844+
with:
845+
name: BrowserStack - System Tests - Report - Android
846+
path: vividus-tests/output/reports/bs-android-allure
847+
848+
- name: Cache tests history
849+
if: always() && github.ref == 'refs/heads/master'
850+
uses: actions/cache/save@v4
851+
with:
852+
path: vividus-tests/output/history
853+
key: tests-on-browserstack-history-cache-${{ github.sha }}
854+
restore-keys: |
855+
tests-on-browserstack-history-cache-
856+
827857
system-mobile-tests-on-mobitru:
828858
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
829859
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)