Discord Integration - 2. #64
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: UI test execution | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- master | |
- issue-* | |
- fb_* | |
push: | |
branches: | |
- master | |
- issue-* | |
- fb_* | |
schedule: | |
- cron: '* * * * *' | |
jobs: | |
build_and_test: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Install Browsers | |
uses: browser-actions/setup-chrome@latest | |
- uses: browser-actions/setup-firefox@latest | |
- uses: browser-actions/setup-edge@latest | |
- name: Build Project | |
run: mvn clean install -DskipTests | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: target | |
path: | | |
${{ github.workspace }}/target | |
${{ github.workspace }}/reports | |
- name: Test Summary | |
id: test_summary | |
uses: test-summary/action@v2 | |
with: | |
paths: "test/results/**/TEST-*.xml" | |
if: always() | |
smoke_job_chrome_headless: | |
name: Smoke Tests Chrome Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run Smoke Tests (Chrome) | |
run: mvn clean test -Drunmode=headless -Dbrowser=chrome -Dgroups=SWAG_LABS_SMOKE -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send Smoke Tests (Chrome) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
smoke_job_firefox_headless: | |
name: Smoke Tests Firefox Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run Smoke Tests (Firefox) | |
run: mvn clean test -Drunmode=headless -Dbrowser=firefox -Dgroups=SWAG_LABS_SMOKE -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send Smoke Tests (Firefox) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
smoke_job_msedge_headless: | |
name: Smoke Tests MS Edge Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run Smoke Tests (MS Edge) | |
run: mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_SMOKE -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send Smoke Tests (MS Edge) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
regression_job_chrome_headless: | |
name: Regression Tests Chrome Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run Regression Tests (Chrome) | |
run: mvn clean test -Drunmode=headless -Dbrowser=chrome -Dgroups=SWAG_LABS_REGRESSION -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send Regression Tests (Chrome) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
regression_job_firefox_headless: | |
name: Regression Tests Firefox Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run Regression Tests (Firefox) | |
run: mvn clean test -Drunmode=headless -Dbrowser=firefox -Dgroups=SWAG_LABS_REGRESSION -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send Regression Tests (Firefox) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
regression_job_msedge_headless: | |
name: Regression Tests MS Edge Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run Regression Tests (MS Edge) | |
run: mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_REGRESSION -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send Regression Tests (MS Edge) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
E2E_job_chrome_headless: | |
name: E2E Tests Chrome Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- smoke_job_chrome_headless | |
- regression_job_chrome_headless | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run E2E Tests (Chrome) | |
run: mvn clean test -Drunmode=headless -Dbrowser=chrome -Dgroups=SWAG_LABS_E2E -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send E2E Tests (Chrome) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
E2E_job_firefox_headless: | |
name: E2E Tests Firefox Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- smoke_job_firefox_headless | |
- regression_job_firefox_headless | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run E2E Tests (Firefox) | |
run: mvn clean test -Drunmode=headless -Dbrowser=firefox -Dgroups=SWAG_LABS_E2E -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send E2E Tests (Firefox) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" | |
E2E_job_msedge_headless: | |
name: E2E Tests MS Edge Headless | |
runs-on: ubuntu-latest | |
needs: | |
- build_and_test | |
- smoke_job_msedge_headless | |
- regression_job_msedge_headless | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Setup Java and Maven | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
cache: maven | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: target | |
- name: Run E2E Tests (MS Edge) | |
run: mvn clean test -Drunmode=headless -Dbrowser=msedge -Dgroups=SWAG_LABS_E2E -Dtestng.parallel=methods -DthreadPoolSize=3 -Ddataproviderthreadcount=3 | |
- name: Send E2E Tests (MS Edge) Results to Discord | |
env: | |
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
run: | | |
passed="${{ steps.test_summary.outputs.passed }}/${{ steps.test_summary.outputs.total }}" | |
failed="${{ steps.test_summary.outputs.failed }}/${{ steps.test_summary.outputs.total }}" | |
skipped="${{ steps.test_summary.outputs.skipped }}/${{ steps.test_summary.outputs.total }}" | |
total="${{ steps.test_summary.outputs.total }}" | |
pass_percent=$(( 100 * passed / total )) | |
fail_percent=$(( 100 * failed / total )) | |
content="🚀 **Test Summary** 🚀\n\n" | |
content="🚀 **JOB: ${{ github.job }}** 🚀\n\n" | |
content+="🎉 **Passed**: $passed\n" | |
content+="❌ **Failed**: $failed\n" | |
content+="⚠️ **Skipped**: $skipped\n" | |
content+="📊 **Total**: $total\n\n" | |
content+="✅ **Pass %**: $pass_percent%\n" | |
content+="❌ **Fail %**: $fail_percent%\n\n" | |
curl --location "$DISCORD_WEBHOOK_URL" \ | |
--header 'Content-Type: application/json' \ | |
--data-raw "{ | |
\"content\": \"$content\", | |
\"username\": \"TestBot\" | |
}" |