Class: CurrentBrowser
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- CurrentBrowser
- Includes:
- Singleton
- Defined in:
- lib/watir_setup/current_browser.rb
Constant Summary collapse
- BROWSER_RES_X =
1280
1366- BROWSER_RES_Y =
924
768
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize ⇒ CurrentBrowser
constructor
A new instance of CurrentBrowser.
- #resize_browser(x = BROWSER_RES_X, y = BROWSER_RES_Y) ⇒ Object
- #start_browser(env) ⇒ Object
Constructor Details
#initialize ⇒ CurrentBrowser
Returns a new instance of CurrentBrowser.
9 10 11 |
# File 'lib/watir_setup/current_browser.rb', line 9 def initialize super(self.browser) end |
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
4 5 6 |
# File 'lib/watir_setup/current_browser.rb', line 4 def browser @browser end |
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/watir_setup/current_browser.rb', line 4 def client @client end |
Instance Method Details
#resize_browser(x = BROWSER_RES_X, y = BROWSER_RES_Y) ⇒ Object
18 19 20 |
# File 'lib/watir_setup/current_browser.rb', line 18 def resize_browser(x = BROWSER_RES_X, y = BROWSER_RES_Y) browser.window.resize_to(x, y) end |
#start_browser(env) ⇒ Object
13 14 15 16 |
# File 'lib/watir_setup/current_browser.rb', line 13 def start_browser(env) self.browser ||= browser_builder(env) resize_browser end |