rwebspec 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/Rakefile +1 -1
- data/lib/rwebspec-common/core.rb +1 -1
- data/lib/rwebspec-watir/driver.rb +5 -0
- data/lib/rwebspec-webdriver/driver.rb +13 -3
- data/lib/rwebspec-webdriver/web_browser.rb +12 -1
- data/lib/rwebspec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2041946ebad32da51c5a1d38287e5d7d163f42cf
|
4
|
+
data.tar.gz: d990a25e840ff641f77468ca5190add30f289486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b46b84544367e452b5c6f62c1fb51370e9def09f17612734ed3dee7514dd9e541d3a58e79ff12c6cbcd842afcf48a104e4d66e29d53912693f5586347e27592c
|
7
|
+
data.tar.gz: 75ba170f172248dfd53ef5424b457e3c5b30dcfc9b855df68f4ffb82a7ce7b98702a3c2d29e88273d88a79a738dd66cd0c1e1686d71a5b923695e1a8e82f1948
|
data/CHANGELOG
CHANGED
data/Rakefile
CHANGED
@@ -77,7 +77,7 @@ end
|
|
77
77
|
spec = Gem::Specification.new do |s|
|
78
78
|
s.platform= Gem::Platform::RUBY
|
79
79
|
s.name = "rwebspec"
|
80
|
-
s.version = "5.0.
|
80
|
+
s.version = "5.0.2"
|
81
81
|
s.summary = "Web application functional specification in Ruby"
|
82
82
|
s.description = "Executable functional specification for web applications in RSpec syntax with Watir or Selenium"
|
83
83
|
|
data/lib/rwebspec-common/core.rb
CHANGED
@@ -320,6 +320,11 @@ module RWebSpec
|
|
320
320
|
# For IE10, it seems unable to identify HTML5 elements
|
321
321
|
#
|
322
322
|
# However for IE10, the '.' is omitted.
|
323
|
+
if opts.nil? || opts.empty?
|
324
|
+
# for Watir, default is clear
|
325
|
+
opts[:appending] = false
|
326
|
+
end
|
327
|
+
|
323
328
|
perform_operation {
|
324
329
|
|
325
330
|
begin
|
@@ -321,14 +321,24 @@ module RWebSpec
|
|
321
321
|
alias clear_radio_button clear_radio_option
|
322
322
|
|
323
323
|
# for text field can be easier to be identified by attribute "id" instead of "name", not recommended though
|
324
|
-
|
324
|
+
# params opts takes :appending => true or false, if true, won't clear the text field.
|
325
|
+
def enter_text_with_id(textfield_id, value, opts = {})
|
326
|
+
|
327
|
+
if opts.nil? || opts.empty?
|
328
|
+
opts[:appending] = true
|
329
|
+
end
|
330
|
+
|
325
331
|
perform_operation {
|
326
332
|
elements = find_elements(:id, textfield_id)
|
327
333
|
if elements.size == 1 then
|
328
|
-
elements[0]
|
334
|
+
the_element = elements[0]
|
335
|
+
the_element.clear unless opts[:appending]
|
336
|
+
the_element.send_keys(value)
|
329
337
|
else
|
330
338
|
smaller_set = elements.select {|x| x.tag_name == "textarea" || (x.tag_name == "input" && x.attribute("text")) }
|
331
|
-
smaller_set[0]
|
339
|
+
the_element = smaller_set[0]
|
340
|
+
the_element.clear unless opts[:appending]
|
341
|
+
the_element.send_keys(value)
|
332
342
|
end
|
333
343
|
}
|
334
344
|
end
|
@@ -34,6 +34,8 @@ module RWebSpec
|
|
34
34
|
initialize_firefox_browser(existing_browser, base_url, options)
|
35
35
|
when "chrome"
|
36
36
|
initialize_chrome_browser(existing_browser, base_url, options)
|
37
|
+
when "safari"
|
38
|
+
initialize_safari_browser(existing_browser, base_url, options)
|
37
39
|
when "ie"
|
38
40
|
initialize_ie_browser(existing_browser, options)
|
39
41
|
when "htmlunit"
|
@@ -68,9 +70,18 @@ module RWebSpec
|
|
68
70
|
@browser = Selenium::WebDriver.for :chrome
|
69
71
|
@browser.navigate.to base_url
|
70
72
|
end
|
73
|
+
|
74
|
+
def initialize_safari_browser(existing_browser, base_url, options)
|
75
|
+
if existing_browser then
|
76
|
+
@browser = existing_browser
|
77
|
+
return
|
78
|
+
end
|
79
|
+
|
80
|
+
@browser = Selenium::WebDriver.for :safari
|
81
|
+
@browser.navigate.to base_url
|
82
|
+
end
|
71
83
|
|
72
84
|
def initialize_htmlunit_browser(base_url, options)
|
73
|
-
puts "XXXXX start HtmlUnit..."
|
74
85
|
require 'json'
|
75
86
|
caps = Selenium::WebDriver::Remote::Capabilities.htmlunit(:javascript_enabled => false)
|
76
87
|
client = Selenium::WebDriver::Remote::Http::Default.new
|
data/lib/rwebspec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rwebspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zhimin Zhan
|
8
8
|
autorequire: rwebspec
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
requirements:
|
151
151
|
- none
|
152
152
|
rubyforge_project: rwebspec
|
153
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.1.11
|
154
154
|
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: Web application functional specification in Ruby
|