diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 1ab7830..e6d09fe 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,4 +1,4 @@ -name: Testing for visual regression on old theme +name: Running Playwright test on UI # Run the workflow when code is pushed or when a pull request is created on: @@ -25,19 +25,16 @@ jobs: - name: Install dependencies and playwright browsers run: cd tests && npm ci && npx playwright install --with-deps - name: Run Playwright tests - id: test-visual + id: test-ui run: | make tests | tee output.log - if grep -q -e "Error: A snapshot doesn't exist at" -e "Screenshot comparison failed" output.log; then - echo "Playwright tests failed due to a snapshot issue." - exit 1 - elif grep -q "failed" output.log; then - echo "Playwright tests failed due to a non-snapshot issue." + if grep -q "failed" output.log; then + echo "Playwright tests failed. Please view the Playwright report to see full error." exit 1 fi - uses: actions/upload-artifact@v4 id: artifact-upload - if: ${{ !cancelled() && failure() && steps.test-visual.conclusion == 'failure' }} + if: ${{ !cancelled() && failure() && steps.test-ui.conclusion == 'failure' }} with: name: playwright-report path: tests/playwright-report/ @@ -47,10 +44,9 @@ jobs: if: ${{ failure() }} with: script: | - const body = `###
Playwright visual snapshot differences were detected. + const body = `### Playwright differences were detected. - View the [Playwright report](${{ steps.artifact-upload.outputs.artifact-url }}) - **To approve the snapshot changes and update the snapshots, please comment:** /approve-snapshots`; + View the [Playwright report](${{ steps.artifact-upload.outputs.artifact-url }})`; await github.rest.issues.createComment({ issue_number: context.issue.number, diff --git a/.github/workflows/update-screenshot.yml b/.github/workflows/update-screenshot.yml deleted file mode 100644 index 30f7f39..0000000 --- a/.github/workflows/update-screenshot.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Update screenshot on comment -on: - issue_comment: - types: [created] -jobs: - update-screenshots: - name: Update Screenshot - if: github.event.issue.pull_request && contains(github.event.comment.body, '/approve-snapshots') - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - steps: - - uses: xt0rted/pull-request-comment-branch@v3 - id: comment-branch - - uses: actions/checkout@v4 - if: success() - with: - ref: ${{ steps.comment-branch.outputs.head_ref }} - - name: Comment on PR with Playwright updates - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - script: | - const body = `### Updating snapshots. Click [here](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) to see the status.`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body, - }); - - name: Setup Hugo - uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f # v3.0.0 - with: - hugo-version: "0.147.8" - extended: true - - name: Install dependencies and Playwright browsers - run: cd tests && npm ci && npx playwright install --with-deps - - name: Run Playwright update snapshots - id: test-visual - run: make tests-update-screenshots - - uses: actions/upload-artifact@v4 - id: artifact-upload - with: - name: screenshots - path: tests/src/__screenshots__ - - name: Comment on PR with success - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 - with: - script: | - const body = `### Please download the artifacts [here](${{ steps.artifact-upload.outputs.artifact-url }}) and commit your updated screenshots.`; - - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: body, - }); \ No newline at end of file diff --git a/layouts/404.html b/layouts/404.html index 4fdced6..a50e27c 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,7 +1,7 @@ {{ define "main"}} -