diff --git a/.github/actions/setup-ruby-and-dependencies/action.yml b/.github/actions/setup-ruby-and-dependencies/action.yml index f6023d2a..27441777 100644 --- a/.github/actions/setup-ruby-and-dependencies/action.yml +++ b/.github/actions/setup-ruby-and-dependencies/action.yml @@ -22,9 +22,16 @@ runs: bundler-cache: true cache-version: ${{ inputs.ruby-cache-version }}-v1 + - run: sudo apt-get -qq update + shell: bash + - name: Install and cache vips if: ${{ inputs.cache-apt-packages == 'true' }} uses: awalsh128/cache-apt-pkgs-action@latest with: packages: libvips libglib2.0-0 libglib2.0-dev libwebp-dev libvips42 libpng-dev - version: tests-v1 + version: tests-v2 + + # fallback if cache version is outdated + - run: sudo apt-get -qq install libvips + shell: bash diff --git a/.github/actions/upload-screenshots/action.yml b/.github/actions/upload-screenshots/action.yml index e12faa9b..d64c104a 100644 --- a/.github/actions/upload-screenshots/action.yml +++ b/.github/actions/upload-screenshots/action.yml @@ -9,10 +9,15 @@ runs: using: 'composite' steps: - uses: actions/upload-artifact@v4 - if: failure() with: - name: ${{ inputs.name }} + name: ${{ inputs.name }}-diffs retention-days: 1 path: | test/fixtures/app/doc/screenshots/ + + - uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.name }}-capybara-fails + retention-days: 1 + path: | tmp/capybara/screenshots-diffs/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5d7c008d..8f1e3362 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,6 +69,7 @@ jobs: - uses: ./.github/actions/upload-screenshots + if: failure() with: name: base-screenshots diff --git a/.gitignore b/.gitignore index 28cf2aea..84aee455 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,11 @@ /tmp/ /vendor/sigs/ +# Ignore report files *.attempt_*.png *.diff.png *.base.png + +*.attempt_*.webp +*.diff.webp +*.base.webp diff --git a/test/capybara/screenshot/diff_test.rb b/test/capybara/screenshot/diff_test.rb index 90ef430e..cd6edd0a 100644 --- a/test/capybara/screenshot/diff_test.rb +++ b/test/capybara/screenshot/diff_test.rb @@ -63,7 +63,7 @@ def test_screenshot_section_is_prepended test "screenshot" do screenshot_group "screenshot" - screenshot "a" + assert_matches_screenshot "a" end test "succeed on screenshot diff when fail_on_difference is false" do diff --git a/test/fixtures/app/doc/screenshots/linux/cuprite/index-cropped.png b/test/fixtures/app/doc/screenshots/linux/cuprite/index-cropped.png index 880faafc..826d2605 100644 Binary files a/test/fixtures/app/doc/screenshots/linux/cuprite/index-cropped.png and b/test/fixtures/app/doc/screenshots/linux/cuprite/index-cropped.png differ diff --git a/test/fixtures/app/doc/screenshots/linux/cuprite/index-vips.webp b/test/fixtures/app/doc/screenshots/linux/cuprite/index-vips.webp index 9b1033d5..47752ff3 100644 Binary files a/test/fixtures/app/doc/screenshots/linux/cuprite/index-vips.webp and b/test/fixtures/app/doc/screenshots/linux/cuprite/index-vips.webp differ diff --git a/test/fixtures/app/doc/screenshots/linux/cuprite/index.png b/test/fixtures/app/doc/screenshots/linux/cuprite/index.png index 6a97dd88..95de9dd9 100644 Binary files a/test/fixtures/app/doc/screenshots/linux/cuprite/index.png and b/test/fixtures/app/doc/screenshots/linux/cuprite/index.png differ