diff --git a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb index f1864b587dfa3..aafa63bcd17bb 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb @@ -250,6 +250,7 @@ def safari_preview_driver(**opts) def chrome_options(args: [], **opts) opts[:binary] ||= ENV['CHROME_BINARY'] if ENV.key?('CHROME_BINARY') args << '--headless=chrome' if ENV['HEADLESS'] + args << '--no-sandbox' if ENV['NO_SANDBOX'] args << '--disable-gpu' WebDriver::Options.chrome(browser_version: 'stable', args: args, **opts) end @@ -257,6 +258,7 @@ def chrome_options(args: [], **opts) def edge_options(args: [], **opts) opts[:binary] ||= ENV['EDGE_BINARY'] if ENV.key?('EDGE_BINARY') args << '--headless=chrome' if ENV['HEADLESS'] + args << '--no-sandbox' if ENV['NO_SANDBOX'] args << '--disable-gpu' WebDriver::Options.edge(browser_version: 'stable', args: args, **opts) end diff --git a/rb/spec/tests.bzl b/rb/spec/tests.bzl index da6f5f2460e82..9c0f1596de6e9 100644 --- a/rb/spec/tests.bzl +++ b/rb/spec/tests.bzl @@ -30,6 +30,9 @@ BROWSERS = { }) | select({ "@selenium//common:use_headless_browser": {"HEADLESS": "true"}, "//conditions:default": {}, + }) | select({ + "@platforms//os:windows": {}, + "//conditions:default": {"NO_SANDBOX": "true"}, }), }, "edge": { @@ -53,6 +56,9 @@ BROWSERS = { }) | select({ "@selenium//common:use_headless_browser": {"HEADLESS": "true"}, "//conditions:default": {}, + }) | select({ + "@platforms//os:windows": {}, + "//conditions:default": {"NO_SANDBOX": "true"}, }), }, "firefox": {