rwebspec 1.6.5 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -5
- data/Rakefile +2 -2
- data/lib/rwebspec/driver.rb +22 -0
- data/lib/rwebspec/web_browser.rb +5 -1
- metadata +9 -9
data/CHANGELOG
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
|
+
|
4
|
+
1.7.1
|
5
|
+
[New] New version scheme, matching Watir versioning, appending minor number
|
6
|
+
[New] background_visit method, visit url in background, useful for function such as reset database
|
7
|
+
|
3
8
|
1.6.5
|
4
9
|
[Fixes] load Firewatir first, in case new version of ActiveSupport is loaded first
|
5
10
|
|
@@ -9,14 +14,14 @@ CHANGELOG
|
|
9
14
|
|
10
15
|
1.6.3
|
11
16
|
Add base_authentication for Celerity
|
12
|
-
should contains only return
|
17
|
+
should contains only return maximum 256 characters in error stack trace, for full using should include
|
13
18
|
|
14
19
|
1.6.2
|
15
20
|
add helper method: basic_authentication for IE and Firefox
|
16
21
|
|
17
22
|
1.6.1 (2010-07-08)
|
18
23
|
Update load test installer
|
19
|
-
Extend Watir to
|
24
|
+
Extend Watir to support calling JScript/VBscript in IE
|
20
25
|
|
21
26
|
1.6 (2010-04)
|
22
27
|
Include ScreenCapture
|
@@ -36,7 +41,7 @@ CHANGELOG
|
|
36
41
|
1.5.1
|
37
42
|
[Load Test helper
|
38
43
|
assert_text_present changed to check text view of web pages
|
39
|
-
detect ILOAD2 environment to
|
44
|
+
detect ILOAD2 environment to determine to preview load test or not
|
40
45
|
|
41
46
|
1.5
|
42
47
|
[New] Supports Watir 1.6.5
|
@@ -130,7 +135,7 @@ CHANGELOG
|
|
130
135
|
1.0.4
|
131
136
|
Added: WebBrowser.html WebBrowser.text
|
132
137
|
Added: random method in test_utils
|
133
|
-
|
138
|
+
Enhancement: close_browser works even no browser started in the test
|
134
139
|
move open_browser to driver.rb
|
135
140
|
fixed include rwebspec causing stack too deep error
|
136
141
|
|
@@ -287,7 +292,7 @@ TODO:
|
|
287
292
|
== 0.5.1 (2007-09-21)
|
288
293
|
- add wrap of Watir methods, such as buttons, button(...)
|
289
294
|
- expose Watir low level methods to test/spec through Driver.rb
|
290
|
-
- removed old way using array and
|
295
|
+
- removed old way using array and comparison to access individual control
|
291
296
|
- renamed html_title to page_title
|
292
297
|
- add method contains_text
|
293
298
|
- make faster checkbox operations
|
data/Rakefile
CHANGED
@@ -70,7 +70,7 @@ end
|
|
70
70
|
spec = Gem::Specification.new do |s|
|
71
71
|
s.platform= Gem::Platform::RUBY
|
72
72
|
s.name = "rwebspec"
|
73
|
-
s.version = "1.
|
73
|
+
s.version = "1.7.0"
|
74
74
|
s.summary = "Executable functional specification for web applications in RSpec syntax and Watir"
|
75
75
|
# s.description = ""
|
76
76
|
|
@@ -91,7 +91,7 @@ spec = Gem::Specification.new do |s|
|
|
91
91
|
s.files = s.files + Dir.glob( "docs/**/*" )
|
92
92
|
s.add_dependency(%q<rspec>, ["= 1.1.12"])
|
93
93
|
|
94
|
-
s.add_dependency("commonwatir", ">= 1.
|
94
|
+
s.add_dependency("commonwatir", ">= 1.8.0")
|
95
95
|
end
|
96
96
|
|
97
97
|
Rake::GemPackageTask.new(spec) do |pkg|
|
data/lib/rwebspec/driver.rb
CHANGED
@@ -171,6 +171,7 @@ module RWebSpec
|
|
171
171
|
|
172
172
|
alias visit goto_page
|
173
173
|
|
174
|
+
|
174
175
|
# Go to another web site, normally different site being tested on
|
175
176
|
#
|
176
177
|
# open_browser("http://www.itest2.com")
|
@@ -179,6 +180,27 @@ module RWebSpec
|
|
179
180
|
@web_browser.goto_url url
|
180
181
|
end
|
181
182
|
|
183
|
+
# Go to specific url in background (i.e not via browwser, different from goto_url)
|
184
|
+
# This won't share the session with what's currenlty in browser
|
185
|
+
#
|
186
|
+
# One use example: resetting database
|
187
|
+
# background_visit("/reset")
|
188
|
+
#
|
189
|
+
def background_visit(url)
|
190
|
+
require 'httpclient'
|
191
|
+
begin
|
192
|
+
client = HTTPClient.new
|
193
|
+
if url && url =~ /^http/
|
194
|
+
http_response = client.get(url).body.content
|
195
|
+
else
|
196
|
+
base_url = $ITEST2_PROJECT_BASE_URL || $BASE_URL
|
197
|
+
http_response = client.get("#{base_url}#{url}").body.content
|
198
|
+
end
|
199
|
+
rescue => e
|
200
|
+
raise e
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
182
204
|
# Attach to existinb browser window
|
183
205
|
#
|
184
206
|
# attach_browser(:title, )
|
data/lib/rwebspec/web_browser.rb
CHANGED
@@ -133,7 +133,11 @@ module RWebSpec
|
|
133
133
|
@browser.visible = options[:visible] unless $HIDE_IE
|
134
134
|
#NOTE: close_others fails
|
135
135
|
if RUBY_VERSION =~ /^1\.8/ && options[:close_others] then
|
136
|
-
|
136
|
+
begin
|
137
|
+
@browser.close_others
|
138
|
+
rescue => e1
|
139
|
+
puts "Failed to close others"
|
140
|
+
end
|
137
141
|
else
|
138
142
|
puts "close other browser instances not working yet in Ruby 1.9.1 version of Watir"
|
139
143
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rwebspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 1.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Zhimin Zhan
|
@@ -15,7 +15,7 @@ autorequire: rwebspec
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-04-08 00:00:00 +10:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +42,12 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 55
|
46
46
|
segments:
|
47
47
|
- 1
|
48
|
-
-
|
49
|
-
-
|
50
|
-
version: 1.
|
48
|
+
- 8
|
49
|
+
- 0
|
50
|
+
version: 1.8.0
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
53
|
description:
|