Class: Hollandaise::Browsers
- Inherits:
-
Object
- Object
- Hollandaise::Browsers
- Defined in:
- lib/hollandaise/browsers.rb
Class Method Summary collapse
- .chrome ⇒ Object
- .chromewin ⇒ Object
- .ffwin10 ⇒ Object
- .firefox ⇒ Object
- .for(browsers, options = {}) ⇒ Object
- .ie7 ⇒ Object
- .ie8 ⇒ Object
- .ie9 ⇒ Object
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(browsers) ⇒ Browsers
constructor
A new instance of Browsers.
- #run ⇒ Object
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
.chrome ⇒ Object
31 32 33 |
# File 'lib/hollandaise/browsers.rb', line 31 def self.chrome [ :selenium, :chrome ] end |
.chromewin ⇒ Object
23 24 25 |
# File 'lib/hollandaise/browsers.rb', line 23 def self.chromewin [ :sauce, 'chrome', '', 'Windows 2008' ] end |
.ffwin10 ⇒ Object
19 20 21 |
# File 'lib/hollandaise/browsers.rb', line 19 def self.ffwin10 [ :sauce, 'firefox', '10', 'Windows 2008' ] end |
.firefox ⇒ Object
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, = {}) new(browsers.flatten.collect { |browser| Hollandaise::Browser.for(self.send(browser), ) }) end |
.ie7 ⇒ Object
7 8 9 |
# File 'lib/hollandaise/browsers.rb', line 7 def self.ie7 [ :sauce, 'iexplore', '7', 'Windows 2003' ] end |
.ie8 ⇒ Object
11 12 13 |
# File 'lib/hollandaise/browsers.rb', line 11 def self.ie8 [ :sauce, 'iexplore', '8', 'Windows 2003' ] end |
.ie9 ⇒ Object
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 |
#run ⇒ Object
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 |