Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions .dev/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
x-backend: &backend
image: jetthoughts.com-test:1.0.0
build:
context: .
dockerfile: ./Dockerfile
context: ../
dockerfile: ./.dev/Dockerfile
Comment thread
pftg marked this conversation as resolved.
stdin_open: true
tty: true
volumes:
Expand Down
34 changes: 17 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -63,29 +65,29 @@ 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)
mini_mime (1.1.5)
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)
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -120,15 +121,15 @@ 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)
rubocop-ast (>= 1.31.1, < 2.0)
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)
Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euo pipefail

hugo --minify --environment production --forceSyncStatic --cleanDestinationDir --logLevel warn "$@"
2 changes: 1 addition & 1 deletion bin/docked
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -eo pipefail

bin/compose run --rm "$@"
bin/compose run --rm --quiet-pull --remove-orphans "$@"
6 changes: 6 additions & 0 deletions bin/dtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

set -eo pipefail

bin/build --destination public-test --baseURL http://localhost:1314
bin/docked t "$@"
2 changes: 1 addition & 1 deletion bin/setup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -eo pipefail

Expand Down
2 changes: 0 additions & 2 deletions bin/test
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/sh

set -eo pipefail

test_files="${1:-test/*_test.rb}"
bundle exec ruby -Itest $test_files
6 changes: 3 additions & 3 deletions test/desktop_site_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ 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
visit "/blog/"

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
Expand Down Expand Up @@ -177,7 +177,7 @@ def test_not_found
private

def within_top_bar
within "nav" do
within ".navigation" do
yield
end
end
Expand Down
Binary file modified test/fixtures/screenshots/linux/desktop/about_us.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/blog/index.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/blog/post.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/careers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/clients.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/clients/_footer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/homepage/_footer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/nav/services.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/linux/desktop/nav/use_cases.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/macos/mobile/blog/index/_pagination.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/fixtures/screenshots/macos/mobile/nav/hamburger_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions test/mobile_site_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ 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
visit "/blog/"

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
Expand Down
2 changes: 1 addition & 1 deletion test/support/setup_capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down