From f3742c696a4c66e549f08a60041ac39be316ccc8 Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Fri, 26 Apr 2024 12:13:31 -0700 Subject: [PATCH] Print instructions to view Playwright test report (#4575) * Print instructions to view Playwright test report --- .github/actions/kots-e2e/action.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/actions/kots-e2e/action.yml b/.github/actions/kots-e2e/action.yml index 941448119b..5330c44d69 100644 --- a/.github/actions/kots-e2e/action.yml +++ b/.github/actions/kots-e2e/action.yml @@ -123,12 +123,30 @@ runs: SKIP_TEARDOWN=1 shell: bash - - uses: actions/upload-artifact@v4 + - id: upload-playwright-report + uses: actions/upload-artifact@v4 if: ${{ failure() }} with: name: ${{ github.job }}-${{ inputs.k8s-distribution }}-${{ inputs.k8s-version }}-playwright-report path: ./e2e/playwright/playwright-report/ + - name: Print instructions to view Playwright report + if: ${{ failure() && steps.upload-playwright-report.outputs.artifact-url != '' }} + run: | + echo -e "\e[1;33m┌──────────────────────────────────────────────────────────────────────────────────────────────────────┐\e[0m" + echo -e "\e[1;33m To view the Playwright test report: \e[0m" + echo -e "\e[1;33m \e[0m" + echo -e "\e[1;33m 1- Download & extract the report from: \e[0m" + echo -e "\e[1;33m \e[0m" + echo -e "\e[1;34m ${{ steps.upload-playwright-report.outputs.artifact-url }} \e[0m" + echo -e "\e[1;33m \e[0m" + echo -e "\e[1;33m 2- From inside the extracted directory, run: \e[0m" + echo -e "\e[1;33m \e[0m" + echo -e "\e[1;32m npx playwright show-report . \e[0m" + echo -e "\e[1;33m \e[0m" + echo -e "\e[1;33m└──────────────────────────────────────────────────────────────────────────────────────────────────────┘\e[0m" + shell: bash + - name: Print logs on failure if: ${{ failure() }} env: