]> git.openstreetmap.org Git - rails.git/blobdiff - test/application_system_test_case.rb
Add option to use headless Firefox in system tests
[rails.git] / test / application_system_test_case.rb
index 496f37c16be4be820d16dfb753ab1bed77c8cd2a..f2fcadfd7c582efedfdcd60df7ee0947b896db4b 100644 (file)
@@ -7,7 +7,7 @@ ActiveSupport.on_load(:action_dispatch_system_test_case) do
 end
 
 class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
-  driven_by :selenium, :using => :headless_firefox do |options|
+  driven_by :selenium, :using => Settings.system_test_headless ? :headless_firefox : :firefox do |options|
     options.add_preference("intl.accept_languages", "en")
     options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary
   end
@@ -46,4 +46,8 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
   def within_content_body(&)
     within("#content > .content-body", &)
   end
+
+  def within_content_heading(&)
+    within("#content > .content-heading", &)
+  end
 end