Class: Webrat::Configuration
Overview
Instance Attribute Summary collapse
-
#application_address ⇒ Object
Which server the application is running on for selenium testing? Defaults to localhost.
-
#application_environment ⇒ Object
Which rails environment should the selenium tests be run in? Defaults to test.
-
#application_framework ⇒ Object
Which underlying app framework we’re testing with selenium.
-
#application_port ⇒ Object
Which port is the application running on for selenium testing? Defaults to 3001.
- #application_port_for_selenium ⇒ Object
-
#infinite_redirect_limit ⇒ Object
How many redirects to the same URL should be halted as an infinite redirect loop? Defaults to 10.
-
#mode ⇒ Object
Webrat’s mode, set automatically when requiring webrat/rails, webrat/merb, etc.
-
#open_error_files ⇒ Object
writeonly
Save and open pages with error status codes (500-599) in a browser? Defualts to true.
-
#saved_pages_dir ⇒ Object
Save and open page storage directory, defaults to “tmp” under current directory if exists, otherwise current directory.
-
#selenium_browser_key ⇒ Object
Set the key that Selenium uses to determine the browser running.
-
#selenium_browser_startup_timeout ⇒ Object
Set the timeout for waiting for the browser process to start.
-
#selenium_firefox_profile ⇒ Object
Set the firefox profile for selenium to use.
-
#selenium_server_address ⇒ Object
Which server Selenium server is running on.
-
#selenium_server_port ⇒ Object
Which server Selenium port is running on.
-
#selenium_verbose_output ⇒ Object
Print out the full HTML on wait failure Defaults to false.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
:nodoc:.
-
#open_error_files? ⇒ Boolean
:nodoc:.
Constructor Details
#initialize ⇒ Configuration
:nodoc:
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/webrat/core/configuration.rb', line 79 def initialize # :nodoc: self.open_error_files = true self.application_environment = :test self.application_port = 3001 self.application_address = 'localhost' self.application_framework = :rails self.selenium_server_port = 4444 self.infinite_redirect_limit = 10 self.selenium_browser_key = '*firefox' self.selenium_browser_startup_timeout = 5 self.selenium_verbose_output = false tmp_dir = Pathname.new(Dir.pwd).join("tmp") self.saved_pages_dir = tmp_dir.exist? ? tmp_dir : Dir.pwd end |
Instance Attribute Details
#application_address ⇒ Object
Which server the application is running on for selenium testing? Defaults to localhost
54 55 56 |
# File 'lib/webrat/core/configuration.rb', line 54 def application_address @application_address end |
#application_environment ⇒ Object
Which rails environment should the selenium tests be run in? Defaults to test.
34 35 36 |
# File 'lib/webrat/core/configuration.rb', line 34 def application_environment @application_environment end |
#application_framework ⇒ Object
Which underlying app framework we’re testing with selenium
51 52 53 |
# File 'lib/webrat/core/configuration.rb', line 51 def application_framework @application_framework end |
#application_port ⇒ Object
Which port is the application running on for selenium testing? Defaults to 3001.
39 40 41 |
# File 'lib/webrat/core/configuration.rb', line 39 def application_port @application_port end |
#application_port_for_selenium ⇒ Object
46 47 48 |
# File 'lib/webrat/core/configuration.rb', line 46 def application_port_for_selenium @application_port_for_selenium || self.application_port end |
#infinite_redirect_limit ⇒ Object
How many redirects to the same URL should be halted as an infinite redirect loop? Defaults to 10
73 74 75 |
# File 'lib/webrat/core/configuration.rb', line 73 def infinite_redirect_limit @infinite_redirect_limit end |
#mode ⇒ Object
Webrat’s mode, set automatically when requiring webrat/rails, webrat/merb, etc.
25 26 27 |
# File 'lib/webrat/core/configuration.rb', line 25 def mode @mode end |
#open_error_files=(value) ⇒ Object (writeonly)
Save and open pages with error status codes (500-599) in a browser? Defualts to true.
28 29 30 |
# File 'lib/webrat/core/configuration.rb', line 28 def open_error_files=(value) @open_error_files = value end |
#saved_pages_dir ⇒ Object
Save and open page storage directory, defaults to “tmp” under current directory if exists, otherwise current directory
31 32 33 |
# File 'lib/webrat/core/configuration.rb', line 31 def saved_pages_dir @saved_pages_dir end |
#selenium_browser_key ⇒ Object
Set the key that Selenium uses to determine the browser running. Default *firefox
63 64 65 |
# File 'lib/webrat/core/configuration.rb', line 63 def selenium_browser_key @selenium_browser_key end |
#selenium_browser_startup_timeout ⇒ Object
Set the timeout for waiting for the browser process to start
66 67 68 |
# File 'lib/webrat/core/configuration.rb', line 66 def selenium_browser_startup_timeout @selenium_browser_startup_timeout end |
#selenium_firefox_profile ⇒ Object
Set the firefox profile for selenium to use
69 70 71 |
# File 'lib/webrat/core/configuration.rb', line 69 def selenium_firefox_profile @selenium_firefox_profile end |
#selenium_server_address ⇒ Object
Which server Selenium server is running on. Defaults to nil(server starts in webrat process and runs locally)
57 58 59 |
# File 'lib/webrat/core/configuration.rb', line 57 def selenium_server_address @selenium_server_address end |
#selenium_server_port ⇒ Object
Which server Selenium port is running on. Defaults to 4444
60 61 62 |
# File 'lib/webrat/core/configuration.rb', line 60 def selenium_server_port @selenium_server_port end |
#selenium_verbose_output ⇒ Object
Print out the full HTML on wait failure Defaults to false
77 78 79 |
# File 'lib/webrat/core/configuration.rb', line 77 def selenium_verbose_output @selenium_verbose_output end |
Instance Method Details
#open_error_files? ⇒ Boolean
:nodoc:
95 96 97 |
# File 'lib/webrat/core/configuration.rb', line 95 def open_error_files? #:nodoc: @open_error_files ? true : false end |