diff --git a/.github/actions/setup-hugo/action.yml b/.github/actions/setup-hugo/action.yml new file mode 100644 index 000000000..81e8d8fe2 --- /dev/null +++ b/.github/actions/setup-hugo/action.yml @@ -0,0 +1,50 @@ +--- +name: 'Setup Hugo with caches' +description: 'Install Hugo + Bun, cache dependencies and build artifacts' +inputs: + hugo-version: + description: 'Hugo version' + default: '0.149.1' + environment: + description: 'Hugo build environment' + default: 'development' +runs: + using: 'composite' + steps: + - uses: peaceiris/actions-hugo@v3 + with: + hugo-version: ${{ inputs.hugo-version }} + extended: true + + - uses: oven-sh/setup-bun@v2 + + - name: Cache Bun dependencies + uses: actions/cache@v5 + with: + path: | + ~/.bun/install/cache + node_modules + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb', '**/package.json') }} + restore-keys: ${{ runner.os }}-bun- + + - run: bun install --frozen-lockfile + shell: bash + + - name: Cache Hugo build + uses: actions/cache@v5 + with: + path: | + /tmp/hugo_cache + resources/_gen + _dest + key: ${{ runner.os }}-hugo-${{ inputs.environment }}-${{ hashFiles('hugo.toml', 'hugo.dev.toml', 'postcss.config.js', 'package.json', '**/bun.lockb', 'themes/**', 'layouts/**', 'content/**') }} + restore-keys: | + ${{ runner.os }}-hugo-${{ inputs.environment }}- + ${{ runner.os }}-hugo- + + - name: Build Hugo site + run: PATH="./node_modules/.bin:$PATH" bin/hugo-build + shell: bash + env: + HUGO_CACHEDIR: /tmp/hugo_cache + ENVIRONMENT: ${{ inputs.environment }} diff --git a/.github/workflows/sync-and-publish.yml b/.github/workflows/sync-and-publish.yml index 7f34a3fd5..da7bf406f 100644 --- a/.github/workflows/sync-and-publish.yml +++ b/.github/workflows/sync-and-publish.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.4.2 + ruby-version: '4.0' bundler-cache: true - name: Run sync script diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml deleted file mode 100644 index 36aa7fe30..000000000 --- a/.github/workflows/test-unit.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: unit-tests - -on: - workflow_dispatch: - -jobs: - unit: - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.4' - bundler-cache: true - - - name: Run unit tests - env: - PRECOMPILED_ASSETS: '1' - TEST_SERVER_PORT: '1314' - run: bundle exec rake test TEST='test/unit/**/*_test.rb' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..fb9c4d1b6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,88 @@ +--- +name: Tests + +on: + pull_request: + types: [opened, synchronize, reopened] + workflow_dispatch: + inputs: + screenshots: + description: 'Run screenshot tests (slow, requires Hugo build)' + type: boolean + default: false + update-baselines: + description: 'Re-record screenshot baselines and commit' + type: boolean + default: false + +permissions: + contents: write + pull-requests: write + +concurrency: + group: tests-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + unit: + name: Unit Tests + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v6 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '4.0' + bundler-cache: true + + - uses: ./.github/actions/setup-hugo + + - run: bundle exec rake test:unit + + screenshots: + name: Screenshot Tests + if: ${{ inputs.screenshots || inputs.update-baselines }} + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.head_ref || github.ref }} + + - uses: snap-diff/snap_diff-capybara/.github/actions/setup-ruby-and-dependencies@master + with: + ruby-version: '4.0' + cache-apt-packages: true + + - uses: ./.github/actions/setup-hugo + + - name: Run screenshot tests + if: ${{ !inputs.update-baselines }} + run: bundle exec rake test + env: + SCREENSHOT_DRIVER: vips + + - name: Record baselines + if: ${{ inputs.update-baselines }} + run: FORCE_SCREENSHOT_UPDATE=true bundle exec rake test + env: + SCREENSHOT_DRIVER: vips + + - name: Commit updated baselines + if: ${{ inputs.update-baselines }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add test/fixtures/screenshots/ + git diff --staged --quiet || git commit -m "chore: update screenshot baselines [ci skip]" + git push + + - name: Upload screenshot report + if: failure() + uses: snap-diff/snap_diff-capybara/.github/actions/upload-screenshots@master + with: + name: screenshots + report-path: test/fixtures/screenshots + pr-comment: 'true' diff --git a/.gitignore b/.gitignore index 710be85e7..c6a36e918 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ hugo.linux *.diff.png *.base.png *.attempt_*.png +snap_diff_report.html # Capybara capybara-*.png diff --git a/Gemfile b/Gemfile index 6ace7b748..b465e4893 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem "ostruct" gem "sanity-ruby" -gem "capybara-screenshot-diff", github: "donv/capybara-screenshot-diff" +gem "capybara-screenshot-diff", github: "snap-diff/snap_diff-capybara" gem "simplecov", require: false gem "vips" diff --git a/Gemfile.lock b/Gemfile.lock index 09ffed064..4bbb6d83a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT - remote: https://github.com/donv/capybara-screenshot-diff.git - revision: 62419f7432afa4e0e06cb9e099bc386f92335bb2 + remote: https://github.com/snap-diff/snap_diff-capybara.git + revision: 4070438ec9579be86faf8a5580783889fbc8431f specs: - capybara-screenshot-diff (1.11.0) + capybara-screenshot-diff (1.12.0) capybara (>= 2, < 4) GEM diff --git a/Rakefile b/Rakefile index 41981a55b..871536263 100644 --- a/Rakefile +++ b/Rakefile @@ -15,6 +15,12 @@ namespace :test do t.pattern = "test/**/*_test.rb" end + Rake::TestTask.new(:unit) do |t| + t.libs << "test" + t.libs << "lib" + t.pattern = "test/unit/**/*_test.rb" + end + Rake::TestTask.new(:critical) do |t| t.libs << "test" t.libs << "lib" diff --git a/test/fixtures/screenshots/linux/desktop/404.png b/test/fixtures/screenshots/linux/desktop/404.png index a82a9706d..0547caa9b 100644 Binary files a/test/fixtures/screenshots/linux/desktop/404.png and b/test/fixtures/screenshots/linux/desktop/404.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_page/_achievements.png b/test/fixtures/screenshots/linux/desktop/about_page/_achievements.png index 320b14466..d018c0321 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_page/_achievements.png and b/test/fixtures/screenshots/linux/desktop/about_page/_achievements.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_page/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/about_page/_cta-contact_us.png index e9619a564..8bf7dd741 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_page/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/about_page/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_page/_footer.png b/test/fixtures/screenshots/linux/desktop/about_page/_footer.png index b532b9be3..aba26a538 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_page/_footer.png and b/test/fixtures/screenshots/linux/desktop/about_page/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_page/_missions.png b/test/fixtures/screenshots/linux/desktop/about_page/_missions.png index 84a61aa2a..17ddad715 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_page/_missions.png and b/test/fixtures/screenshots/linux/desktop/about_page/_missions.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_page/_testimonials-header.png b/test/fixtures/screenshots/linux/desktop/about_page/_testimonials-header.png index 68b5ab967..8a4d78724 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_page/_testimonials-header.png and b/test/fixtures/screenshots/linux/desktop/about_page/_testimonials-header.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_page/_values.png b/test/fixtures/screenshots/linux/desktop/about_page/_values.png index c9e69877d..809783b14 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_page/_values.png and b/test/fixtures/screenshots/linux/desktop/about_page/_values.png differ diff --git a/test/fixtures/screenshots/linux/desktop/about_us.png b/test/fixtures/screenshots/linux/desktop/about_us.png index 1354badf6..7897e3d58 100644 Binary files a/test/fixtures/screenshots/linux/desktop/about_us.png and b/test/fixtures/screenshots/linux/desktop/about_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/blog/index.png b/test/fixtures/screenshots/linux/desktop/blog/index.png index a20e6d5d5..9caf9b6f4 100644 Binary files a/test/fixtures/screenshots/linux/desktop/blog/index.png and b/test/fixtures/screenshots/linux/desktop/blog/index.png differ diff --git a/test/fixtures/screenshots/linux/desktop/blog/index/_pagination.png b/test/fixtures/screenshots/linux/desktop/blog/index/_pagination.png index 01ab10461..8cc155eca 100644 Binary files a/test/fixtures/screenshots/linux/desktop/blog/index/_pagination.png and b/test/fixtures/screenshots/linux/desktop/blog/index/_pagination.png differ diff --git a/test/fixtures/screenshots/linux/desktop/blog/post.png b/test/fixtures/screenshots/linux/desktop/blog/post.png index 82e032afe..a2c4532d7 100644 Binary files a/test/fixtures/screenshots/linux/desktop/blog/post.png and b/test/fixtures/screenshots/linux/desktop/blog/post.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers.png b/test/fixtures/screenshots/linux/desktop/careers.png index 76f2751f0..ce8860eda 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers.png and b/test/fixtures/screenshots/linux/desktop/careers.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers/_footer.png b/test/fixtures/screenshots/linux/desktop/careers/_footer.png index 4cdc4d9f0..5f0f30298 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers/_footer.png and b/test/fixtures/screenshots/linux/desktop/careers/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers/_offers.png b/test/fixtures/screenshots/linux/desktop/careers/_offers.png index fa2ff189d..fd008b741 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers/_offers.png and b/test/fixtures/screenshots/linux/desktop/careers/_offers.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers/_overview.png b/test/fixtures/screenshots/linux/desktop/careers/_overview.png index 82f9b77e1..daeb50a00 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers/_overview.png and b/test/fixtures/screenshots/linux/desktop/careers/_overview.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer.png b/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer.png index 830701b6b..2ec216fe1 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer.png and b/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_apply.png b/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_apply.png index c948a821e..69c0c5eca 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_apply.png and b/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_apply.png differ diff --git a/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_footer.png b/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_footer.png index a14eb4b20..f86bccb2e 100644 Binary files a/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_footer.png and b/test/fixtures/screenshots/linux/desktop/careers/junior-ruby-on-rails-developer/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients.png b/test/fixtures/screenshots/linux/desktop/clients.png index 2690cb9bd..a90f2f645 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients.png and b/test/fixtures/screenshots/linux/desktop/clients.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_clients.png b/test/fixtures/screenshots/linux/desktop/clients/_clients.png index ebcd958e3..656879ea8 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_clients.png and b/test/fixtures/screenshots/linux/desktop/clients/_clients.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/clients/_cta-contact_us.png index e47283bc5..ae8b6dc05 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/clients/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_footer.png b/test/fixtures/screenshots/linux/desktop/clients/_footer.png index 49cb17329..7c27e50bd 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_footer.png and b/test/fixtures/screenshots/linux/desktop/clients/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_real-clients.png b/test/fixtures/screenshots/linux/desktop/clients/_real-clients.png index 1e6532b29..b22fdf198 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_real-clients.png and b/test/fixtures/screenshots/linux/desktop/clients/_real-clients.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_technologies.png b/test/fixtures/screenshots/linux/desktop/clients/_technologies.png index 2b42ea8df..f6cde1d5a 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_technologies.png and b/test/fixtures/screenshots/linux/desktop/clients/_technologies.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_testimonials-header.png b/test/fixtures/screenshots/linux/desktop/clients/_testimonials-header.png index 227146d6e..2358350c8 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_testimonials-header.png and b/test/fixtures/screenshots/linux/desktop/clients/_testimonials-header.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/_testimonials.png b/test/fixtures/screenshots/linux/desktop/clients/_testimonials.png index 00996f4ae..3e9c3516a 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/_testimonials.png and b/test/fixtures/screenshots/linux/desktop/clients/_testimonials.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_cta-contact_us.png index e64a6b93b..abbc8b486 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_footer.png b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_footer.png index 196d0d3c8..9a43958f4 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_footer.png and b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_more-cases.png b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_more-cases.png index 5d139e2c1..9b1c3d72c 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_more-cases.png and b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_more-cases.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_overview.png b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_overview.png index 82e0973ea..96bd06e7f 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_overview.png and b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_overview.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_solution.png b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_solution.png index 900473267..925478b25 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_solution.png and b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_solution.png differ diff --git a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_testimonial.png b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_testimonial.png index 96db6b3d7..018ee437f 100644 Binary files a/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_testimonial.png and b/test/fixtures/screenshots/linux/desktop/clients/agent-inbox/_testimonial.png differ diff --git a/test/fixtures/screenshots/linux/desktop/contact_us.png b/test/fixtures/screenshots/linux/desktop/contact_us.png index 28c71cd73..e83497fcc 100644 Binary files a/test/fixtures/screenshots/linux/desktop/contact_us.png and b/test/fixtures/screenshots/linux/desktop/contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/free_consultation.png b/test/fixtures/screenshots/linux/desktop/free_consultation.png index 78cd50620..08f7acadb 100644 Binary files a/test/fixtures/screenshots/linux/desktop/free_consultation.png and b/test/fixtures/screenshots/linux/desktop/free_consultation.png differ diff --git a/test/fixtures/screenshots/linux/desktop/homepage.png b/test/fixtures/screenshots/linux/desktop/homepage.png index eabce57a5..e2664d5e3 100644 Binary files a/test/fixtures/screenshots/linux/desktop/homepage.png and b/test/fixtures/screenshots/linux/desktop/homepage.png differ diff --git a/test/fixtures/screenshots/linux/desktop/homepage/_clients.png b/test/fixtures/screenshots/linux/desktop/homepage/_clients.png index 092e4d6ca..adfdbfbcf 100644 Binary files a/test/fixtures/screenshots/linux/desktop/homepage/_clients.png and b/test/fixtures/screenshots/linux/desktop/homepage/_clients.png differ diff --git a/test/fixtures/screenshots/linux/desktop/homepage/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/homepage/_cta-contact_us.png index c9b0cdaa6..60af5ae1d 100644 Binary files a/test/fixtures/screenshots/linux/desktop/homepage/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/homepage/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/homepage/_footer.png b/test/fixtures/screenshots/linux/desktop/homepage/_footer.png index 8c5c67e4b..4d9747787 100644 Binary files a/test/fixtures/screenshots/linux/desktop/homepage/_footer.png and b/test/fixtures/screenshots/linux/desktop/homepage/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/homepage/_services.png b/test/fixtures/screenshots/linux/desktop/homepage/_services.png index 4de47a80e..c085e69c6 100644 Binary files a/test/fixtures/screenshots/linux/desktop/homepage/_services.png and b/test/fixtures/screenshots/linux/desktop/homepage/_services.png differ diff --git a/test/fixtures/screenshots/linux/desktop/homepage/_technologies.png b/test/fixtures/screenshots/linux/desktop/homepage/_technologies.png index 0f0a347ea..675ccc657 100644 Binary files a/test/fixtures/screenshots/linux/desktop/homepage/_technologies.png and b/test/fixtures/screenshots/linux/desktop/homepage/_technologies.png differ diff --git a/test/fixtures/screenshots/linux/desktop/nav/services.png b/test/fixtures/screenshots/linux/desktop/nav/services.png index c0ae83ba1..2bb6cc87d 100644 Binary files a/test/fixtures/screenshots/linux/desktop/nav/services.png and b/test/fixtures/screenshots/linux/desktop/nav/services.png differ diff --git a/test/fixtures/screenshots/linux/desktop/nav/use_cases.png b/test/fixtures/screenshots/linux/desktop/nav/use_cases.png index fe44a626f..ca5690da8 100644 Binary files a/test/fixtures/screenshots/linux/desktop/nav/use_cases.png and b/test/fixtures/screenshots/linux/desktop/nav/use_cases.png differ diff --git a/test/fixtures/screenshots/linux/desktop/privacy-policy.png b/test/fixtures/screenshots/linux/desktop/privacy-policy.png index a8f5e336d..bf8959bd0 100644 Binary files a/test/fixtures/screenshots/linux/desktop/privacy-policy.png and b/test/fixtures/screenshots/linux/desktop/privacy-policy.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/services/_cta-contact_us.png index f72e0499c..7ec9f3d85 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/services/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_footer.png b/test/fixtures/screenshots/linux/desktop/services/_footer.png index 26fbeb7fd..c51281891 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_footer.png and b/test/fixtures/screenshots/linux/desktop/services/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_overview.png b/test/fixtures/screenshots/linux/desktop/services/_overview.png index 64064b274..e7e5d1531 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_overview.png and b/test/fixtures/screenshots/linux/desktop/services/_overview.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_services.png b/test/fixtures/screenshots/linux/desktop/services/_services.png index 03eaaa3f6..4dd0393bd 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_services.png and b/test/fixtures/screenshots/linux/desktop/services/_services.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_technologies.png b/test/fixtures/screenshots/linux/desktop/services/_technologies.png index 5077fc89f..58a30ed48 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_technologies.png and b/test/fixtures/screenshots/linux/desktop/services/_technologies.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_testimonials-header.png b/test/fixtures/screenshots/linux/desktop/services/_testimonials-header.png index 79711cc0b..792c3983a 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_testimonials-header.png and b/test/fixtures/screenshots/linux/desktop/services/_testimonials-header.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/_use-cases.png b/test/fixtures/screenshots/linux/desktop/services/_use-cases.png index 85ca9eb42..7edcc062d 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/_use-cases.png and b/test/fixtures/screenshots/linux/desktop/services/_use-cases.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/app_web_development.png b/test/fixtures/screenshots/linux/desktop/services/app_web_development.png index af7d37fb7..d6d353fe5 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/app_web_development.png and b/test/fixtures/screenshots/linux/desktop/services/app_web_development.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/app_web_development_hero.png b/test/fixtures/screenshots/linux/desktop/services/app_web_development_hero.png index ddbe56ee2..58287cf18 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/app_web_development_hero.png and b/test/fixtures/screenshots/linux/desktop/services/app_web_development_hero.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_clients-case-studies.png b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_clients-case-studies.png index 66895b0fc..6786fd1c0 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_clients-case-studies.png and b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_clients-case-studies.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_cta-contact_us.png index 92032472f..a1fdb5713 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_footer.png b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_footer.png index 5b7335812..ffcbf2eff 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_footer.png and b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_overview.png b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_overview.png index 587974285..ed2ac6da4 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_overview.png and b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_overview.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials-header.png b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials-header.png index f27df449e..a7d6461a4 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials-header.png and b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials-header.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials.png b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials.png index a70234041..ff7f3cb15 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials.png and b/test/fixtures/screenshots/linux/desktop/services/fractional-cto/_testimonials.png differ diff --git a/test/fixtures/screenshots/linux/desktop/services/fractional_cto.png b/test/fixtures/screenshots/linux/desktop/services/fractional_cto.png index 7db214cf9..eaac92ed3 100644 Binary files a/test/fixtures/screenshots/linux/desktop/services/fractional_cto.png and b/test/fixtures/screenshots/linux/desktop/services/fractional_cto.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/use-cases/_cta-contact_us.png index a99528d96..a9944eae3 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/use-cases/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/_footer.png b/test/fixtures/screenshots/linux/desktop/use-cases/_footer.png index c290394a4..bab7e79e2 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/_footer.png and b/test/fixtures/screenshots/linux/desktop/use-cases/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/_overview.png b/test/fixtures/screenshots/linux/desktop/use-cases/_overview.png index 1117df95a..41a4fc8d1 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/_overview.png and b/test/fixtures/screenshots/linux/desktop/use-cases/_overview.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/_technologies.png b/test/fixtures/screenshots/linux/desktop/use-cases/_technologies.png index 37b983b66..24e584184 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/_technologies.png and b/test/fixtures/screenshots/linux/desktop/use-cases/_technologies.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/_testimonials-header.png b/test/fixtures/screenshots/linux/desktop/use-cases/_testimonials-header.png index 7d0980f62..18039c05c 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/_testimonials-header.png and b/test/fixtures/screenshots/linux/desktop/use-cases/_testimonials-header.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_clients-case-studies.png b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_clients-case-studies.png index a6d7f81fe..a9c81f7e4 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_clients-case-studies.png and b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_clients-case-studies.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_cta-contact_us.png b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_cta-contact_us.png index 5a642fb52..a1fdb5713 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_cta-contact_us.png and b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_cta-contact_us.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_footer.png b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_footer.png index f9326a706..ffcbf2eff 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_footer.png and b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_footer.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_overview.png b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_overview.png index 329a5c714..2d87fcdef 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_overview.png and b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_overview.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_solution.png b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_solution.png index 7533eb5ee..58f684534 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_solution.png and b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_solution.png differ diff --git a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_testimonials-header.png b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_testimonials-header.png index 20fae266d..75a0dc789 100644 Binary files a/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_testimonials-header.png and b/test/fixtures/screenshots/linux/desktop/use-cases/startup-mvp-prototyping-development/_testimonials-header.png differ diff --git a/test/fixtures/screenshots/linux/mobile/404.png b/test/fixtures/screenshots/linux/mobile/404.png index 142b03ab7..f6f846d80 100644 Binary files a/test/fixtures/screenshots/linux/mobile/404.png and b/test/fixtures/screenshots/linux/mobile/404.png differ diff --git a/test/fixtures/screenshots/linux/mobile/about_page/achievements.png b/test/fixtures/screenshots/linux/mobile/about_page/achievements.png index b3ef37983..5343bdf8c 100644 Binary files a/test/fixtures/screenshots/linux/mobile/about_page/achievements.png and b/test/fixtures/screenshots/linux/mobile/about_page/achievements.png differ diff --git a/test/fixtures/screenshots/linux/mobile/about_page/values.png b/test/fixtures/screenshots/linux/mobile/about_page/values.png index 91d412b73..fc85a175b 100644 Binary files a/test/fixtures/screenshots/linux/mobile/about_page/values.png and b/test/fixtures/screenshots/linux/mobile/about_page/values.png differ diff --git a/test/fixtures/screenshots/linux/mobile/about_us.png b/test/fixtures/screenshots/linux/mobile/about_us.png index 4a29d75dc..933e7d147 100644 Binary files a/test/fixtures/screenshots/linux/mobile/about_us.png and b/test/fixtures/screenshots/linux/mobile/about_us.png differ diff --git a/test/fixtures/screenshots/linux/mobile/blog/index.png b/test/fixtures/screenshots/linux/mobile/blog/index.png index 928c15c25..3c8a1c19d 100644 Binary files a/test/fixtures/screenshots/linux/mobile/blog/index.png and b/test/fixtures/screenshots/linux/mobile/blog/index.png differ diff --git a/test/fixtures/screenshots/linux/mobile/blog/index/_pagination.png b/test/fixtures/screenshots/linux/mobile/blog/index/_pagination.png index 2faa727a8..03a27e893 100644 Binary files a/test/fixtures/screenshots/linux/mobile/blog/index/_pagination.png and b/test/fixtures/screenshots/linux/mobile/blog/index/_pagination.png differ diff --git a/test/fixtures/screenshots/linux/mobile/blog/post.png b/test/fixtures/screenshots/linux/mobile/blog/post.png index 371d67f8e..c49cf170a 100644 Binary files a/test/fixtures/screenshots/linux/mobile/blog/post.png and b/test/fixtures/screenshots/linux/mobile/blog/post.png differ diff --git a/test/fixtures/screenshots/linux/mobile/careers.png b/test/fixtures/screenshots/linux/mobile/careers.png index 657c0f802..79001b026 100644 Binary files a/test/fixtures/screenshots/linux/mobile/careers.png and b/test/fixtures/screenshots/linux/mobile/careers.png differ diff --git a/test/fixtures/screenshots/linux/mobile/clients.png b/test/fixtures/screenshots/linux/mobile/clients.png index be0b88e16..69262f902 100644 Binary files a/test/fixtures/screenshots/linux/mobile/clients.png and b/test/fixtures/screenshots/linux/mobile/clients.png differ diff --git a/test/fixtures/screenshots/linux/mobile/contact_us.png b/test/fixtures/screenshots/linux/mobile/contact_us.png index 1f8fccdf6..cccde5b88 100644 Binary files a/test/fixtures/screenshots/linux/mobile/contact_us.png and b/test/fixtures/screenshots/linux/mobile/contact_us.png differ diff --git a/test/fixtures/screenshots/linux/mobile/free_consultation.png b/test/fixtures/screenshots/linux/mobile/free_consultation.png index f62da40ce..c76710c61 100644 Binary files a/test/fixtures/screenshots/linux/mobile/free_consultation.png and b/test/fixtures/screenshots/linux/mobile/free_consultation.png differ diff --git a/test/fixtures/screenshots/linux/mobile/homepage.png b/test/fixtures/screenshots/linux/mobile/homepage.png index 11f229381..84101bb74 100644 Binary files a/test/fixtures/screenshots/linux/mobile/homepage.png and b/test/fixtures/screenshots/linux/mobile/homepage.png differ diff --git a/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu.png b/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu.png index c2bad3311..287e5c2d7 100644 Binary files a/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu.png and b/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu.png differ diff --git a/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu/services.png b/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu/services.png index a1dc589b1..529f342b3 100644 Binary files a/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu/services.png and b/test/fixtures/screenshots/linux/mobile/nav/hamburger_menu/services.png differ diff --git a/test/fixtures/screenshots/linux/pages/careers/benefits-section.png b/test/fixtures/screenshots/linux/pages/careers/benefits-section.png index 9fa2090f8..9829dc5e4 100644 Binary files a/test/fixtures/screenshots/linux/pages/careers/benefits-section.png and b/test/fixtures/screenshots/linux/pages/careers/benefits-section.png differ diff --git a/test/fixtures/screenshots/linux/pages/careers/benefits-spacing.png b/test/fixtures/screenshots/linux/pages/careers/benefits-spacing.png index 9fa2090f8..9829dc5e4 100644 Binary files a/test/fixtures/screenshots/linux/pages/careers/benefits-spacing.png and b/test/fixtures/screenshots/linux/pages/careers/benefits-spacing.png differ diff --git a/test/fixtures/screenshots/linux/pages/careers/careers-page-full.png b/test/fixtures/screenshots/linux/pages/careers/careers-page-full.png index 9fa2090f8..9829dc5e4 100644 Binary files a/test/fixtures/screenshots/linux/pages/careers/careers-page-full.png and b/test/fixtures/screenshots/linux/pages/careers/careers-page-full.png differ diff --git a/test/fixtures/screenshots/linux/pages/careers/feature-cards-section.png b/test/fixtures/screenshots/linux/pages/careers/feature-cards-section.png index 9fa2090f8..9829dc5e4 100644 Binary files a/test/fixtures/screenshots/linux/pages/careers/feature-cards-section.png and b/test/fixtures/screenshots/linux/pages/careers/feature-cards-section.png differ diff --git a/test/fixtures/screenshots/linux/pages/careers/newsletter-section.png b/test/fixtures/screenshots/linux/pages/careers/newsletter-section.png index 9fa2090f8..9829dc5e4 100644 Binary files a/test/fixtures/screenshots/linux/pages/careers/newsletter-section.png and b/test/fixtures/screenshots/linux/pages/careers/newsletter-section.png differ diff --git a/test/fixtures/screenshots/macos/pages/careers/benefits-section.png b/test/fixtures/screenshots/macos/pages/careers/benefits-section.png index 4e75ef773..b2cee7866 100644 Binary files a/test/fixtures/screenshots/macos/pages/careers/benefits-section.png and b/test/fixtures/screenshots/macos/pages/careers/benefits-section.png differ diff --git a/test/fixtures/screenshots/macos/pages/careers/benefits-spacing.png b/test/fixtures/screenshots/macos/pages/careers/benefits-spacing.png index 4e75ef773..b2cee7866 100644 Binary files a/test/fixtures/screenshots/macos/pages/careers/benefits-spacing.png and b/test/fixtures/screenshots/macos/pages/careers/benefits-spacing.png differ diff --git a/test/fixtures/screenshots/macos/pages/careers/careers-page-full.png b/test/fixtures/screenshots/macos/pages/careers/careers-page-full.png index 4e75ef773..b2cee7866 100644 Binary files a/test/fixtures/screenshots/macos/pages/careers/careers-page-full.png and b/test/fixtures/screenshots/macos/pages/careers/careers-page-full.png differ diff --git a/test/fixtures/screenshots/macos/pages/careers/feature-cards-section.png b/test/fixtures/screenshots/macos/pages/careers/feature-cards-section.png index 4e75ef773..b2cee7866 100644 Binary files a/test/fixtures/screenshots/macos/pages/careers/feature-cards-section.png and b/test/fixtures/screenshots/macos/pages/careers/feature-cards-section.png differ diff --git a/test/fixtures/screenshots/macos/pages/careers/newsletter-section.png b/test/fixtures/screenshots/macos/pages/careers/newsletter-section.png index 4e75ef773..b2cee7866 100644 Binary files a/test/fixtures/screenshots/macos/pages/careers/newsletter-section.png and b/test/fixtures/screenshots/macos/pages/careers/newsletter-section.png differ diff --git a/test/support/setup_capybara.rb b/test/support/setup_capybara.rb index 8ead67f4e..a3dbbb0b9 100644 --- a/test/support/setup_capybara.rb +++ b/test/support/setup_capybara.rb @@ -80,6 +80,6 @@ def register_chrome_driver(name, device_metrics) Capybara.current_driver = Capybara.javascript_driver Capybara.disable_animation = true Capybara.threadsafe = false -Capybara.default_max_wait_time = 10 +Capybara.default_max_wait_time = 5 Capybara.save_path = "tmp/capybara/" diff --git a/test/support/setup_snap_diff.rb b/test/support/setup_snap_diff.rb index aca6d5ac8..1231c93fb 100644 --- a/test/support/setup_snap_diff.rb +++ b/test/support/setup_snap_diff.rb @@ -1,80 +1,24 @@ # Screenshot Testing Configuration # -# Environment Variables for controlling screenshot behavior: -# - SCREENSHOT_TOLERANCE: Override global tolerance (default: 0.01 = 1%) -# - SCREENSHOT_STABILITY_TIME: Override stability wait time (default: 1.0s) -# - FORCE_SCREENSHOT_UPDATE: Set to 'true' to regenerate all baseline screenshots -# - CAPYBARA_SCREENSHOT_DIFF_FAIL_ON_DIFFERENCE: Set to 'false' to update baselines -# -# Usage Examples: -# SCREENSHOT_TOLERANCE=0.02 bundle exec rake test # 2% tolerance -# SCREENSHOT_STABILITY_TIME=2.0 bundle exec rake test # 2s stability time -# FORCE_SCREENSHOT_UPDATE=true bundle exec rake test # Regenerate baselines +# Environment Variables: +# - SCREENSHOT_STABILITY_TIME: Override stability wait time (default: 0.1s) +# - FORCE_SCREENSHOT_UPDATE: Set to 'true' to regenerate all baselines # require "capybara_screenshot_diff/minitest" +require "capybara_screenshot_diff/reporters/html" Capybara::Screenshot.save_path = "test/fixtures/screenshots" Capybara::Screenshot.add_os_path = true Capybara::Screenshot.window_size = nil - -# Screenshot stability and tolerance settings -# -# stability_time_limit: Time to wait for the page to be stable before taking screenshot -# Increased from 0.25s to 1.0s to reduce flakiness from animations/loading states Capybara::Screenshot.stability_time_limit = ENV.fetch("SCREENSHOT_STABILITY_TIME", "0.1").to_f - -# tolerance: Allowed difference percentage between baseline and current screenshot -# Increased from 0.005 (0.5%) to 0.01 (1%) to handle cross-platform rendering differences -# across different environments, versions, and operating systems -Capybara::Screenshot::Diff.tolerance = ENV.fetch("SCREENSHOT_TOLERANCE", "0.005").to_f +Capybara::Screenshot.disable_animations = true +Capybara::Screenshot.root = Dir.pwd Capybara::Screenshot::Diff.driver = :vips +Capybara::Screenshot::Diff.perceptual_threshold = 2.0 Capybara::Screenshot::Diff.delayed = true -Capybara.default_max_wait_time = 5 - -# Add global setup hook to disable animations for all screenshot tests -Capybara.configure do |config| - # Ensure screenshots are taken with consistent rendering - config.default_set_options = {clear: :backspace} -end -# Add after_action callback to prepare pages for screenshots if needed -module ScreenshotPreparation - def self.disable_animations_globally(page) - page.execute_script(<<~JS) if page.driver.browser.respond_to?(:execute_script) - if (!document.querySelector('#screenshot-test-animations-disabled')) { - const style = document.createElement('style'); - style.id = 'screenshot-test-animations-disabled'; - style.innerHTML = ` - *, *::before, *::after { - animation-duration: 0s !important; - animation-delay: 0s !important; - transition-duration: 0s !important; - transition-delay: 0s !important; - animation-play-state: paused !important; - -webkit-animation-duration: 0s !important; - -webkit-animation-delay: 0s !important; - -webkit-transition-duration: 0s !important; - -webkit-transition-delay: 0s !important; - } - `; - document.head.appendChild(style); - } - JS - end -end - -# Environment variable controls for screenshot behavior -# -# CAPYBARA_SCREENSHOT_DIFF_FAIL_ON_DIFFERENCE=false: Useful for updating screenshot baselines -if ENV["CAPYBARA_SCREENSHOT_DIFF_FAIL_ON_DIFFERENCE"] == "false" - Capybara::Screenshot::Diff.fail_on_difference = false -end - -# FORCE_SCREENSHOT_UPDATE=true: Regenerate all baseline screenshots if ENV["FORCE_SCREENSHOT_UPDATE"] == "true" Capybara::Screenshot::Diff.fail_on_difference = false end - -Capybara::Screenshot.root = Dir.pwd diff --git a/test/system/desktop_site_test.rb b/test/system/desktop_site_test.rb index 42b29ff24..7238dcbcf 100644 --- a/test/system/desktop_site_test.rb +++ b/test/system/desktop_site_test.rb @@ -19,8 +19,8 @@ def test_homepage # Move mouse to (0,0) to prevent menu hover state causing flakiness page.driver.browser.action.move_to_location(0, 0).perform - # Wait for animations to complete - sleep 0.5 + # Anchor on hero content before screenshot + assert_selector ".hero, [data-section=hero], main", wait: 2 assert_screenshot "homepage", tolerance: 0.03 end @@ -57,7 +57,7 @@ def test_visit_blog_post def test_blog_post visit "/blog/red-flags-watch-for-in-big-pr-when-stop-split-or-rework-development-productivity/" - assert_stable_screenshot "blog/post", tolerance: 0.03, stability_time_limit: 5 + assert_stable_screenshot "blog/post", tolerance: 0.03, stability_time_limit: 1 end def test_about_us @@ -128,7 +128,7 @@ def test_services verify_section_for("services", "overview", css: '[data-node="i8x1zs2grf9h"]') verify_section_for("services", "services", css: '[data-node="nhf6l2ycmzoe"]') verify_section_for("services", "technologies") - verify_section_for("services", "use-cases") + verify_section_for("services", "use-cases", stability_time_limit: 1) verify_section_for("services", "testimonials-header", css: '[data-node="1a4igunq3xvj"]') verify_section_for("services", "cta-contact_us", css: '[data-node="ohd51ixf3842"]') verify_section_for("services", "footer", css: "footer") @@ -307,10 +307,9 @@ def test_about_page_sections private - def verify_section_for(page_name, section_id, css: nil) + def verify_section_for(page_name, section_id, css: nil, **options) scroll_to find(css || "##{section_id}") - # Ruby hash-based config handles tolerance automatically - assert_screenshot "#{page_name}/_#{section_id}" + assert_screenshot "#{page_name}/_#{section_id}", **options end def within_top_bar