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
54 changes: 25 additions & 29 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GEM
base64 (0.3.0)
bigdecimal (4.1.2)
bindex (0.8.1)
bootsnap (1.23.0)
bootsnap (1.24.4)
msgpack (~> 1.2)
brakeman (8.0.4)
racc
Expand Down Expand Up @@ -117,7 +117,7 @@ GEM
erb (6.0.4)
erubi (1.13.1)
erubis (2.7.0)
factory_bot (6.5.6)
factory_bot (6.6.0)
activesupport (>= 6.1.0)
factory_bot_rails (6.5.1)
factory_bot (~> 6.5)
Expand All @@ -142,15 +142,12 @@ GEM
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.14.1)
jbuilder (2.15.0)
actionview (>= 7.0.0)
activesupport (>= 7.0.0)
jsbundling-rails (1.3.1)
railties (>= 6.0.0)
json (2.19.5)
json-schema (6.1.0)
addressable (~> 2.8)
bigdecimal (>= 3.1, < 5)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
Expand All @@ -165,8 +162,6 @@ GEM
net-smtp
marcel (1.1.0)
matrix (0.4.3)
mcp (0.7.1)
json-schema (>= 4.1)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
Expand All @@ -175,13 +170,14 @@ GEM
minitest (6.0.6)
drb (~> 2.0)
prism (~> 1.5)
mongo (2.23.0)
mongo (2.24.0)
base64
bson (>= 4.14.1, < 6.0.0)
mongoid (9.0.10)
mongoid (9.1.0)
activemodel (>= 5.1, < 8.2, != 7.0.0)
concurrent-ruby (>= 1.0.5, < 2.0)
mongo (>= 2.18.0, < 3.0.0)
ostruct
msgpack (1.8.0)
multipart-post (2.4.1)
net-http (0.9.1)
Expand All @@ -205,31 +201,31 @@ GEM
nokogiri (1.19.3-x86_64-linux-gnu)
racc (~> 1.4)
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.10.2)
parallel (2.1.0)
parser (3.3.11.1)
ast (~> 2.4.1)
racc
pg (1.6.3-aarch64-linux)
pg (1.6.3-arm64-darwin)
pg (1.6.3-x86_64-darwin)
pg (1.6.3-x86_64-linux)
playwright-ruby-client (1.59.0)
playwright-ruby-client (1.60.0)
base64
concurrent-ruby (>= 1.1.6)
mime-types (>= 3.0)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
propshaft (1.3.1)
propshaft (1.3.2)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
psych (5.3.1)
date
stringio
public_suffix (7.0.5)
puma (7.2.0)
puma (8.0.1)
nio4r (~> 2.0)
racc (1.8.1)
rack (3.2.6)
Expand Down Expand Up @@ -265,12 +261,13 @@ GEM
rails-html-sanitizer (1.7.0)
loofah (~> 2.25)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rails_best_practices (1.23.3)
rails_best_practices (1.23.4)
activesupport
code_analyzer (~> 0.5.5)
erubis
i18n
json
ostruct
require_all (~> 3.0)
ruby-progressbar
railties (8.1.3)
Expand All @@ -290,9 +287,9 @@ GEM
tsort
redis (5.4.1)
redis-client (>= 0.22.0)
redis-client (0.26.4)
redis-client (0.29.0)
connection_pool
regexp_parser (2.11.3)
regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5)
require_all (3.0.0)
Expand All @@ -304,35 +301,34 @@ GEM
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (8.0.3)
rspec-rails (8.0.4)
actionpack (>= 7.2)
activesupport (>= 7.2)
railties (>= 7.2)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-core (>= 3.13.0, < 5.0.0)
rspec-expectations (>= 3.13.0, < 5.0.0)
rspec-mocks (>= 3.13.0, < 5.0.0)
rspec-support (>= 3.13.0, < 5.0.0)
rspec-support (3.13.7)
rubocop (1.85.0)
rubocop (1.86.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
mcp (~> 0.6)
parallel (~> 1.10)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.34.3)
rubocop-rails (2.35.2)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
Expand All @@ -345,7 +341,7 @@ GEM
ruby-progressbar (1.13.0)
securerandom (0.4.1)
sexp_processor (4.17.5)
spring (4.4.2)
spring (4.5.0)
stringio (3.2.0)
thor (1.5.0)
timeout (0.6.1)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ $ ./bin/dev

`bin/dev` runs Rails plus pnpm JS and Tailwind CSS watchers, so Hotwire and stylesheet assets stay current while you work.
The same scripts are available directly as `pnpm build`, `pnpm build:js:watch`, and `pnpm build:css:watch`.
The Playwright visual smoke spec uses the browser version expected by `playwright-ruby-client`; CI installs it automatically.
For local visual snapshots:

```console
$ PLAYWRIGHT_VERSION=$(mise exec -- ruby -e 'require "playwright"; puts Playwright::COMPATIBLE_PLAYWRIGHT_VERSION')
$ mise exec -- npx "playwright@$PLAYWRIGHT_VERSION" install chromium
$ VISUAL_SNAPSHOTS=1 mise exec -- bundle exec rspec spec/system/all_pages_visual_smoke_spec.rb
```

![Application is available](./references/application-up-in-browser.png)

Expand Down
8 changes: 4 additions & 4 deletions app/views/file_metadata/all_metadata_show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= @metadata %>
</div>

<div class="border">
<div class="mt-4 border-t border-zinc-200 pt-4">
<%= form_tag(metadata_show_file_metadata_path, method: :get, class: 'uc-form-panel') do %>
<%= hidden_field_tag :uuid, @uuid %>
<div class="mb-2">
Expand All @@ -17,7 +17,7 @@
<% end %>
</div>

<div class="border">
<div class="mt-4 border-t border-zinc-200 pt-4">
<%= form_tag(metadata_update_file_metadata_path, method: :patch, class: 'uc-form-panel') do %>
<%= hidden_field_tag :uuid, @uuid %>
<div class="mb-2">
Expand All @@ -32,7 +32,7 @@
<% end %>
</div>

<div class="border">
<div class="mt-4 border-t border-zinc-200 pt-4">
<%= form_tag(metadata_update_file_metadata_path, method: :patch, class: 'uc-form-panel') do %>
<%= hidden_field_tag :uuid, @uuid %>
<div class="mb-2">
Expand All @@ -47,7 +47,7 @@
<% end %>
</div>

<div class="border">
<div class="mt-4 border-t border-zinc-200 pt-4">
<%= form_tag(metadata_delete_file_metadata_path, method: :delete, class: 'uc-form-panel') do %>
<%= hidden_field_tag :uuid, @uuid %>
<div class="mb-2">
Expand Down
24 changes: 22 additions & 2 deletions spec/support/system_driver.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# frozen_string_literal: true

require "capybara-playwright-driver"
require "playwright"

PLAYWRIGHT_CLI_EXECUTABLE_PATH = ENV.fetch(
"PLAYWRIGHT_CLI_EXECUTABLE_PATH",
"npx playwright@#{Playwright::COMPATIBLE_PLAYWRIGHT_VERSION}"
)

Capybara.register_driver(:playwright) do |app|
Capybara::Playwright::Driver.new(
app,
browser_type: :chromium,
headless: ENV.fetch("PLAYWRIGHT_HEADLESS", "true") != "false",
playwright_cli_executable_path: PLAYWRIGHT_CLI_EXECUTABLE_PATH
)
end

Capybara.save_path = Rails.root.join("tmp/capybara").to_s
Capybara.server = :puma, { Silent: true }

RSpec.configure do |config|
config.before(:each, type: :system) do
driven_by :rack_test
config.before(:each, type: :system) do |example|
driven_by(example.metadata[:playwright] ? :playwright : :rack_test)
end
end
Loading
Loading