sapphire 0.7.26 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sapphire.rb +51 -40
- data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +24 -68
- data/lib/sapphire/DSL.rb +18 -16
- data/lib/sapphire/DSL/Browser/Create.rb +10 -10
- data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +20 -20
- data/lib/sapphire/DSL/Browser/Fluff/By.rb +10 -10
- data/lib/sapphire/DSL/Browser/Fluff/To.rb +10 -10
- data/lib/sapphire/DSL/Browser/Fluff/With.rb +10 -10
- data/lib/sapphire/DSL/Browser/Nouns/Browser.rb +17 -17
- data/lib/sapphire/DSL/Browser/Nouns/Enter.rb +10 -10
- data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
- data/lib/sapphire/DSL/Browser/Verbs/Accept.rb +8 -8
- data/lib/sapphire/DSL/Browser/Verbs/Check.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Clear.rb +8 -8
- data/lib/sapphire/DSL/Browser/Verbs/Click.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Compare.rb +18 -18
- data/lib/sapphire/DSL/Browser/Verbs/Complete.rb +13 -13
- data/lib/sapphire/DSL/Browser/Verbs/Exists.rb +16 -16
- data/lib/sapphire/DSL/Browser/Verbs/Exit.rb +11 -11
- data/lib/sapphire/DSL/Browser/Verbs/MouseOver.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Navigate.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Press.rb +8 -8
- data/lib/sapphire/DSL/Browser/Verbs/Reload.rb +11 -11
- data/lib/sapphire/DSL/Browser/Verbs/Set.rb +10 -10
- data/lib/sapphire/DSL/Browser/Verbs/Uncheck.rb +10 -10
- data/lib/sapphire/DSL/Comparisons/CheckedComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/Comparison.rb +50 -50
- data/lib/sapphire/DSL/Comparisons/ContainsComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/DifferComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/EqualsComparison.rb +16 -16
- data/lib/sapphire/DSL/Comparisons/NotComparison.rb +20 -20
- data/lib/sapphire/DSL/Comparisons/SelectedComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/StartsWithComparison.rb +17 -17
- data/lib/sapphire/DSL/Comparisons/VisibleComparison.rb +17 -17
- data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
- data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
- data/lib/sapphire/DSL/Configuration/Use.rb +18 -18
- data/lib/sapphire/DSL/Data/Find.rb +10 -10
- data/lib/sapphire/DSL/Data/GetPageField.rb +13 -13
- data/lib/sapphire/DSL/Data/Verify.rb +10 -10
- data/lib/sapphire/DSL/Evaluations/ControlEvaluation.rb +13 -0
- data/lib/sapphire/DSL/Evaluations/Evaluation.rb +55 -45
- data/lib/sapphire/DSL/Evaluations/FieldNotDefinedEvaluation.rb +20 -20
- data/lib/sapphire/DSL/Evaluations/FieldNotFoundEvaluation.rb +22 -22
- data/lib/sapphire/DSL/Evaluators/Contain.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Count.rb +8 -8
- data/lib/sapphire/DSL/Evaluators/Differ.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Exist.rb +9 -9
- data/lib/sapphire/DSL/Evaluators/In.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Selected.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Show.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Transition.rb +10 -10
- data/lib/sapphire/DSL/Evaluators/Validate.rb +8 -8
- data/lib/sapphire/DSL/Events/Data.rb +12 -0
- data/lib/sapphire/DSL/Events/DataSegment.rb +18 -0
- data/lib/sapphire/DSL/Events/Event.rb +11 -3
- data/lib/sapphire/DSL/Events/Expect.rb +3 -11
- data/lib/sapphire/DSL/Events/Expectation.rb +14 -0
- data/lib/sapphire/DSL/Events/For.rb +11 -0
- data/lib/sapphire/DSL/Events/From.rb +9 -0
- data/lib/sapphire/DSL/Events/Where.rb +11 -0
- data/lib/sapphire/DSL/Profiles/Profile.rb +26 -0
- data/lib/sapphire/DSL/Profiles/Table.rb +9 -0
- data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
- data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
- data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
- data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
- data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
- data/lib/sapphire/Data.rb +1 -1
- data/lib/sapphire/DataAbstractions/Database.rb +57 -57
- data/lib/sapphire/DataAbstractions/Query.rb +20 -20
- data/lib/sapphire/Extensions/Class.rb +2 -2
- data/lib/sapphire/Extensions/Hash.rb +112 -112
- data/lib/sapphire/Extensions/Module.rb +11 -0
- data/lib/sapphire/Extensions/Numeric.rb +6 -6
- data/lib/sapphire/Extensions/Object.rb +4 -0
- data/lib/sapphire/Extensions/String.rb +30 -23
- data/lib/sapphire/Extensions/Symbol.rb +1 -1
- data/lib/sapphire/JobAbstractions/Job.rb +32 -32
- data/lib/sapphire/Observable.rb +87 -0
- data/lib/sapphire/Observers.rb +2 -0
- data/lib/sapphire/Observers/FailedControlHighlighter.rb +41 -0
- data/lib/sapphire/Observers/Highlighter.rb +40 -0
- data/lib/sapphire/Observers/Observer.rb +23 -0
- data/lib/sapphire/Observers/ObserverRepository.rb +37 -0
- data/lib/sapphire/Observers/PassedControlHighlighter.rb +42 -0
- data/lib/sapphire/Observers/VerboseObserver.rb +36 -0
- data/lib/sapphire/TeamCity.rb +10 -10
- data/lib/sapphire/Testing.rb +3 -3
- data/lib/sapphire/Testing/RakeTask.rb +108 -108
- data/lib/sapphire/Testing/ResultList.rb +18 -18
- data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
- data/lib/sapphire/Testing/TestResult.rb +21 -21
- data/lib/sapphire/Testing/TestRunnerAdapter.rb +85 -85
- data/lib/sapphire/UI/ProcessBuilder.rb +173 -173
- data/lib/sapphire/Virtualization.rb +7 -7
- data/lib/sapphire/Web.rb +2 -2
- data/lib/sapphire/WebAbstractions/Controls/AlertBox.rb +20 -20
- data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +43 -26
- data/lib/sapphire/WebAbstractions/Controls/Button.rb +7 -7
- data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +3 -3
- data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
- data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +6 -8
- data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/Image.rb +19 -19
- data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/List.rb +16 -16
- data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +2 -2
- data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
- data/lib/sapphire/version.rb +1 -1
- metadata +26 -8
data/lib/sapphire.rb
CHANGED
@@ -1,40 +1,51 @@
|
|
1
|
-
$:.unshift File.expand_path("..", __FILE__)
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'Platform'
|
5
|
-
require 'yaml'
|
6
|
-
require 'selenium-webdriver'
|
7
|
-
require 'delegate'
|
8
|
-
require 'Forwardable'
|
9
|
-
|
10
|
-
require 'sapphire/
|
11
|
-
require 'sapphire/
|
12
|
-
require 'sapphire/
|
13
|
-
require 'sapphire/
|
14
|
-
require 'sapphire/
|
15
|
-
require 'sapphire/
|
16
|
-
require 'sapphire/
|
17
|
-
require 'sapphire/
|
18
|
-
require 'sapphire/
|
19
|
-
require 'sapphire/
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
include DSL
|
26
|
-
include DSL::
|
27
|
-
include DSL::
|
28
|
-
include DSL::
|
29
|
-
include DSL::
|
30
|
-
include
|
31
|
-
include
|
32
|
-
include
|
33
|
-
include
|
34
|
-
include
|
35
|
-
include
|
36
|
-
include
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
1
|
+
$:.unshift File.expand_path("..", __FILE__)
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'Platform'
|
5
|
+
require 'yaml'
|
6
|
+
require 'selenium-webdriver'
|
7
|
+
require 'delegate'
|
8
|
+
require 'Forwardable'
|
9
|
+
|
10
|
+
require 'sapphire/Observable'
|
11
|
+
require 'sapphire/Adapters'
|
12
|
+
require 'sapphire/Testing'
|
13
|
+
require 'sapphire/Web'
|
14
|
+
require 'sapphire/DSL'
|
15
|
+
require 'sapphire/Extensions'
|
16
|
+
require 'sapphire/CommandLine'
|
17
|
+
require 'sapphire/Configuration'
|
18
|
+
require 'sapphire/Data'
|
19
|
+
require 'sapphire/Virtualization'
|
20
|
+
require 'sapphire/TeamCity'
|
21
|
+
require 'sapphire/Observers'
|
22
|
+
|
23
|
+
module Sapphire
|
24
|
+
module Sapphire
|
25
|
+
include DSL
|
26
|
+
include DSL::Scenarios
|
27
|
+
include DSL::Browser
|
28
|
+
include DSL::Configuration
|
29
|
+
include DSL::Data
|
30
|
+
include DSL::TestPlans
|
31
|
+
include DSL::Coverage
|
32
|
+
include Configuration
|
33
|
+
include DataAbstractions
|
34
|
+
include JobAbstractions
|
35
|
+
include WebAbstractions
|
36
|
+
include Testing
|
37
|
+
include Testing::TeamCity
|
38
|
+
include Observers
|
39
|
+
include UI
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
$driver = Sapphire::WebAbstractions::MetaBrowser.new(nil)
|
44
|
+
|
45
|
+
Sapphire.sub_modules.each do |m|
|
46
|
+
m.sub_classes.each do |s|
|
47
|
+
m.const_get(s).observe() if m.const_get(s).respond_to? :observe
|
48
|
+
Sapphire::Observers::ObserverRepository.instance.Add(m.const_get(s).new) if m.const_get(s).respond_to? :IsObserver
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
@@ -175,118 +175,72 @@ module Sapphire
|
|
175
175
|
return temp
|
176
176
|
end
|
177
177
|
|
178
|
-
def FindItem(
|
178
|
+
def FindItem(by, value, comparator = nil)
|
179
179
|
|
180
180
|
x = nil
|
181
|
-
array.each do |item|
|
182
181
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
end
|
189
|
-
end
|
190
|
-
|
191
|
-
x = self.FindElement item[0], item[1] if item.is_a? Array
|
192
|
-
|
193
|
-
return x if x != nil
|
194
|
-
return x if comparator.Compare(x != nil, true) if comparator != nil
|
195
|
-
|
196
|
-
end if array.is_a? Array
|
182
|
+
begin
|
183
|
+
x = self.FindElement by, value
|
184
|
+
rescue
|
185
|
+
#do nothing, let it keep looping
|
186
|
+
end
|
197
187
|
|
198
|
-
x = self.FindElement array.keys.first, array.fetch(array.keys.first) if array.is_a? Hash
|
199
188
|
return x if x != nil
|
200
189
|
return x if comparator.Compare(x != nil, true) if comparator != nil
|
201
190
|
|
202
191
|
end
|
203
192
|
|
204
|
-
def FindItemWithWait(
|
193
|
+
def FindItemWithWait(by, value, comparator=nil)
|
205
194
|
masterWait = Selenium::WebDriver::Wait.new(:timeout => 20)
|
206
195
|
|
207
196
|
element = masterWait.until {
|
208
|
-
x = FindItem(
|
197
|
+
x = FindItem(by, value, comparator)
|
209
198
|
return x if x != nil
|
210
199
|
return x if comparator.Compare(x != nil, true) if comparator != nil
|
211
200
|
}
|
212
201
|
|
213
202
|
return element if element != nil
|
214
203
|
return element if comparator.Compare(element != nil, true) if comparator != nil
|
215
|
-
|
204
|
+
|
205
|
+
raise "Could not find control using lookup #{by} and value #{value}."
|
216
206
|
|
217
207
|
end
|
218
208
|
|
219
|
-
def FindItemWithoutWait(
|
209
|
+
def FindItemWithoutWait(by, value, comparator=nil)
|
220
210
|
|
221
|
-
element = FindItem(
|
211
|
+
element = FindItem(by, value, comparator)
|
222
212
|
|
223
213
|
return element if element != nil
|
224
214
|
return element if comparator.Compare(element != nil, true) if comparator != nil
|
225
|
-
raise "Could not find control
|
215
|
+
raise "Could not find control using lookup #{by} and value #{value}."
|
226
216
|
|
227
217
|
end
|
228
218
|
|
229
|
-
def FindAllItems(
|
219
|
+
def FindAllItems(by, value)
|
230
220
|
masterWait = Selenium::WebDriver::Wait.new(:timeout => 20)
|
231
221
|
|
232
222
|
element = masterWait.until {
|
233
223
|
x = nil
|
234
|
-
|
235
|
-
|
236
|
-
if item.is_a? Hash
|
237
|
-
begin
|
238
|
-
x = self.FindElements item.keys.first, item.fetch(item.keys.first)
|
239
|
-
x = nil if x.is_a? Array and x.empty?
|
240
|
-
rescue
|
241
|
-
#do nothing, let it keep looping
|
242
|
-
end
|
243
|
-
end
|
244
|
-
|
245
|
-
x = self.FindElements item[0], item[1] if item.is_a? Array
|
224
|
+
begin
|
225
|
+
x = self.FindElements by, value
|
246
226
|
x = nil if x.is_a? Array and x.empty?
|
247
|
-
|
248
|
-
|
249
|
-
end
|
227
|
+
rescue
|
228
|
+
#do nothing, let it keep looping
|
229
|
+
end
|
250
230
|
|
251
|
-
x =
|
231
|
+
x = nil if x.is_a? Array and x.empty?
|
252
232
|
return x if x != nil
|
233
|
+
|
253
234
|
}
|
254
235
|
return element if element != nil
|
255
|
-
raise "Could not find control
|
256
|
-
end
|
257
|
-
|
258
|
-
def Spectate(discriminator, selector)
|
259
|
-
if ENV["spectator"] == "true"
|
260
|
-
begin
|
261
|
-
if(discriminator == :id)
|
262
|
-
self.ExecuteScript("document.getElementById('#{selector}').style.backgroundColor = '#FFF467'; ")
|
263
|
-
elsif (discriminator == :name )
|
264
|
-
self.ExecuteScript("document.getElementByName('#{selector}').style.backgroundColor = '#FFF467'; ")
|
265
|
-
elsif (discriminator == :xpath)
|
266
|
-
self.ExecuteScript("document.evaluate( '#{selector}', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.backgroundColor = '#FFF467'; ")
|
267
|
-
end
|
268
|
-
|
269
|
-
sleep 1
|
270
|
-
|
271
|
-
if(discriminator == :id)
|
272
|
-
self.ExecuteScript("document.getElementById('#{selector}').style.backgroundColor = '#ACD372'; ")
|
273
|
-
elsif (discriminator == :name )
|
274
|
-
self.ExecuteScript("document.getElementByName('#{selector}').style.backgroundColor = '#ACD372'; ")
|
275
|
-
elsif (discriminator == :xpath)
|
276
|
-
self.ExecuteScript("document.evaluate( '#{selector}', document, null, XPathResult.ANY_TYPE, null ).iterateNext().style.backgroundColor = '#ACD372'; ")
|
277
|
-
end
|
278
|
-
rescue
|
279
|
-
end
|
280
|
-
end
|
236
|
+
raise "Could not find control using lookup #{by} and value #{value}."
|
281
237
|
end
|
282
238
|
|
283
239
|
def FindElement(discriminator, selector)
|
284
|
-
self.Spectate(discriminator, selector)
|
285
240
|
self.Browser().find_element discriminator, selector
|
286
241
|
end
|
287
242
|
|
288
243
|
def FindElements(discriminator, selector)
|
289
|
-
self.Spectate(discriminator, selector)
|
290
244
|
self.Browser().find_elements discriminator, selector
|
291
245
|
end
|
292
246
|
|
@@ -297,6 +251,8 @@ module Sapphire
|
|
297
251
|
def Create(type)
|
298
252
|
Selenium::WebDriver.for type
|
299
253
|
end
|
254
|
+
|
255
|
+
include Sapphire::Observable
|
300
256
|
end
|
301
257
|
end
|
302
258
|
end
|
data/lib/sapphire/DSL.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) +'/DSL/Evaluators/Evaluator.rb', __FILE__)
|
2
|
-
require File.expand_path(File.dirname(__FILE__) +'/DSL/Comparisons/Comparison.rb', __FILE__)
|
3
|
-
|
4
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
5
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
6
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
7
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
8
|
-
Dir[File.dirname(__FILE__) + '/DSL/Browser
|
9
|
-
Dir[File.dirname(__FILE__) + '/DSL/Browser/
|
10
|
-
Dir[File.dirname(__FILE__) + '/DSL/Browser/
|
11
|
-
Dir[File.dirname(__FILE__) + '/DSL/Browser/
|
12
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
13
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
14
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
15
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
16
|
-
Dir[File.dirname(__FILE__) + '/DSL/
|
1
|
+
require File.expand_path(File.dirname(__FILE__) +'/DSL/Evaluators/Evaluator.rb', __FILE__)
|
2
|
+
require File.expand_path(File.dirname(__FILE__) +'/DSL/Comparisons/Comparison.rb', __FILE__)
|
3
|
+
require File.expand_path(File.dirname(__FILE__) +'/DSL/Evaluations/Evaluation.rb', __FILE__)
|
4
|
+
Dir[File.dirname(__FILE__) + '/DSL/Evaluators/*.rb'].each {|file| require file }
|
5
|
+
Dir[File.dirname(__FILE__) + '/DSL/Comparisons/*.rb'].each {|file| require file }
|
6
|
+
Dir[File.dirname(__FILE__) + '/DSL/Evaluations/*.rb'].each {|file| require file }
|
7
|
+
Dir[File.dirname(__FILE__) + '/DSL/TestPlans/*.rb'].each {|file| require file }
|
8
|
+
Dir[File.dirname(__FILE__) + '/DSL/Browser/*.rb'].each {|file| require file }
|
9
|
+
Dir[File.dirname(__FILE__) + '/DSL/Browser/Fluff/*.rb'].each {|file| require file }
|
10
|
+
Dir[File.dirname(__FILE__) + '/DSL/Browser/Nouns/*.rb'].each {|file| require file }
|
11
|
+
Dir[File.dirname(__FILE__) + '/DSL/Browser/Verbs/*.rb'].each {|file| require file }
|
12
|
+
Dir[File.dirname(__FILE__) + '/DSL/Browser/Keys/*.rb'].each {|file| require file }
|
13
|
+
Dir[File.dirname(__FILE__) + '/DSL/Configuration/*.rb'].each {|file| require file }
|
14
|
+
Dir[File.dirname(__FILE__) + '/DSL/Data/*.rb'].each {|file| require file }
|
15
|
+
Dir[File.dirname(__FILE__) + '/DSL/Scenarios/*.rb'].each {|file| require file }
|
16
|
+
Dir[File.dirname(__FILE__) + '/DSL/Events/*.rb'].each {|file| require file }
|
17
|
+
Dir[File.dirname(__FILE__) + '/DSL/Profiles/*.rb'].each {|file| require file }
|
18
|
+
Dir[File.dirname(__FILE__) + '/DSL/Coverage/*.rb'].each {|file| require file }
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Create(item, &block)
|
5
|
-
item.Create(item) do block.call end
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Create(item, &block)
|
5
|
+
item.Create(item) do block.call end
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,20 +1,20 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def ExecuteHashAgainstControl(hash, &block)
|
5
|
-
hash.keys.each do |key|
|
6
|
-
return block.call($page.Get(key), hash[key]) if($page.Contains key)
|
7
|
-
end
|
8
|
-
|
9
|
-
raise "Cannot find control matching " + hash.to_s + " for page " + $page.to_s
|
10
|
-
end
|
11
|
-
|
12
|
-
def ExecuteAgainstControl(item, &block)
|
13
|
-
return block.call($page.Get(item), item) if($page.Contains item)
|
14
|
-
|
15
|
-
raise "Cannot find controls matching: " + item.to_s + "for page " + $page.to_s
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def ExecuteHashAgainstControl(hash, &block)
|
5
|
+
hash.keys.each do |key|
|
6
|
+
return block.call($page.Get(key), hash[key]) if($page.Contains key)
|
7
|
+
end
|
8
|
+
|
9
|
+
raise "Cannot find control matching " + hash.to_s + " for page " + $page.to_s
|
10
|
+
end
|
11
|
+
|
12
|
+
def ExecuteAgainstControl(item, &block)
|
13
|
+
return block.call($page.Get(item), item) if($page.Contains item)
|
14
|
+
|
15
|
+
raise "Cannot find controls matching: " + item.to_s + "for page " + $page.to_s
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def By(value)
|
5
|
-
value
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def By(value)
|
5
|
+
value
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def To(item)
|
5
|
-
item
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def To(item)
|
5
|
+
item
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def With(item)
|
5
|
-
item
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def With(item)
|
5
|
+
item
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
class Browser
|
5
|
-
def Close
|
6
|
-
sleep(2)
|
7
|
-
$driver.Close
|
8
|
-
end
|
9
|
-
|
10
|
-
def Switch
|
11
|
-
$driver.Switch
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
class Browser
|
5
|
+
def Close
|
6
|
+
sleep(2)
|
7
|
+
$driver.Close
|
8
|
+
end
|
9
|
+
|
10
|
+
def Switch
|
11
|
+
$driver.Switch
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
class Enter
|
5
|
-
def Press
|
6
|
-
$driver.Type("\n")
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
class Enter
|
5
|
+
def Press
|
6
|
+
$driver.Type("\n")
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
11
|
end
|