Class: CurrentBrowser

Inherits:
SimpleDelegator
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeCurrentBrowser

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

#browserObject

Returns the value of attribute browser.



4
5
6
# File 'lib/watir_setup/current_browser.rb', line 4

def browser
  @browser
end

#clientObject

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