File tree Expand file tree Collapse file tree 4 files changed +35
-22
lines changed Expand file tree Collapse file tree 4 files changed +35
-22
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ FROM ruby:2.7.8
33# Install dependency packages
44RUN apt-get update && apt-get install -y \
55 chromium \
6+ chromium-driver \
67 curl \
78 fonts-liberation \
89 libappindicator3-1 \
Original file line number Diff line number Diff line change 1111 specs:
1212 addressable (2.8.7 )
1313 public_suffix (>= 2.0.2 , < 7.0 )
14- apparition (0.6.0 )
15- capybara (~> 3.13 , < 4 )
16- websocket-driver (>= 0.6.5 )
1714 ast (2.4.3 )
18- base64 (0.2.0 )
1915 bigdecimal (3.1.9 )
2016 byebug (11.1.3 )
2117 capybara (3.39.2 )
5248 matrix (0.4.2 )
5349 method_source (1.1.0 )
5450 mini_mime (1.1.5 )
51+ mini_portile2 (2.8.9 )
52+ nokogiri (1.15.7 )
53+ mini_portile2 (~> 2.8.2 )
54+ racc (~> 1.4 )
5555 nokogiri (1.15.7-aarch64-linux )
5656 racc (~> 1.4 )
5757 nokogiri (1.15.7-arm64-darwin )
102102 rubocop-rspec (1.41.0 )
103103 rubocop (>= 0.68.1 )
104104 ruby-progressbar (1.13.0 )
105+ rubyzip (2.4.1 )
106+ selenium-webdriver (4.9.0 )
107+ rexml (~> 3.2 , >= 3.2.5 )
108+ rubyzip (>= 1.2.2 , < 3.0 )
109+ websocket (~> 1.0 )
105110 simplecov (0.22.0 )
106111 docile (~> 1.1 )
107112 simplecov-html (~> 0.11 )
@@ -113,27 +118,26 @@ GEM
113118 addressable (>= 2.8.0 )
114119 crack (>= 0.3.2 )
115120 hashdiff (>= 0.4.0 , < 2.0.0 )
116- websocket-driver (0.7.7 )
117- base64
118- websocket-extensions (>= 0.1.0 )
119- websocket-extensions (0.1.5 )
121+ websocket (1.2.11 )
120122 xpath (3.2.0 )
121123 nokogiri (~> 1.8 )
122124
123125PLATFORMS
124126 aarch64-linux
125127 arm64-darwin-24
128+ ruby
126129 x86_64-linux
127130
128131DEPENDENCIES
129- apparition
132+ capybara
130133 grpc-web !
131134 pry-byebug
132135 rack-cors
133136 rake
134137 rspec (~> 3.3 )
135138 rubocop (~> 0.79.0 )
136139 rubocop-rspec
140+ selenium-webdriver
137141 simplecov
138142 webmock
139143
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ Gem::Specification.new do |spec|
2424 spec . add_dependency 'google-protobuf' , '~> 3.13.0'
2525 spec . add_dependency 'rack' , '>= 1.6.0' , '< 3.0'
2626
27- spec . add_development_dependency 'apparition'
27+ spec . add_development_dependency 'capybara'
28+ spec . add_development_dependency 'selenium-webdriver'
2829 spec . add_development_dependency 'pry-byebug'
2930 spec . add_development_dependency 'rack-cors'
3031 spec . add_development_dependency 'rake'
Original file line number Diff line number Diff line change 109109 require 'test_grpc_web_app'
110110 Capybara . app = TestGRPCWebApp . build
111111
112- require 'capybara/apparition'
113- Capybara . register_driver :apparition do |app |
114- opts = {
115- headless : true ,
116- browser_options : [
117- :no_sandbox ,
118- { disable_features : 'VizDisplayCompositor' } ,
119- :disable_gpu ,
120- ] ,
121- }
122- Capybara ::Apparition ::Driver . new ( app , opts )
112+ require 'selenium-webdriver'
113+
114+ Capybara . register_driver :selenium_chrome_headless do |app |
115+ options = Selenium ::WebDriver ::Chrome ::Options . new
116+ # Run Chrome without a GUI, necessary for CI/Docker environments
117+ options . add_argument ( '--headless' )
118+ # Disable Chrome sandbox, required when running as root in Docker containers
119+ options . add_argument ( '--no-sandbox' )
120+ # Prevent Chrome from using /dev/shm which can be too small in Docker, causing crashes
121+ options . add_argument ( '--disable-dev-shm-usage' )
122+ # Disable GPU hardware acceleration to prevent crashes in headless mode
123+ options . add_argument ( '--disable-gpu' )
124+
125+ Capybara ::Selenium ::Driver . new (
126+ app ,
127+ browser : :chrome ,
128+ options : options
129+ )
123130 end
124- Capybara . default_driver = :apparition
131+ Capybara . default_driver = :selenium_chrome_headless
125132 end
126133end
You can’t perform that action at this time.
0 commit comments