taza 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION.yml +1 -1
  2. data/lib/taza/browser.rb +20 -3
  3. metadata +2 -2
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
+ patch: 3
2
3
  major: 0
3
- patch: 2
4
4
  minor: 8
data/lib/taza/browser.rb CHANGED
@@ -17,9 +17,10 @@ module Taza
17
17
  private
18
18
 
19
19
  def self.create_watir(params)
20
- require 'watir'
21
- Watir::Browser.default = params[:browser].to_s
22
- Watir::Browser.new
20
+ method = "watir_#{params[:browser]}"
21
+ raise BrowserUnsupportedError unless self.respond_to?(method)
22
+ watir = self.send(method).new
23
+ watir
23
24
  end
24
25
 
25
26
  def self.create_selenium(params)
@@ -27,7 +28,23 @@ module Taza
27
28
  Selenium::SeleniumDriver.new(params[:server_ip],params[:server_port],'*' + params[:browser].to_s,params[:timeout])
28
29
  end
29
30
 
31
+ def self.watir_firefox
32
+ require 'firewatir'
33
+ FireWatir::Firefox
34
+ end
35
+
36
+ def self.watir_safari
37
+ require 'safariwatir'
38
+ Watir::Safari
39
+ end
40
+
41
+ def self.watir_ie
42
+ require 'watir'
43
+ Watir::IE
44
+ end
30
45
  end
31
46
 
47
+ # We don't know how to create the browser you asked for
48
+ class BrowserUnsupportedError < StandardError; end
32
49
  end
33
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taza
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Anderson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-11 00:00:00 -08:00
12
+ date: 2009-01-26 00:00:00 -08:00
13
13
  default_executable: taza
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency