rwebspec 4.3.1 → 4.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +5 -5
- data/lib/rwebspec-common/core.rb +3 -2
- data/lib/rwebspec-common/web_page.rb +2 -1
- data/lib/rwebspec-webdriver/web_browser.rb +6 -31
- data/lib/rwebspec.rb +2 -2
- metadata +10 -10
data/CHANGELOG
CHANGED
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.3.
|
81
|
+
s.version = "4.3.2"
|
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
|
|
@@ -97,10 +97,10 @@ spec = Gem::Specification.new do |s|
|
|
97
97
|
s.files = s.files + Dir.glob( "test/**/*" )
|
98
98
|
s.files = s.files + Dir.glob( "sample/**/*")
|
99
99
|
s.files = s.files + Dir.glob( "docs/**/*" )
|
100
|
-
s.add_dependency(%q<rspec>, ["
|
101
|
-
s.add_dependency(%q<rspec-core>, ["
|
102
|
-
s.add_dependency(%q<rspec-mocks>, ["
|
103
|
-
s.add_dependency(%q<rspec-expectations>, ["
|
100
|
+
s.add_dependency(%q<rspec>, [">= 2.13"])
|
101
|
+
s.add_dependency(%q<rspec-core>, [">= 2.13.0"])
|
102
|
+
s.add_dependency(%q<rspec-mocks>, [">= 2.13.0"])
|
103
|
+
s.add_dependency(%q<rspec-expectations>, [">= 2.13"])
|
104
104
|
s.add_dependency("commonwatir", ">= 4.0.0")
|
105
105
|
unless RUBY_PLATFORM =~ /mingw/
|
106
106
|
s.add_dependency("selenium-webdriver")
|
data/lib/rwebspec-common/core.rb
CHANGED
@@ -46,6 +46,7 @@ module RWebSpec
|
|
46
46
|
puts "[INFO] based on browser, set to Watir"
|
47
47
|
RWebSpec.framework = "Watir"
|
48
48
|
self.class.send(:include, RWebSpec::Driver)
|
49
|
+
# Reload abstract web page to load driver
|
49
50
|
load(File.dirname(__FILE__) + "/web_page.rb")
|
50
51
|
return open_browser_by_watir(opts)
|
51
52
|
end
|
@@ -87,7 +88,7 @@ module RWebSpec
|
|
87
88
|
use_current_watir_browser(how, what)
|
88
89
|
elsif RWebSpec.framework =~ /selenium/i
|
89
90
|
self.class.send(:include, RWebSpec::Driver)
|
90
|
-
use_current_selenium_browser(
|
91
|
+
use_current_selenium_browser(how, what)
|
91
92
|
else
|
92
93
|
# not specified, guess
|
93
94
|
if RUBY_PLATFORM =~ /mingw/i
|
@@ -99,7 +100,7 @@ module RWebSpec
|
|
99
100
|
RWebSpec.framework = "Selenium"
|
100
101
|
self.class.send(:include, RWebSpec::Driver)
|
101
102
|
load(File.dirname(__FILE__) + "/web_page.rb")
|
102
|
-
use_current_selenium_browser(
|
103
|
+
use_current_selenium_browser(how, what)
|
103
104
|
end
|
104
105
|
|
105
106
|
end
|
@@ -25,7 +25,8 @@ module RWebSpec
|
|
25
25
|
begin
|
26
26
|
include RWebSpec::Driver
|
27
27
|
rescue => e
|
28
|
-
|
28
|
+
# Ignorable error, driver not set, but will get loaded after calling open_browser or use_current_browser
|
29
|
+
# puts "[WARN] Failed to load Driver, it will be reloaded. #{e.backtrace}"
|
29
30
|
end
|
30
31
|
include RWebSpec::Core
|
31
32
|
|
@@ -113,11 +113,7 @@ module RWebSpec
|
|
113
113
|
|
114
114
|
# TODO resuse not working yet
|
115
115
|
def self.reuse(base_url, options)
|
116
|
-
if self.is_windows?
|
117
|
-
Watir::IE.each do |browser_window|
|
118
|
-
return WebBrowser.new(base_url, browser_window, options)
|
119
|
-
end
|
120
|
-
#puts "no browser instance found"
|
116
|
+
if self.is_windows?
|
121
117
|
WebBrowser.new(base_url, nil, options)
|
122
118
|
else
|
123
119
|
WebBrowser.new(base_url, nil, options)
|
@@ -152,13 +148,9 @@ module RWebSpec
|
|
152
148
|
alias check_box checkbox # seems watir doc is wrong, checkbox not check_box
|
153
149
|
alias tr row
|
154
150
|
|
155
|
-
# Wrapp of
|
151
|
+
# Wrapp of area to support Firefox and Watir
|
156
152
|
def area(* args)
|
157
|
-
|
158
|
-
text_field(* args)
|
159
|
-
else
|
160
|
-
@browser.send("area", * args)
|
161
|
-
end
|
153
|
+
raise "not implemented for Selenium"
|
162
154
|
end
|
163
155
|
|
164
156
|
def modal_dialog(how=nil, what=nil)
|
@@ -684,32 +676,15 @@ module RWebSpec
|
|
684
676
|
# WebBrowser.attach_browser(:url, "http://www.itest2.com", {:browser => "Firefox", :base_url => "http://www.itest2.com"})
|
685
677
|
# WebBrowser.attach_browser(:title, /agileway\.com\.au\/attachment/) # regular expression
|
686
678
|
def self.attach_browser(how, what, options={})
|
687
|
-
|
688
|
-
options = default_options.merge(options)
|
689
|
-
site_context = Context.new(options[:base_url]) if options[:base_url]
|
690
|
-
if (options[:browser].to_s == "firefox")
|
691
|
-
return WebBrowser.new_from_existing(ff, site_context)
|
692
|
-
else
|
693
|
-
return WebBrowser.new_from_existing(Watir::IE.attach(how, what), site_context)
|
694
|
-
end
|
679
|
+
raise "Attach browser not implemented for Selenium, If you debug in TestWise, make sure running a test first to start browser, then you can attach."
|
695
680
|
end
|
696
681
|
|
697
|
-
# Attach a
|
682
|
+
# Attach to a popup window, to be removed
|
698
683
|
#
|
699
684
|
# Typical usage
|
700
685
|
# new_popup_window(:url => "http://www.google.com/a.pdf")
|
701
686
|
def new_popup_window(options, browser = "ie")
|
702
|
-
|
703
|
-
raise "not implemented"
|
704
|
-
else
|
705
|
-
if options[:url]
|
706
|
-
Watir::IE.attach(:url, options[:url])
|
707
|
-
elsif options[:title]
|
708
|
-
Watir::IE.attach(:title, options[:title])
|
709
|
-
else
|
710
|
-
raise 'Please specify title or url of new pop up window'
|
711
|
-
end
|
712
|
-
end
|
687
|
+
raise "not implemented"
|
713
688
|
end
|
714
689
|
|
715
690
|
# ---
|
data/lib/rwebspec.rb
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
require 'rspec'
|
17
17
|
|
18
18
|
unless defined? RWEBSPEC_VERSION
|
19
|
-
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "4.3.
|
19
|
+
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "4.3.2"
|
20
20
|
end
|
21
21
|
|
22
22
|
$testwise_polling_interval = 1 # seconds
|
@@ -102,9 +102,9 @@ module RWebSpec
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
-
# Watir 3 API Changes, no Watir/Container
|
106
105
|
require File.dirname(__FILE__) + "/plugins/testwise_plugin.rb"
|
107
106
|
|
107
|
+
# Changed in v4.3, the framework is loaded when initliating or reuse browser
|
108
108
|
#RWebSpec.load_framework
|
109
109
|
|
110
110
|
# Extra full path to load libraries
|
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.3.
|
4
|
+
version: 4.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,14 +9,14 @@ authors:
|
|
9
9
|
autorequire: rwebspec
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '2.13'
|
22
22
|
type: :runtime
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '2.13'
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: 2.13.0
|
38
38
|
type: :runtime
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 2.13.0
|
46
46
|
- !ruby/object:Gem::Dependency
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
49
49
|
none: false
|
50
50
|
requirements:
|
51
|
-
- -
|
51
|
+
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 2.13.0
|
54
54
|
type: :runtime
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
none: false
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 2.13.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
@@ -64,7 +64,7 @@ dependencies:
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ! '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '2.13'
|
70
70
|
type: :runtime
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ! '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '2.13'
|
78
78
|
- !ruby/object:Gem::Dependency
|