ruby-on-railsselenium-chromedrivercapybara

Error: Function rgb is missing argument $green in Rails System Test


I'm running my app's system tests in Ruby on Rails and it shows this error:

Error: Function rgb is missing argument $green. on line 1 of stdin >> 7280\]{--tw-border-opacity:1;border-color:rgb(107 114 128/var(--tw-border-op ------------------------------------------^

I have installed version 131.0.6778.108 of chromedriver and chrome.

This is the application_system_test_case.rb file:

require 'test_helper'

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  # driven_by :selenium, using: :firefox, screen_size: [1920, 1080]
  driven_by :selenium, using: :chrome, screen_size: [1920, 1080]

  setup do
    Selenium::WebDriver::Chrome.path = 'D:/chrome-win64/chrome.exe' # Ruta al ejecutable de Chrome
    Selenium::WebDriver::Chrome::Service.driver_path = 'C:/Users/jdonado/proyectos/helpdesk/bin/chromedriver.exe' # Ruta al Chromedriver si es necesario
  end
end

Gem versions:

capybara (3.40.0)
ruby 3.3.3p89
rails (7.0.7)

OS: Windows 11


Solution

  • I had to set config.assets.css_compressor = nil in the config/environment/test.rb file

    Aparentily, sassc-rails gem uses SassC::Rails::Compressor as a default compressor.