diff --git a/.dev/Dockerfile b/.dev/Dockerfile index 06d861c28..a42f32d72 100644 --- a/.dev/Dockerfile +++ b/.dev/Dockerfile @@ -43,7 +43,12 @@ ENV \ OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES \ PATH="/app/bin:$PATH" \ PRECOMPILED_ASSETS=true \ - RUBY_YJIT_ENABLE=1 + RUBY_YJIT_ENABLE=1 \ + TEST_SERVER_PORT=1314 + +# Install bundle from Gemfile +COPY ../Gemfile ../Gemfile.lock ./ +RUN bundle install # Use Bash as the default command CMD ["bin/test"] diff --git a/.dev/compose.yml b/.dev/compose.yml index 54dd078a8..fe52169e9 100644 --- a/.dev/compose.yml +++ b/.dev/compose.yml @@ -2,8 +2,8 @@ x-backend: &backend image: jetthoughts.com-test:1.0.0 build: - context: . - dockerfile: ./Dockerfile + context: ../ + dockerfile: ./.dev/Dockerfile stdin_open: true tty: true volumes: diff --git a/Gemfile.lock b/Gemfile.lock index ca20e871a..786d82be0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/snap-diff/snap_diff-capybara.git - revision: 31f17556e18c0edc1f9b825191c427f073f3f193 + revision: 2c946980d559a6b4b9baa1bff94f98e5acec34af specs: capybara-screenshot-diff (1.9.1) actionpack (>= 6.1, < 8) @@ -9,9 +9,9 @@ GIT GEM remote: https://rubygems.org/ specs: - actionpack (7.2.1.1) - actionview (= 7.2.1.1) - activesupport (= 7.2.1.1) + actionpack (7.2.2) + actionview (= 7.2.2) + activesupport (= 7.2.2) nokogiri (>= 1.8.5) racc rack (>= 2.2.4, < 3.2) @@ -20,14 +20,15 @@ GEM rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) useragent (~> 0.16) - actionview (7.2.1.1) - activesupport (= 7.2.1.1) + actionview (7.2.2) + activesupport (= 7.2.2) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activesupport (7.2.1.1) + activesupport (7.2.2) base64 + benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) @@ -41,6 +42,7 @@ GEM public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) + benchmark (0.3.0) bigdecimal (3.1.8) builder (3.3.0) capybara (3.40.0) @@ -63,14 +65,14 @@ GEM ffi (1.17.0-arm64-darwin) i18n (1.14.6) concurrent-ruby (~> 1.0) - json (2.7.2) + json (2.7.6) language_server-protocol (3.17.0.3) launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) lint_roller (1.1.0) logger (1.6.1) - loofah (2.22.0) + loofah (2.23.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) matrix (0.4.2) @@ -78,14 +80,14 @@ GEM mini_portile2 (2.8.7) minitest (5.25.1) mutex_m (0.2.0) - nio4r (2.7.3) + nio4r (2.7.4) nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) parallel (1.26.3) - parser (3.3.5.0) + parser (3.3.5.1) ast (~> 2.4.1) racc public_suffix (6.0.1) @@ -97,9 +99,8 @@ GEM rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (2.1.0) + rackup (2.2.0) rack (>= 3) - webrick (~> 1.8) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -109,7 +110,7 @@ GEM nokogiri (~> 1.14) rainbow (3.1.1) regexp_parser (2.9.2) - rexml (3.3.8) + rexml (3.3.9) rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) @@ -120,7 +121,7 @@ GEM rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + rubocop-ast (1.33.1) parser (>= 3.3.1.0) rubocop-performance (1.22.1) rubocop (>= 1.48.1, < 2.0) @@ -128,7 +129,7 @@ GEM ruby-progressbar (1.13.0) rubyzip (2.3.2) securerandom (0.3.1) - selenium-webdriver (4.25.0) + selenium-webdriver (4.26.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) @@ -152,7 +153,6 @@ GEM useragent (0.16.10) vips (8.15.1) ffi (~> 1.12) - webrick (1.8.2) websocket (1.2.11) xpath (3.2.0) nokogiri (~> 1.8) diff --git a/bin/build b/bin/build new file mode 100755 index 000000000..0b88437f5 --- /dev/null +++ b/bin/build @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euo pipefail + +hugo --minify --environment production --forceSyncStatic --cleanDestinationDir --logLevel warn "$@" diff --git a/bin/docked b/bin/docked index c37cd1053..db0668085 100755 --- a/bin/docked +++ b/bin/docked @@ -2,4 +2,4 @@ set -eo pipefail -bin/compose run --rm "$@" +bin/compose run --rm --quiet-pull --remove-orphans "$@" diff --git a/bin/dtest b/bin/dtest new file mode 100755 index 000000000..48ef6582a --- /dev/null +++ b/bin/dtest @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -eo pipefail + +bin/build --destination public-test --baseURL http://localhost:1314 +bin/docked t "$@" diff --git a/bin/setup b/bin/setup index 2b8b44e9a..55950d374 100755 --- a/bin/setup +++ b/bin/setup @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eo pipefail diff --git a/bin/test b/bin/test index 5be11e170..7f4d499d7 100755 --- a/bin/test +++ b/bin/test @@ -1,6 +1,4 @@ #!/bin/sh -set -eo pipefail - test_files="${1:-test/*_test.rb}" bundle exec ruby -Itest $test_files diff --git a/test/desktop_site_test.rb b/test/desktop_site_test.rb index e94d4a32e..682c54ce6 100644 --- a/test/desktop_site_test.rb +++ b/test/desktop_site_test.rb @@ -34,7 +34,7 @@ def test_blog_index click_on "Blog" end - assert_matches_screenshot "blog/index" + assert_matches_screenshot "blog/index", skip_area: [".blog-post"] end def test_blog_index_pagination @@ -42,7 +42,7 @@ def test_blog_index_pagination scroll_to find("#pagination") - assert_matches_screenshot "blog/index/_pagination", wait: 3, stability_time_limit: 0.25 + assert_matches_screenshot "blog/index/_pagination", skip_area: [".blog-post"], wait: 3, stability_time_limit: 0.25 end def test_visit_blog_post @@ -177,7 +177,7 @@ def test_not_found private def within_top_bar - within "nav" do + within ".navigation" do yield end end diff --git a/test/fixtures/screenshots/linux/desktop/about_us.png b/test/fixtures/screenshots/linux/desktop/about_us.png index e6545ba4d..8e7a00bfb 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 090e1c762..8eaa78c8c 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 33378d649..a05662919 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 2ed7f5a03..11302aab1 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 b1dbaa305..eb32eab5a 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/clients.png b/test/fixtures/screenshots/linux/desktop/clients.png index a98ca2ea0..45d31e4e6 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/_footer.png b/test/fixtures/screenshots/linux/desktop/clients/_footer.png index 9c8d88303..6ffff13a0 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/homepage/_footer.png b/test/fixtures/screenshots/linux/desktop/homepage/_footer.png index 9c8d88303..6ffff13a0 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/nav/services.png b/test/fixtures/screenshots/linux/desktop/nav/services.png index fdbf26108..9a0ef81a2 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 218ec7ea3..35784f5d4 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/macos/desktop/blog/index/_pagination.png b/test/fixtures/screenshots/macos/desktop/blog/index/_pagination.png index 0f20dba3a..31b06f8a8 100644 Binary files a/test/fixtures/screenshots/macos/desktop/blog/index/_pagination.png and b/test/fixtures/screenshots/macos/desktop/blog/index/_pagination.png differ diff --git a/test/fixtures/screenshots/macos/mobile/blog/index/_pagination.png b/test/fixtures/screenshots/macos/mobile/blog/index/_pagination.png index 145589acd..23d113985 100644 Binary files a/test/fixtures/screenshots/macos/mobile/blog/index/_pagination.png and b/test/fixtures/screenshots/macos/mobile/blog/index/_pagination.png differ diff --git a/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu.png b/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu.png index 9987106d7..d42798f8c 100644 Binary files a/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu.png and b/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu.png differ diff --git a/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu/services.png b/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu/services.png index 3403b1ca4..084136a50 100644 Binary files a/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu/services.png and b/test/fixtures/screenshots/macos/mobile/nav/hamburger_menu/services.png differ diff --git a/test/mobile_site_test.rb b/test/mobile_site_test.rb index 386d25289..c55115056 100644 --- a/test/mobile_site_test.rb +++ b/test/mobile_site_test.rb @@ -21,7 +21,7 @@ def test_homepage def test_blog_index visit "/blog/" - assert_matches_screenshot "blog/index" + assert_matches_screenshot "blog/index", skip_area: [".blog-post"] end def test_blog_index_pagination @@ -29,7 +29,7 @@ def test_blog_index_pagination scroll_to find("#pagination") - assert_matches_screenshot "blog/index/_pagination", wait: 3, stability_time_limit: 0.25 + assert_matches_screenshot "blog/index/_pagination", skip_area: [".blog-post"], wait: 3, stability_time_limit: 0.25 end def test_visit_blog_post diff --git a/test/support/setup_capybara.rb b/test/support/setup_capybara.rb index 827760ad2..445e75c3d 100644 --- a/test/support/setup_capybara.rb +++ b/test/support/setup_capybara.rb @@ -19,7 +19,7 @@ "disable-dev-shm-usage" => nil, "disable-domain-reliability" => nil, "disable-extensions" => nil, - "disable-features" => "TranslateUI,BlinkGenPropertyTrees", + "disable-features" => "TranslateUI,BlinkGenPropertyTrees,LazyImageLoading", "disable-hang-monitor" => nil, "disable-infobars" => nil, "disable-ipc-flooding-protection" => nil,