Class: Hollandaise::Browsers

Inherits:
Object
  • Object
show all
Defined in:
lib/hollandaise/browsers.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browsers) ⇒ Browsers

Returns a new instance of Browsers.



35
36
37
# File 'lib/hollandaise/browsers.rb', line 35

def initialize(browsers)
  @browsers = browsers
end

Class Method Details

.chromeObject



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

def self.chrome
  [ :selenium, :chrome ]
end

.chromewinObject



23
24
25
# File 'lib/hollandaise/browsers.rb', line 23

def self.chromewin
  [ :sauce, 'chrome', '', 'Windows 2008' ]
end

.ffwin10Object



19
20
21
# File 'lib/hollandaise/browsers.rb', line 19

def self.ffwin10
  [ :sauce, 'firefox', '10', 'Windows 2008' ]
end

.firefoxObject



27
28
29
# File 'lib/hollandaise/browsers.rb', line 27

def self.firefox
  [ :selenium, :firefox ]
end

.for(browsers, options = {}) ⇒ Object



3
4
5
# File 'lib/hollandaise/browsers.rb', line 3

def self.for(browsers, options = {})
  new(browsers.flatten.collect { |browser| Hollandaise::Browser.for(self.send(browser), options) })
end

.ie7Object



7
8
9
# File 'lib/hollandaise/browsers.rb', line 7

def self.ie7
  [ :sauce, 'iexplore', '7', 'Windows 2003' ]
end

.ie8Object



11
12
13
# File 'lib/hollandaise/browsers.rb', line 11

def self.ie8
  [ :sauce, 'iexplore', '8', 'Windows 2003' ]
end

.ie9Object



15
16
17
# File 'lib/hollandaise/browsers.rb', line 15

def self.ie9
  [ :sauce, 'iexplore', '9', 'Windows 2008' ]
end

Instance Method Details

#each(&block) ⇒ Object



39
40
41
# File 'lib/hollandaise/browsers.rb', line 39

def each(&block)
  @browsers.each(&block)
end

#runObject



43
44
45
46
47
48
49
50
51
# File 'lib/hollandaise/browsers.rb', line 43

def run
  @browsers.each do |browser|
    begin
      yield browser
    ensure
      browser.close
    end
  end
end