diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index f7c9085d2..58344b235 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -73,6 +73,12 @@ jobs: timeout-minutes: 20 run: | make playwright-shiny SUB_FILE=". -vv" + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: "playright-shiny-${{ matrix.os }}-${{ matrix.python-version }}-results" + path: test-results/ + retention-days: 5 playwright-examples: runs-on: ${{ matrix.os }} @@ -105,6 +111,12 @@ jobs: timeout-minutes: 20 run: | make playwright-examples SUB_FILE=". -vv" + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: "playright-examples-${{ matrix.os }}-${{ matrix.python-version }}-results" + path: test-results/ + retention-days: 5 playwright-deploys: # Only allow one `playwright-deploys` job to run at a time. (Independent of branch / PR) @@ -146,6 +158,13 @@ jobs: run: | make playwright-deploys SUB_FILE=". -vv --numprocesses 12" + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: "playright-deploys-${{ matrix.os }}-${{ matrix.python-version }}-results" + path: test-results/ + retention-days: 5 + pypi: name: "Deploy to PyPI" runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 70749a9e4..6f46035ff 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,4 @@ docs/source/reference/ # Developer scratch area _dev/ tests/playwright/deploys/**/requirements.txt +test-results/ diff --git a/Makefile b/Makefile index 41035d377..76c205aa3 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,9 @@ playwright-examples: install-playwright ## end-to-end tests on examples with pla playwright-debug: install-playwright ## All end-to-end tests, chrome only, headed pytest -c tests/playwright/playwright-pytest.ini tests/playwright/$(SUB_FILE) +playwright-show-trace: ## Show trace of failed tests + npx playwright show-trace test-results/*/trace.zip + testrail-junit: install-playwright install-trcli ## end-to-end tests with playwright and generate junit report pytest tests/playwright/shiny/$(SUB_FILE) --junitxml=report.xml diff --git a/pytest.ini b/pytest.ini index e6879b461..7efe317fc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,4 @@ [pytest] asyncio_mode=strict testpaths=tests/pytest/ -; ; Debug version of options -; addopts = --strict-markers --durations=6 --durations-min=5.0 --browser chromium --numprocesses auto --video=retain-on-failure -vv -addopts = --strict-markers --durations=6 --durations-min=5.0 --browser webkit --browser firefox --browser chromium --numprocesses auto +addopts = --strict-markers --durations=6 --durations-min=5.0 --browser webkit --browser firefox --browser chromium --numprocesses auto --tracing=retain-on-failure --video=retain-on-failure diff --git a/tests/playwright/playwright-pytest.ini b/tests/playwright/playwright-pytest.ini index 74013315d..8eb2dbd0d 100644 --- a/tests/playwright/playwright-pytest.ini +++ b/tests/playwright/playwright-pytest.ini @@ -6,8 +6,9 @@ asyncio_mode=strict # --browser : browser type to run on playwright # --numprocesses auto: number of testing workers. auto is number of (virtual) cores # --video=retain-on-failure: playwright saves recording of any failed test +# --tracing=retain-on-failure: playwright saves trace of any failed test # -vv: Extra extra verbose output # # --headed: Headed browser testing # # -r P: Show extra test summary info: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings... # --maxfail=1: Stop after 1 failure has occurred -addopts = --strict-markers --durations=6 --durations-min=5.0 --browser chromium --numprocesses auto --video=retain-on-failure -vvv --maxfail=1 --headed +addopts = --strict-markers --durations=6 --durations-min=5.0 --browser chromium --numprocesses auto -vvv --maxfail=1 --headed --tracing=retain-on-failure --video=retain-on-failure