awetestlib 0.1.19-x86-mingw32 → 0.1.20-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
@@ -103,6 +103,17 @@ module Awetestlib
103
103
  fatal_to_log("Unable to navigate to '#{@myURL}': '#{$!}'")
104
104
  end
105
105
 
106
+ def go_to_wd_url(browser, url)
107
+ Watir::Browser.class_eval do
108
+ def goto(uri)
109
+ uri = "http://#{uri}" unless uri =~ URI.regexp
110
+ @driver.navigate.to uri
111
+ run_checkers
112
+ end
113
+ end
114
+ browser.goto(url)
115
+ end
116
+
106
117
  # Return a reference to a browser window. Used to attach a browser window to a variable
107
118
  # which can then be passed to methods that require a *browser* parameter.
108
119
  # @example
@@ -119,28 +130,46 @@ module Awetestlib
119
130
  def attach_browser(browser, how, what, desc = '')
120
131
  debug_to_log("Attaching browser window :#{how}=>'#{what}' #{desc}")
121
132
  uri_decoded_pattern = ::URI.encode(what.to_s.gsub('(?-mix:', '').gsub(')', ''))
122
- case @browserAbbrev
123
- when 'IE'
124
- tmpbrowser = Watir::IE.attach(how, what)
125
- browser.visible = true
126
- if tmpbrowser
127
- tmpbrowser.visible = true
128
- tmpbrowser.speed = :fast
129
- else
130
- raise "Browser window :#{how}=>'#{what}' has at least one doc not in completed ready state."
131
- end
132
- when 'FF'
133
- #TODO: This may be dependent on Firefox version if webdriver doesn't support 3.6.17 and below
134
- browser.driver.switch_to.window(browser.driver.window_handles[0])
135
- browser.window(how, /#{uri_decoded_pattern}/).use
136
- tmpbrowser = browser
137
- when 'S'
138
- Watir::Safari.attach(how, what)
139
- tmpbrowser = browser
140
- when 'C', 'GC'
141
- browser.window(how, /#{uri_decoded_pattern}/).use
142
- tmpbrowser = browser
133
+
134
+ if $watir_script
135
+ tmpbrowser = Watir::IE.attach(how, what)
136
+ browser.visible = true
137
+ if tmpbrowser
138
+ tmpbrowser.visible = true
139
+ tmpbrowser.speed = :fast
140
+ else
141
+ raise "Browser window :#{how}=>'#{what}' has at least one doc not in completed ready state."
142
+ end
143
+ else
144
+ browser.driver.switch_to.window(browser.driver.window_handles[0])
145
+ browser.window(how, /#{uri_decoded_pattern}/).use
146
+ tmpbrowser = browser
143
147
  end
148
+
149
+ # case @browserAbbrev
150
+ # when 'IE'
151
+ # tmpbrowser = Watir::IE.attach(how, what)
152
+ # browser.visible = true
153
+ # if tmpbrowser
154
+ # tmpbrowser.visible = true
155
+ # tmpbrowser.speed = :fast
156
+ # else
157
+ # raise "Browser window :#{how}=>'#{what}' has at least one doc not in completed ready state."
158
+ # end
159
+ # when 'FF'
160
+ # #TODO: This may be dependent on Firefox version if webdriver doesn't support 3.6.17 and below
161
+ # browser.driver.switch_to.window(browser.driver.window_handles[0])
162
+ # browser.window(how, /#{uri_decoded_pattern}/).use
163
+ # tmpbrowser = browser
164
+ # when 'S'
165
+ # Watir::Safari.attach(how, what)
166
+ # tmpbrowser = browser
167
+ # when 'C', 'GC'
168
+ # browser.window(how, /#{uri_decoded_pattern}/).use
169
+ # tmpbrowser = browser
170
+ # end
171
+
172
+
144
173
  debug_to_log("#{__method__}: tmpbrowser:#{tmpbrowser.inspect}")
145
174
  tmpbrowser
146
175
  end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Awetestlib
2
- VERSION = "0.1.19"
3
- VERSION_DATE = "2012-09-20"
2
+ VERSION = "0.1.20"
3
+ VERSION_DATE = "2012-10-02"
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awetestlib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 19
10
- version: 0.1.19
9
+ - 20
10
+ version: 0.1.20
11
11
  platform: x86-mingw32
12
12
  authors:
13
13
  - Anthony Woo
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-09-20 00:00:00 Z
19
+ date: 2012-10-02 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: watir-webdriver