Class: Goggles::Iteration

Inherits:
Object
  • Object
show all
Defined in:
lib/goggles/iteration.rb

Overview

Executes the block passed to ‘Goggles.each` with every configured combination of browser

and browser size.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, width, config) {|Watir::Browser| ... } ⇒ Iteration

Creates a script iteration instance, building yielded browser object from the

given arguments. Closes the browser instance after yielding to the block.

Parameters:

  • driver (String, Symbol)

    browser name

  • width (Fixnum)

    browser width

  • config (Goggles::Configuration)

    global configuration

Yields:



42
43
44
45
46
47
48
49
# File 'lib/goggles/iteration.rb', line 42

def initialize driver, width, config, &block
  @browser_name = driver
  @config       = config
  @size         = width
  build_browser
  yield browser
  browser.close
end

Instance Attribute Details

#browserObject (readonly)

Returns the value of attribute browser.



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

def browser
  @browser
end

#browser_nameObject (readonly)

Returns the value of attribute browser_name.



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

def browser_name
  @browser_name
end

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

#sizeObject (readonly)

Returns the value of attribute size.



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

def size
  @size
end