sapphire 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/sapphire +0 -0
- data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +4 -4
- 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 +2 -2
- data/lib/sapphire/DSL/Evaluations/Evaluation.rb +5 -5
- 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/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/Hash.rb +112 -112
- data/lib/sapphire/Extensions/Numeric.rb +6 -6
- data/lib/sapphire/JobAbstractions/Job.rb +32 -32
- data/lib/sapphire/Plugins/Debugging/VerboseObserver.rb +36 -36
- data/lib/sapphire/Plugins/Highlighters/Highlighter.rb +40 -40
- data/lib/sapphire/Plugins/Plugin.rb +20 -20
- 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 +12 -8
- data/lib/sapphire/WebAbstractions/Controls/Button.rb +7 -7
- data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
- data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +4 -4
- data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
- data/lib/sapphire/WebAbstractions/Controls/List.rb +11 -13
- data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
- data/lib/sapphire/version.rb +1 -1
- metadata +17 -21
data/bin/sapphire
CHANGED
File without changes
|
@@ -128,7 +128,7 @@ module Sapphire
|
|
128
128
|
$page ||= page
|
129
129
|
|
130
130
|
timeout = GetValue(page, :wait)
|
131
|
-
timeout ||=
|
131
|
+
timeout ||= 20
|
132
132
|
|
133
133
|
$page.Init
|
134
134
|
|
@@ -206,8 +206,8 @@ module Sapphire
|
|
206
206
|
|
207
207
|
if array.is_a? Hash
|
208
208
|
x = self.FindElement array.keys.first, array.fetch(array.keys.first)
|
209
|
-
by =
|
210
|
-
value =
|
209
|
+
by = array.keys.first
|
210
|
+
value = array.fetch(array.keys.first)
|
211
211
|
end
|
212
212
|
return x, by, value if x != nil
|
213
213
|
return x, by, value if comparator.Compare(x != nil, true) if comparator != nil
|
@@ -270,7 +270,7 @@ module Sapphire
|
|
270
270
|
|
271
271
|
end if array.is_a? Array
|
272
272
|
|
273
|
-
x = self.
|
273
|
+
x = self.FindElements array.keys.first, array.fetch(array.keys.first) if array.is_a? Hash
|
274
274
|
if !x.nil?
|
275
275
|
by = item.keys.first
|
276
276
|
value = item[item.keys.first]
|
@@ -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
|
@@ -1,15 +1,15 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Track(hash)
|
5
|
-
$tracker ||= {}
|
6
|
-
$tracker.merge! hash
|
7
|
-
end
|
8
|
-
|
9
|
-
def Tracker(item)
|
10
|
-
$tracker[item]
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Track(hash)
|
5
|
+
$tracker ||= {}
|
6
|
+
$tracker.merge! hash
|
7
|
+
end
|
8
|
+
|
9
|
+
def Tracker(item)
|
10
|
+
$tracker[item]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Accept(item)
|
5
|
-
item.Accept
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Accept(item)
|
5
|
+
item.Accept
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Check(item)
|
5
|
-
item.Check
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Check(item)
|
5
|
+
item.Check
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Clear(item)
|
5
|
-
item.Clear(item)
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Clear(item)
|
5
|
+
item.Clear(item)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Click(item)
|
5
|
-
item.Click
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Click(item)
|
5
|
+
item.Click
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Compare(control1, control2, &block)
|
5
|
-
if(control1.is_a? Symbol)
|
6
|
-
$compare1 = GetPageField(control1).Text
|
7
|
-
else
|
8
|
-
$compare1 = control1
|
9
|
-
end
|
10
|
-
if(control2.is_a? Symbol)
|
11
|
-
$compare2 = GetPageField(control2).Text
|
12
|
-
else
|
13
|
-
$compare2 = control2
|
14
|
-
end
|
15
|
-
block.call()
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Compare(control1, control2, &block)
|
5
|
+
if(control1.is_a? Symbol)
|
6
|
+
$compare1 = GetPageField(control1).Text
|
7
|
+
else
|
8
|
+
$compare1 = control1
|
9
|
+
end
|
10
|
+
if(control2.is_a? Symbol)
|
11
|
+
$compare2 = GetPageField(control2).Text
|
12
|
+
else
|
13
|
+
$compare2 = control2
|
14
|
+
end
|
15
|
+
block.call()
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
19
|
end
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Complete(page)
|
5
|
-
if(page.is_a? Class)
|
6
|
-
temp = page.new
|
7
|
-
temp.Complete
|
8
|
-
else
|
9
|
-
page.Complete
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Complete(page)
|
5
|
+
if(page.is_a? Class)
|
6
|
+
temp = page.new
|
7
|
+
temp.Complete
|
8
|
+
else
|
9
|
+
page.Complete
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
14
|
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Exists(symbol)
|
5
|
-
if($page.Contains symbol)
|
6
|
-
begin
|
7
|
-
return $page.Get(symbol).Visible(false).Evaluate()
|
8
|
-
rescue
|
9
|
-
return false
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Exists(symbol)
|
5
|
+
if($page.Contains symbol)
|
6
|
+
begin
|
7
|
+
return $page.Get(symbol).Visible(false).Evaluate()
|
8
|
+
rescue
|
9
|
+
return false
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Exit(item)
|
5
|
-
item.Close
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Exit(item)
|
5
|
+
item.Close
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
|