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
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def MouseOver(item)
|
5
|
-
item.MouseOver
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def MouseOver(item)
|
5
|
+
item.MouseOver
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Navigate(page)
|
5
|
-
$driver.NavigateTo(page)
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Navigate(page)
|
5
|
+
$driver.NavigateTo(page)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Press(item)
|
5
|
-
item.Press(item)
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Press(item)
|
5
|
+
item.Press(item)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
9
|
end
|
@@ -1,11 +1,11 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Reload(item)
|
5
|
-
$driver.Reload
|
6
|
-
Should Show item
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Reload(item)
|
5
|
+
$driver.Reload
|
6
|
+
Should Show item
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Set(hash)
|
5
|
-
hash.Set hash
|
6
|
-
end
|
7
|
-
#alias :Set :Verb
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Set(hash)
|
5
|
+
hash.Set hash
|
6
|
+
end
|
7
|
+
#alias :Set :Verb
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
module Browser
|
4
|
-
def Uncheck(item)
|
5
|
-
item.Uncheck
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
module Browser
|
4
|
+
def Uncheck(item)
|
5
|
+
item.Uncheck
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class CheckedComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare(left.Checked, true) if @comparator != nil
|
7
|
-
left.Checked
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + " to be checked" if @comparator != nil
|
12
|
-
" to be checked"
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class CheckedComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare(left.Checked, true) if @comparator != nil
|
7
|
+
left.Checked
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + " to be checked" if @comparator != nil
|
12
|
+
" to be checked"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,50 +1,50 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class Comparison
|
4
|
-
|
5
|
-
attr_reader :item
|
6
|
-
|
7
|
-
def initialize(item)
|
8
|
-
@item = item
|
9
|
-
@item.CompareWith(self) if @item.is_a? Evaluation or @item.is_a? Evaluator or @item.is_a? Comparison
|
10
|
-
end
|
11
|
-
|
12
|
-
def CompareWith(item)
|
13
|
-
@comparator = item
|
14
|
-
end
|
15
|
-
|
16
|
-
def Create(item)
|
17
|
-
return self.class.new(item) if item.is_a? Comparison or item.is_a? Evaluation
|
18
|
-
item
|
19
|
-
end
|
20
|
-
|
21
|
-
def Output()
|
22
|
-
@item.Output
|
23
|
-
end
|
24
|
-
|
25
|
-
def Evaluate()
|
26
|
-
@item.Evaluate
|
27
|
-
end
|
28
|
-
|
29
|
-
def left=(val)
|
30
|
-
@item.left=val
|
31
|
-
end
|
32
|
-
|
33
|
-
def right=(val)
|
34
|
-
@item.right=val
|
35
|
-
end
|
36
|
-
|
37
|
-
def left
|
38
|
-
@item.left
|
39
|
-
end
|
40
|
-
|
41
|
-
def right
|
42
|
-
@item.right
|
43
|
-
end
|
44
|
-
|
45
|
-
def execute
|
46
|
-
@item.execute
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class Comparison
|
4
|
+
|
5
|
+
attr_reader :item
|
6
|
+
|
7
|
+
def initialize(item)
|
8
|
+
@item = item
|
9
|
+
@item.CompareWith(self) if @item.is_a? Evaluation or @item.is_a? Evaluator or @item.is_a? Comparison
|
10
|
+
end
|
11
|
+
|
12
|
+
def CompareWith(item)
|
13
|
+
@comparator = item
|
14
|
+
end
|
15
|
+
|
16
|
+
def Create(item)
|
17
|
+
return self.class.new(item) if item.is_a? Comparison or item.is_a? Evaluation
|
18
|
+
item
|
19
|
+
end
|
20
|
+
|
21
|
+
def Output()
|
22
|
+
@item.Output
|
23
|
+
end
|
24
|
+
|
25
|
+
def Evaluate()
|
26
|
+
@item.Evaluate
|
27
|
+
end
|
28
|
+
|
29
|
+
def left=(val)
|
30
|
+
@item.left=val
|
31
|
+
end
|
32
|
+
|
33
|
+
def right=(val)
|
34
|
+
@item.right=val
|
35
|
+
end
|
36
|
+
|
37
|
+
def left
|
38
|
+
@item.left
|
39
|
+
end
|
40
|
+
|
41
|
+
def right
|
42
|
+
@item.right
|
43
|
+
end
|
44
|
+
|
45
|
+
def execute
|
46
|
+
@item.execute
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class ContainsComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(
|
6
|
-
return @comparator.Compare((
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + " to contain" if @comparator != nil
|
12
|
-
" to contain"
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class ContainsComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(actual, expected)
|
6
|
+
return @comparator.Compare((actual.include? expected), true) if @comparator != nil
|
7
|
+
actual.include? expected
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + " to contain" if @comparator != nil
|
12
|
+
" to contain"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class DifferComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare((right == left), true) if @comparator != nil
|
7
|
-
right == left
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + "" if @comparator != nil
|
12
|
-
""
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class DifferComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare((right == left), true) if @comparator != nil
|
7
|
+
right == left
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + "" if @comparator != nil
|
12
|
+
""
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class EqualsComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare(left == right, true) if @comparator != nil
|
7
|
-
left == right
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
""
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class EqualsComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare(left == right, true) if @comparator != nil
|
7
|
+
left == right
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
""
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,21 +1,21 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
def Not(item)
|
4
|
-
NotComparison.new(item)
|
5
|
-
end
|
6
|
-
|
7
|
-
class NotComparison < Comparison
|
8
|
-
|
9
|
-
def Compare(left, right)
|
10
|
-
return @comparator.Compare(left != right, true) if @comparator != nil
|
11
|
-
left != right
|
12
|
-
end
|
13
|
-
|
14
|
-
def Text
|
15
|
-
return @comparator.Text + " NOT" if @comparator != nil
|
16
|
-
" NOT"
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
def Not(item)
|
4
|
+
NotComparison.new(item)
|
5
|
+
end
|
6
|
+
|
7
|
+
class NotComparison < Comparison
|
8
|
+
|
9
|
+
def Compare(left, right)
|
10
|
+
return @comparator.Compare(left != right, true) if @comparator != nil
|
11
|
+
left != right
|
12
|
+
end
|
13
|
+
|
14
|
+
def Text
|
15
|
+
return @comparator.Text + " NOT" if @comparator != nil
|
16
|
+
" NOT"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
21
|
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sapphire
|
2
|
-
module DSL
|
3
|
-
class SelectedComparison < Comparison
|
4
|
-
|
5
|
-
def Compare(left, right)
|
6
|
-
return @comparator.Compare(left.Selected, true) if @comparator != nil
|
7
|
-
left.Selected
|
8
|
-
end
|
9
|
-
|
10
|
-
def Text
|
11
|
-
return @comparator.Text + " to be selected" if @comparator != nil
|
12
|
-
" to be selected"
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
1
|
+
module Sapphire
|
2
|
+
module DSL
|
3
|
+
class SelectedComparison < Comparison
|
4
|
+
|
5
|
+
def Compare(left, right)
|
6
|
+
return @comparator.Compare(left.Selected, true) if @comparator != nil
|
7
|
+
left.Selected
|
8
|
+
end
|
9
|
+
|
10
|
+
def Text
|
11
|
+
return @comparator.Text + " to be selected" if @comparator != nil
|
12
|
+
" to be selected"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|