Files
alfresco-content-app/.github/actions/run-e2e-playwright/action.yml
Adam Świderski 748c73c43f [ACS-12465] Connect teams channel with github CI in cron multibrowser workflow for easier raporting (#5344)
* [ACS-12465] added teams raport

* [ACS-12465] raport fix 1

* [ACS-12465] raport name update

* [ACS-12465] sonar fix + small changes to formatting due to size limit

* [ACS-12465] review fixes 2

* [ACS-12465] added warning for >2% failure rate and new column for only excluded

* [ACS-12465] changed column naming
2026-08-13 10:01:54 +02:00

67 lines
2.2 KiB
YAML

name: "Run e2e Playwright"
description: "Run e2e Playwright"
inputs:
options:
description: 'Options'
required: true
test-runner:
description: 'Test runner'
required: false
default: 'Playwright'
artifact-name:
description: Name of the artifact cache
required: true
suite-attempts:
description: 'Maximum number of times to run the whole test suite (1 = no retry)'
required: false
default: '1'
runs:
using: "composite"
steps:
- name: Set PLAYWRIGHT_E2E_HOST
if: inputs.url != ''
shell: bash
run: |
# Construct the full URL with /aca path (without #/ as tests add that)
if [[ "${{ inputs.url }}" != *"/aca"* ]]; then
echo "PLAYWRIGHT_E2E_HOST=${{ inputs.url }}/aca" >> $GITHUB_ENV
else
echo "PLAYWRIGHT_E2E_HOST=${{ inputs.url }}" >> $GITHUB_ENV
fi
- name: Setup and run with options
shell: bash
env:
OPTIONS: ${{ inputs.options }}
PLAYWRIGHT_BROWSER: ${{ env.PLAYWRIGHT_BROWSER || 'chromium' }}
SUITE_ATTEMPTS: ${{ inputs.suite-attempts }}
run: |
# Only start local server if using localhost
if [[ "${PLAYWRIGHT_E2E_HOST}" == "http://localhost"* ]]; then
npm start > /dev/null &
fi
printf "Waiting for the application to be ready..."
while ! curl -sf ${PLAYWRIGHT_E2E_HOST} > /dev/null; do
printf "."
sleep 1
done
printf "\nApplication is ready.\n"
for attempt in $(seq 1 "${SUITE_ATTEMPTS:-1}"); do
echo "Running playwright tests with options $OPTIONS on browser ${PLAYWRIGHT_BROWSER} (suite attempt $attempt/${SUITE_ATTEMPTS:-1})"
# Clear any blob report from a previous attempt so only the final attempt is reported.
if [ -n "${PLAYWRIGHT_BLOB_DIR:-}" ]; then rm -rf -- "${PLAYWRIGHT_BLOB_DIR}"; fi
if E2E_TARGET=$OPTIONS npm run ci:e2e; then
exit 0
fi
if [ "$attempt" -lt "${SUITE_ATTEMPTS:-1}" ]; then
echo "Suite failed, retrying the whole suite..."
fi
done
echo "Suite failed after ${SUITE_ATTEMPTS:-1} attempt(s)."
exit 1