selenium_fury 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/lib/selenium_fury/selenium_web_driver/page_validator.rb +14 -4
- data/lib/selenium_fury/version.rb +1 -1
- data/spec/selenium_fury/selenium_web_driver/generic_elements/generic_elements_spec.rb +3 -3
- data/spec/selenium_fury/selenium_web_driver/page_validator_spec.rb +7 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
ODE2ZjBkZTkzNTZiNDU1ZTk2ZmVmN2JkY2Q3Mjc4OTBlNjNiODFkODE1NzE0
|
10
|
-
NTcwYTIwMDE2NGRkYWI4NDczYmYzNmY1YWM3MGI4YzVlYTAzZWRmNWJkNjRj
|
11
|
-
ODFiZDBiYmQ1Y2EyYzc5YTMwNWE5MjdhYTNhMjU1NTVhYjI3Nzg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZTAwYTUyN2E1Nzk0MzczNWY3ODk4MzI1ZTUwOTgxOTRiZWM1ZDBlOGNlYTY5
|
14
|
-
MDU3ZjY1ODBjYWU4NWI2ODVkZWRiZjFhYzIxNDk4MWJiOWVlODM5ODYwNTFk
|
15
|
-
ZTQ0Y2Y2N2ZlZDcyMDYyNzdkMTczMzQ4YmJhMDlkZTdhYmY3NDY=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 47a865edac170557b0e09a6f14cee59f9ed30f40
|
4
|
+
data.tar.gz: 01218e3f50951dacf34a6ee6111cc7f0b64156c4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f3b275947b365318bb8a18a05e5a64908b27f1d3607deb2116adb5a6e871e5faee366092c20ed8308b2f0b14cedf586e4ac6c7779f80d044b3848295ab5f0ec4
|
7
|
+
data.tar.gz: 1a45d7087df95c4595c14929f7ee3b08d8ad64eaec61b0a10438195e407729c4a3d2d3051858613bc6bf825f5304ac36be094de6572f3f7423f93b12e9514318
|
@@ -23,6 +23,7 @@ module SeleniumFury
|
|
23
23
|
puts "class #{page_class}"
|
24
24
|
page_object=page_class.new(driver)
|
25
25
|
raise "Could not find web driver elements in #{page_class}" if page_class.elements.nil?
|
26
|
+
page_source = Nokogiri::HTML(@driver.page_source) if validate_tags.fetch(:verification_type, nil) == :nokogiri
|
26
27
|
page_class.elements.each do |web_driver_element_name|
|
27
28
|
puts "\tValidating #{web_driver_element_name}"
|
28
29
|
begin
|
@@ -44,11 +45,20 @@ module SeleniumFury
|
|
44
45
|
else
|
45
46
|
true
|
46
47
|
end
|
47
|
-
if validate_element
|
48
|
-
|
49
|
-
|
48
|
+
if validate_element
|
49
|
+
if validate_tags.fetch(:verification_type, nil) == :nokogiri && element_obj.location.keys.first == :css
|
50
|
+
css_value = element_obj.location.invert.keys.first
|
51
|
+
element_present = page_source.css(css_value).size >= 1
|
52
|
+
else
|
53
|
+
element_present = element_obj.present?
|
54
|
+
end
|
55
|
+
unless element_present
|
56
|
+
puts "\t\t\tCould not find #{web_driver_element_name}"
|
57
|
+
missing_elements.push(web_driver_element_name)
|
58
|
+
end
|
59
|
+
else
|
60
|
+
skipped_elements.push(web_driver_element_name)
|
50
61
|
end
|
51
|
-
skipped_elements.push(web_driver_element_name) unless validate_element
|
52
62
|
end
|
53
63
|
if missing_elements.length > 0
|
54
64
|
puts "Missing Elements:"
|
@@ -229,7 +229,7 @@ describe PageObject do
|
|
229
229
|
it 'should error immediately with traditional element check and implicit wait not set' do
|
230
230
|
start_time = Time.now
|
231
231
|
expect { driver.find_element(id: 'not a element') }.
|
232
|
-
to raise_exception(Selenium::WebDriver::Error::NoSuchElementError
|
232
|
+
to raise_exception(Selenium::WebDriver::Error::NoSuchElementError)
|
233
233
|
(Time.now-start_time).should < 1
|
234
234
|
end
|
235
235
|
|
@@ -238,7 +238,7 @@ describe PageObject do
|
|
238
238
|
|
239
239
|
start_time = Time.now
|
240
240
|
expect { driver.find_element(id: 'not a element') }.
|
241
|
-
to raise_exception(Selenium::WebDriver::Error::NoSuchElementError
|
241
|
+
to raise_exception(Selenium::WebDriver::Error::NoSuchElementError)
|
242
242
|
(Time.now-start_time).should > 2
|
243
243
|
end
|
244
244
|
|
@@ -254,7 +254,7 @@ describe PageObject do
|
|
254
254
|
|
255
255
|
start_time = Time.now
|
256
256
|
expect { driver.find_element(id: 'not a element') }.
|
257
|
-
to raise_exception(Selenium::WebDriver::Error::NoSuchElementError
|
257
|
+
to raise_exception(Selenium::WebDriver::Error::NoSuchElementError)
|
258
258
|
(Time.now-start_time).should > 2
|
259
259
|
end
|
260
260
|
end
|
@@ -7,9 +7,13 @@ describe SeleniumFury::SeleniumWebDriver::PageValidator do
|
|
7
7
|
|
8
8
|
context "with present elements" do
|
9
9
|
|
10
|
-
it "should not raise an error when validating" do
|
10
|
+
it "should not raise an error when validating with Selenium" do
|
11
11
|
expect { validate(TestPage) }.to_not raise_error
|
12
12
|
end
|
13
|
+
|
14
|
+
it "should not raise an error when validating with Nokogiri" do
|
15
|
+
expect {validate(TestPage, {verification_type: :nokogiri})}.to_not raise_error
|
16
|
+
end
|
13
17
|
end
|
14
18
|
|
15
19
|
context "with missing elements" do
|
@@ -37,7 +41,7 @@ describe SeleniumFury::SeleniumWebDriver::PageValidator do
|
|
37
41
|
|
38
42
|
it "should validate everything not hard coded when no tags are passed" do
|
39
43
|
expect { validate(SkippedElement) }.
|
40
|
-
|
44
|
+
to raise_exception(RuntimeError, "Found Missing Elements: [:foo_element, :bar_element, :multiple_tag, :no_tag]")
|
41
45
|
end
|
42
46
|
|
43
47
|
it "should validate all elements where all tags defined in the Page Object are passed in with the test" do
|
@@ -62,5 +66,6 @@ describe SeleniumFury::SeleniumWebDriver::PageValidator do
|
|
62
66
|
expect { validate(SkippedElement, {validate_any: [:foo], validate_all: [:bar]}) }.
|
63
67
|
to raise_exception(RuntimeError, "Can't use both :validate_any and :validate_all tags")
|
64
68
|
end
|
69
|
+
|
65
70
|
end
|
66
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium_fury
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Sims
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: selenium-webdriver
|
@@ -56,42 +56,42 @@ dependencies:
|
|
56
56
|
name: cucumber
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: redcarpet
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -112,14 +112,14 @@ dependencies:
|
|
112
112
|
name: parallel_tests
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description: Generate and validate page objects with this page object factory for
|
@@ -178,12 +178,12 @@ require_paths:
|
|
178
178
|
- lib
|
179
179
|
required_ruby_version: !ruby/object:Gem::Requirement
|
180
180
|
requirements:
|
181
|
-
- -
|
181
|
+
- - '>='
|
182
182
|
- !ruby/object:Gem::Version
|
183
183
|
version: '0'
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- -
|
186
|
+
- - '>='
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|