Skip to content

A platform for community discussion. Free, open, simple.

DEV: Support `--headful` to run system test in headful mode in bin/rspec (#31815)

Alan Guo Xiang Tanca835a895268
diff --git a/bin/rspec b/bin/rspec
index 55b87de6fe6..2b1fbe2053b 100755
--- a/bin/rspec
+++ b/bin/rspec
@@ -8,16 +8,17 @@
# this file is here to facilitate running it.
#
-require 'pathname'
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
- Pathname.new(__FILE__).realpath)
+require "pathname"
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", Pathname.new(__FILE__).realpath)
-require 'rubygems'
-require 'bundler/setup'
+require "rubygems"
+require "bundler/setup"
if ENV["LOAD_PLUGINS"].nil? && ARGV.any? { |pattern| pattern.include?("plugins/") }
STDERR.puts "Detected plugin spec path, setting LOAD_PLUGINS to 1"
ENV["LOAD_PLUGINS"] = "1"
end
-load Gem.bin_path('rspec-core', 'rspec')
+ENV["SELENIUM_HEADLESS"] = "0" if ARGV.delete("--headful")
+
+load Gem.bin_path("rspec-core", "rspec")