Module: SauceLabs

Defined in:
lib/saucelabs.rb,
lib/saucelabs/sauce_api.rb,
lib/saucelabs/parsed_values.rb,
lib/saucelabs/sauce_browser_factory.rb

Defined Under Namespace

Modules: ParsedValues, RestApiBuilder Classes: SauceBrowserFactory

Class Method Summary collapse

Class Method Details

.conf {|factory| ... } ⇒ Object

Yields to Factory object if parameters are set using conf

Yields:

  • (factory)

Returns:

  • (Object)

    browser session


41
42
43
# File 'lib/saucelabs.rb', line 41

def self.conf
  yield factory
end

.selenium_driver(browser = :firefox, browser_options = {}) ⇒ Object

Creates a Selenium driver session and returns the driver object

SauceLabs.selenium_driver(browser = :chrome, browser_options = {})

Parameters:

  • the (String)

    browser string passed into the method

  • the (Hash)

    optional hash to specify browser options

Returns:

  • (Object)

    browser session


31
32
33
# File 'lib/saucelabs.rb', line 31

def self.selenium_driver(browser = :firefox, browser_options={})
  factory.selenium_driver(browser,browser_options)
end

.watir_browser(browser = :firefox, browser_options = {}) ⇒ Object

Creates a watir browser session and returns the browser object

SauceLabs.watir_browser(browser = :chrome, browser_options = {})

Parameters:

  • the (String)

    browser string passed into the method

  • the (Hash)

    optional hash to specify browser options

Returns:

  • (Object)

    browser session


17
18
19
# File 'lib/saucelabs.rb', line 17

def self.watir_browser(browser = :firefox, browser_options={})
  factory.watir_browser(browser,browser_options)
end