Skip to content

Commit

Permalink
refactor[test]: use e2e action
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Nov 18, 2024
1 parent 64d632c commit ebb4721
Showing 1 changed file with 4 additions and 50 deletions.
54 changes: 4 additions & 50 deletions .github/workflows/test_against_testrig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,58 +120,12 @@ jobs:
tailscale status
curl http://flashhost/${{ github.event.inputs.target }}/
- name: "⬇ Checkout maintenance OctoPrint with Playwright E2E tests"
uses: actions/checkout@v4
- name: "🎭 Run E2E tests"
uses: OctoPrint/actions/e2e@main
with:
repository: OctoPrint/OctoPrint
ref: ${{ github.event.inputs.e2e-branch }}
path: OctoPrint

- name: 🏗 Prepare Playwright env
working-directory: OctoPrint/tests/playwright
run: |
npm ci
PLAYWRIGHT_VERSION=$(npm ls --json @playwright/test | jq --raw-output '.dependencies["@playwright/test"].version')
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: 🧰 Cache Playwright browser binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: "~/.cache/ms-playwright"
key: "${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}"
restore-keys: |
${{ runner.os }}-playwright-
- name: 🏗 Install Playwright browser binaries & OS dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: OctoPrint/tests/playwright
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
npx playwright install --with-deps
- name: 🏗 Install Playwright OS dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
working-directory: OctoPrint/tests/playwright
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
npx playwright install-deps
- name: 🎭 Run Playwright
working-directory: OctoPrint/tests/playwright
run: |
npx playwright test
env:
NO_SERVER: true
PLAYWRIGHT_BASEURL: "http://flashhost/${{ github.event.inputs.target }}"
ref: maintenance
server: "http://flashhost/${{ github.event.inputs.target }}"

- name: 📷 Check webcam
run: |
curl -i -o webcam.jpg http://flashhost/${{ github.event.inputs.target }}/webcam/?action=snapshot
- name: ⬆ Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: OctoPrint/tests/playwright/playwright-report

0 comments on commit ebb4721

Please sign in to comment.