diff --git a/.github/actions/run-e2e-playwright/action.yml b/.github/actions/run-e2e-playwright/action.yml index efd534467..75a39fd00 100644 --- a/.github/actions/run-e2e-playwright/action.yml +++ b/.github/actions/run-e2e-playwright/action.yml @@ -17,13 +17,27 @@ 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' }} run: | - npm start > /dev/null &\ + # 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 diff --git a/.github/workflows/run-e2e-with-env.yml b/.github/workflows/run-e2e-with-env.yml index 62eb6cf54..c124caa4e 100644 --- a/.github/workflows/run-e2e-with-env.yml +++ b/.github/workflows/run-e2e-with-env.yml @@ -20,7 +20,7 @@ env: HR_USER_PASSWORD: ${{ secrets.HR_USER_PASSWORD }} SCREENSHOT_USERNAME: ${{ secrets.SCREENSHOT_USERNAME }} SCREENSHOT_PASSWORD: ${{ secrets.SCREENSHOT_PASSWORD}} - PLAYWRIGHT_E2E_HOST: ${{ inputs.url || secrets.PIPELINE_ENV_URL }}/aca/#/ + PLAYWRIGHT_E2E_HOST: ${{ inputs.url || secrets.PLAYWRIGHT_E2E_HOST }} GH_BUILD_NUMBER: ${{ github.run_id }} REPORT_PORTAL_URL: ${{ secrets.REPORT_PORTAL_URL }} REPORT_PORTAL_TOKEN: ${{ secrets.REPORT_PORTAL_TOKEN }} diff --git a/e2e/playwright/pagination/src/tests/favorites.ts b/e2e/playwright/pagination/src/tests/favorites.ts index f264879cf..d4da84813 100644 --- a/e2e/playwright/pagination/src/tests/favorites.ts +++ b/e2e/playwright/pagination/src/tests/favorites.ts @@ -54,6 +54,7 @@ export function favoritesTests(username: string) { await favoritePage.pagination.openMaxItemsMenu(); await favoritePage.pagination.clickMenuItem('50'); + await favoritePage.dataTable.spinnerWaitForReload(); expect(await favoritePage.pagination.getMaxItems()).toContain('50'); expect(await favoritePage.pagination.getTotalPages()).toContain('of 2'); @@ -61,6 +62,7 @@ export function favoritesTests(username: string) { await favoritePage.pagination.openMaxItemsMenu(); await favoritePage.pagination.clickMenuItem('100'); + await favoritePage.dataTable.spinnerWaitForReload(); expect(await favoritePage.pagination.getMaxItems()).toContain('100'); expect(await favoritePage.pagination.getTotalPages()).toContain('of 1');