sapphire 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -120,52 +120,60 @@ module Sapphire
|
|
120
120
|
return temp
|
121
121
|
end
|
122
122
|
|
123
|
-
def FindItem(
|
123
|
+
def FindItem(array)
|
124
124
|
masterWait = Selenium::WebDriver::Wait.new(:timeout => 30)
|
125
125
|
|
126
126
|
element = masterWait.until {
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
rescue
|
127
|
+
x = nil
|
128
|
+
array.each do |item|
|
129
|
+
|
130
|
+
if item.is_a? Hash
|
131
|
+
begin
|
132
|
+
x = self.FindElement item.keys.first, item.fetch(item.keys.first)
|
133
|
+
rescue
|
134
|
+
#do nothing, let it keep looping
|
135
|
+
end
|
137
136
|
end
|
138
|
-
end if hash.is_a? Array
|
139
137
|
|
140
|
-
|
138
|
+
x = self.FindElement item[0], item[1] if item.is_a? Array
|
139
|
+
|
140
|
+
return x if x != nil
|
141
|
+
|
142
|
+
end if array.is_a? Array
|
143
|
+
|
144
|
+
x = self.FindElement array.keys.first, array.fetch(hash.keys.first) if array.is_a? Hash
|
141
145
|
return x if x != nil
|
142
|
-
|
146
|
+
}
|
143
147
|
return element if element != nil
|
144
|
-
raise "Could not find control for
|
148
|
+
raise "Could not find control for array: " + array.to_s
|
145
149
|
end
|
146
150
|
|
147
|
-
def FindAllItems(
|
151
|
+
def FindAllItems(array)
|
148
152
|
masterWait = Selenium::WebDriver::Wait.new(:timeout => 30)
|
149
153
|
|
150
154
|
element = masterWait.until {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
rescue
|
155
|
+
x = nil
|
156
|
+
array.each do |item|
|
157
|
+
|
158
|
+
if item.is_a? Hash
|
159
|
+
begin
|
160
|
+
x = self.FindElements item.keys.first, item.fetch(item.keys.first)
|
161
|
+
rescue
|
162
|
+
#do nothing, let it keep looping
|
163
|
+
end
|
161
164
|
end
|
162
|
-
end if hash.is_a? Array
|
163
165
|
|
164
|
-
|
166
|
+
x = self.FindElements item[0], item[1] if item.is_a? Array
|
167
|
+
|
168
|
+
return x if x != nil
|
169
|
+
|
170
|
+
end if array.is_a? Array
|
171
|
+
|
172
|
+
x = self.FindElement array.keys.first, array.fetch(hash.keys.first) if array.is_a? Hash
|
165
173
|
return x if x != nil
|
166
|
-
|
174
|
+
}
|
167
175
|
return element if element != nil
|
168
|
-
raise "Could not find control for
|
176
|
+
raise "Could not find control for array: " + array.to_s
|
169
177
|
end
|
170
178
|
|
171
179
|
def FindElement(discriminator, selector)
|
@@ -15,6 +15,11 @@ class Class < Module
|
|
15
15
|
x.Complete
|
16
16
|
end
|
17
17
|
|
18
|
+
def Fail(item)
|
19
|
+
x = item.new
|
20
|
+
x.Fail
|
21
|
+
end
|
22
|
+
|
18
23
|
def Press(item)
|
19
24
|
x = item.new
|
20
25
|
x.Press
|
@@ -26,4 +31,9 @@ class Class < Module
|
|
26
31
|
klass.Set text
|
27
32
|
end
|
28
33
|
|
34
|
+
def Close
|
35
|
+
x = self.new
|
36
|
+
x.Close
|
37
|
+
end
|
38
|
+
|
29
39
|
end
|
data/lib/sapphire/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sapphire
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-17 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: selenium-webdriver
|
16
|
-
requirement: &
|
16
|
+
requirement: &10131612 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10131612
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: colorize
|
27
|
-
requirement: &
|
27
|
+
requirement: &10131360 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *10131360
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: Platform
|
38
|
-
requirement: &
|
38
|
+
requirement: &10131108 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *10131108
|
47
47
|
description: An automated web acceptance test framework for non-technical resources
|
48
48
|
using selenium-wedriver.
|
49
49
|
email:
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- lib/sapphire/DataAbstractions/Database.rb
|
65
65
|
- lib/sapphire/DataAbstractions/NonQuery.rb
|
66
66
|
- lib/sapphire/DataAbstractions/Query.rb
|
67
|
+
- lib/sapphire/DSL/Browser/Create.rb
|
67
68
|
- lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb
|
68
69
|
- lib/sapphire/DSL/Browser/Extensions/Class.rb
|
69
70
|
- lib/sapphire/DSL/Browser/Extensions/Hash.rb
|