e2e: dump error-context.md to log on failure + bump upload-artifact
The Playwright run produces error-context.md per failed test with a full DOM snapshot — useful for triaging UI test failures without round-tripping through downloaded artifacts. Cat it into the workflow log on failure. Also bump actions/upload-artifact v3 → v4. v3 uploads still return success on this Gitea runner but the artifacts don't surface through the API or UI; v4 is the correct version per the workflow header note.
This commit is contained in:
@@ -96,6 +96,19 @@ jobs:
|
|||||||
docker cp e2e-pw:/work/playwright-report/. e2e/playwright/playwright-report/ || true
|
docker cp e2e-pw:/work/playwright-report/. e2e/playwright/playwright-report/ || true
|
||||||
docker cp e2e-pw:/work/test-results/. e2e/playwright/test-results/ || true
|
docker cp e2e-pw:/work/test-results/. e2e/playwright/test-results/ || true
|
||||||
|
|
||||||
|
- name: Show Playwright failure context (on failure)
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
set +e
|
||||||
|
shopt -s nullglob globstar
|
||||||
|
for f in e2e/playwright/test-results/**/error-context.md; do
|
||||||
|
echo "::group::$f"
|
||||||
|
cat "$f"
|
||||||
|
echo "::endgroup::"
|
||||||
|
done
|
||||||
|
echo "Failure attachments (download via the playwright-report artifact):"
|
||||||
|
find e2e/playwright/test-results \( -name '*.png' -o -name '*.webm' -o -name 'trace.zip' \) -printf ' %p\n' | sort
|
||||||
|
|
||||||
- name: Compose logs (on failure)
|
- name: Compose logs (on failure)
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
@@ -105,7 +118,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload Playwright report (on failure)
|
- name: Upload Playwright report (on failure)
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: playwright-report
|
name: playwright-report
|
||||||
path: |
|
path: |
|
||||||
|
|||||||
Reference in New Issue
Block a user