rwebspec 4.1.0 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +5 -0
- data/Rakefile +3 -1
- data/lib/rwebspec-watir/driver.rb +8 -9
- data/lib/rwebspec-watir/web_browser.rb +11 -14
- data/lib/rwebspec-webdriver/driver.rb +11 -6
- data/lib/rwebspec-webdriver/web_browser.rb +1 -2
- data/lib/rwebspec.rb +1 -1
- metadata +34 -2
data/CHANGELOG
CHANGED
@@ -6,6 +6,11 @@ CHANGELOG
|
|
6
6
|
[Refactored] - unit tests
|
7
7
|
[Feature] - Save screenshot for Selenium
|
8
8
|
[CHANGE] - open_browser(base_url, options) => open_browser(:base_url => "http://")
|
9
|
+
|
10
|
+
upgrade to watir-classic 3.4
|
11
|
+
close_others
|
12
|
+
close_all_browsers to instance methods
|
13
|
+
no set highlight color
|
9
14
|
|
10
15
|
4.0
|
11
16
|
- Merge rwebspec-webdriver with rwebspec!
|
data/Rakefile
CHANGED
@@ -78,7 +78,7 @@ end
|
|
78
78
|
spec = Gem::Specification.new do |s|
|
79
79
|
s.platform= Gem::Platform::RUBY
|
80
80
|
s.name = "rwebspec"
|
81
|
-
s.version = "4.1.
|
81
|
+
s.version = "4.1.3"
|
82
82
|
s.summary = "Web application functional specification in Ruby"
|
83
83
|
s.description = "Executable functional specification for web applications in RSpec syntax with Watir or Selenium"
|
84
84
|
|
@@ -99,6 +99,8 @@ spec = Gem::Specification.new do |s|
|
|
99
99
|
s.files = s.files + Dir.glob( "docs/**/*" )
|
100
100
|
s.add_dependency(%q<rspec>, [">= 2.10"])
|
101
101
|
s.add_dependency(%q<rspec-core>, ["= 2.10.1"])
|
102
|
+
s.add_dependency(%q<rspec-mocks>, ["= 2.10.1"])
|
103
|
+
s.add_dependency(%q<rspec-expectations>, ["= 2.10.0"])
|
102
104
|
s.add_dependency("commonwatir", ">= 3.0")
|
103
105
|
unless RUBY_PLATFORM =~ /mingw/
|
104
106
|
s.add_dependency("selenium-webdriver")
|
@@ -37,14 +37,18 @@ module RWebSpec
|
|
37
37
|
puts "Unicode may not work in IE, #{e}"
|
38
38
|
end
|
39
39
|
|
40
|
-
base_url ||= $TESTWISE_PROJECT_BASE_URL
|
41
40
|
if options && options.class == String
|
42
|
-
|
43
|
-
|
41
|
+
options = {:base_url => options.to_s }
|
42
|
+
end
|
43
|
+
|
44
|
+
if options && options.class == Hash && options[:base_url]
|
44
45
|
base_url ||= options[:base_url]
|
45
46
|
end
|
46
47
|
|
48
|
+
base_url = options[:base_url] rescue nil
|
49
|
+
base_url ||= $TESTWISE_PROJECT_BASE_URL
|
47
50
|
base_url ||= $BASE_URL
|
51
|
+
|
48
52
|
raise "base_url must be set" if base_url.nil?
|
49
53
|
|
50
54
|
default_options = {:speed => "fast",
|
@@ -105,12 +109,7 @@ module RWebSpec
|
|
105
109
|
# Close all opening browser windows
|
106
110
|
#
|
107
111
|
def close_all_browsers
|
108
|
-
|
109
|
-
Watir::IE.close_all
|
110
|
-
else
|
111
|
-
browser_type = $TESTWISE_BROWSER ? $TESTWISE_BROWSER.downcase.to_sym : :ie
|
112
|
-
WebBrowser.close_all_browsers(browser_type)
|
113
|
-
end
|
112
|
+
@web_browser.close_all_browsers
|
114
113
|
end
|
115
114
|
|
116
115
|
# Verify the next page following an operation.
|
@@ -53,18 +53,17 @@ module RWebSpec
|
|
53
53
|
|
54
54
|
return if existing_browser
|
55
55
|
|
56
|
-
|
56
|
+
# Watir-classic 3.4 drop the support
|
57
|
+
# @browser.activeObjectHighLightColor = options[:highlight_colour]
|
57
58
|
@browser.visible = options[:visible] unless $HIDE_IE
|
58
59
|
#NOTE: close_others fails
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
puts "close other browser instances not working yet in Ruby 1.9.1 version of Watir"
|
67
|
-
end
|
60
|
+
begin
|
61
|
+
if options[:close_others] then
|
62
|
+
@browser.windows.reject(&:current?).each(&:close)
|
63
|
+
end
|
64
|
+
rescue => e1
|
65
|
+
puts "Failed to close others"
|
66
|
+
end
|
68
67
|
end
|
69
68
|
|
70
69
|
def self.reuse(base_url, options)
|
@@ -240,10 +239,8 @@ module RWebSpec
|
|
240
239
|
end
|
241
240
|
alias close close_browser
|
242
241
|
|
243
|
-
def
|
244
|
-
|
245
|
-
Watir::IE.close_all
|
246
|
-
end
|
242
|
+
def close_all_browsers(browser_type = :ie)
|
243
|
+
@browser.windows.each(&:close)
|
247
244
|
end
|
248
245
|
|
249
246
|
def full_url(relative_url)
|
@@ -38,13 +38,18 @@ module RWebSpec
|
|
38
38
|
puts "Unicode may not work in IE, #{e}"
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
if options && options.class == String
|
42
|
+
options = {:base_url => options.to_s }
|
43
|
+
end
|
44
|
+
|
45
|
+
if options && options.class == Hash && options[:base_url]
|
46
|
+
base_url ||= options[:base_url]
|
47
|
+
end
|
48
|
+
|
49
|
+
base_url = options[:base_url] rescue nil
|
50
|
+
base_url ||= $TESTWISE_PROJECT_BASE_URL
|
47
51
|
base_url ||= $BASE_URL
|
52
|
+
|
48
53
|
raise "base_url must be set" if base_url.nil?
|
49
54
|
|
50
55
|
default_options = {:speed => "fast",
|
@@ -101,7 +101,6 @@ module RWebSpec
|
|
101
101
|
# else
|
102
102
|
# @browser.speed = :zippy
|
103
103
|
# end
|
104
|
-
# @browser.activeObjectHighLightColor = options[:highlight_colour]
|
105
104
|
# @browser.visible = options[:visible] unless $HIDE_IE
|
106
105
|
# #NOTE: close_others fails
|
107
106
|
# if RUBY_VERSION =~ /^1\.8/ && options[:close_others] then
|
@@ -343,7 +342,7 @@ module RWebSpec
|
|
343
342
|
alias close close_browser
|
344
343
|
|
345
344
|
#TODO determine browser type, check FireWatir support or not
|
346
|
-
def
|
345
|
+
def close_all_browsers
|
347
346
|
raise "not implemented"
|
348
347
|
end
|
349
348
|
|
data/lib/rwebspec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rwebspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire: rwebspec
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -43,6 +43,38 @@ dependencies:
|
|
43
43
|
- - '='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 2.10.1
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec-mocks
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - '='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.10.1
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.10.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec-expectations
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.10.0
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.10.0
|
46
78
|
- !ruby/object:Gem::Dependency
|
47
79
|
name: commonwatir
|
48
80
|
requirement: !ruby/object:Gem::Requirement
|