sapphire 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/bin/sapphire +0 -0
  2. data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +4 -4
  3. data/lib/sapphire/DSL/Browser/Create.rb +10 -10
  4. data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +20 -20
  5. data/lib/sapphire/DSL/Browser/Fluff/By.rb +10 -10
  6. data/lib/sapphire/DSL/Browser/Fluff/To.rb +10 -10
  7. data/lib/sapphire/DSL/Browser/Fluff/With.rb +10 -10
  8. data/lib/sapphire/DSL/Browser/Nouns/Browser.rb +17 -17
  9. data/lib/sapphire/DSL/Browser/Nouns/Enter.rb +10 -10
  10. data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
  11. data/lib/sapphire/DSL/Browser/Verbs/Accept.rb +8 -8
  12. data/lib/sapphire/DSL/Browser/Verbs/Check.rb +10 -10
  13. data/lib/sapphire/DSL/Browser/Verbs/Clear.rb +8 -8
  14. data/lib/sapphire/DSL/Browser/Verbs/Click.rb +10 -10
  15. data/lib/sapphire/DSL/Browser/Verbs/Compare.rb +18 -18
  16. data/lib/sapphire/DSL/Browser/Verbs/Complete.rb +13 -13
  17. data/lib/sapphire/DSL/Browser/Verbs/Exists.rb +16 -16
  18. data/lib/sapphire/DSL/Browser/Verbs/Exit.rb +11 -11
  19. data/lib/sapphire/DSL/Browser/Verbs/MouseOver.rb +10 -10
  20. data/lib/sapphire/DSL/Browser/Verbs/Navigate.rb +10 -10
  21. data/lib/sapphire/DSL/Browser/Verbs/Press.rb +8 -8
  22. data/lib/sapphire/DSL/Browser/Verbs/Reload.rb +11 -11
  23. data/lib/sapphire/DSL/Browser/Verbs/Set.rb +10 -10
  24. data/lib/sapphire/DSL/Browser/Verbs/Uncheck.rb +10 -10
  25. data/lib/sapphire/DSL/Comparisons/CheckedComparison.rb +17 -17
  26. data/lib/sapphire/DSL/Comparisons/Comparison.rb +50 -50
  27. data/lib/sapphire/DSL/Comparisons/ContainsComparison.rb +17 -17
  28. data/lib/sapphire/DSL/Comparisons/DifferComparison.rb +17 -17
  29. data/lib/sapphire/DSL/Comparisons/EqualsComparison.rb +16 -16
  30. data/lib/sapphire/DSL/Comparisons/NotComparison.rb +20 -20
  31. data/lib/sapphire/DSL/Comparisons/SelectedComparison.rb +17 -17
  32. data/lib/sapphire/DSL/Comparisons/StartsWithComparison.rb +17 -17
  33. data/lib/sapphire/DSL/Comparisons/VisibleComparison.rb +17 -17
  34. data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
  35. data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
  36. data/lib/sapphire/DSL/Configuration/Use.rb +18 -18
  37. data/lib/sapphire/DSL/Data/Find.rb +10 -10
  38. data/lib/sapphire/DSL/Data/GetPageField.rb +13 -13
  39. data/lib/sapphire/DSL/Data/Verify.rb +10 -10
  40. data/lib/sapphire/DSL/Evaluations/ControlEvaluation.rb +2 -2
  41. data/lib/sapphire/DSL/Evaluations/Evaluation.rb +5 -5
  42. data/lib/sapphire/DSL/Evaluations/FieldNotDefinedEvaluation.rb +20 -20
  43. data/lib/sapphire/DSL/Evaluations/FieldNotFoundEvaluation.rb +22 -22
  44. data/lib/sapphire/DSL/Evaluators/Contain.rb +10 -10
  45. data/lib/sapphire/DSL/Evaluators/Count.rb +8 -8
  46. data/lib/sapphire/DSL/Evaluators/Differ.rb +10 -10
  47. data/lib/sapphire/DSL/Evaluators/Exist.rb +9 -9
  48. data/lib/sapphire/DSL/Evaluators/In.rb +10 -10
  49. data/lib/sapphire/DSL/Evaluators/Selected.rb +10 -10
  50. data/lib/sapphire/DSL/Evaluators/Show.rb +10 -10
  51. data/lib/sapphire/DSL/Evaluators/Transition.rb +10 -10
  52. data/lib/sapphire/DSL/Evaluators/Validate.rb +8 -8
  53. data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
  54. data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
  55. data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
  56. data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
  57. data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
  58. data/lib/sapphire/Data.rb +1 -1
  59. data/lib/sapphire/DataAbstractions/Database.rb +57 -57
  60. data/lib/sapphire/DataAbstractions/Query.rb +20 -20
  61. data/lib/sapphire/Extensions/Hash.rb +112 -112
  62. data/lib/sapphire/Extensions/Numeric.rb +6 -6
  63. data/lib/sapphire/JobAbstractions/Job.rb +32 -32
  64. data/lib/sapphire/Plugins/Debugging/VerboseObserver.rb +36 -36
  65. data/lib/sapphire/Plugins/Highlighters/Highlighter.rb +40 -40
  66. data/lib/sapphire/Plugins/Plugin.rb +20 -20
  67. data/lib/sapphire/TeamCity.rb +10 -10
  68. data/lib/sapphire/Testing.rb +3 -3
  69. data/lib/sapphire/Testing/RakeTask.rb +108 -108
  70. data/lib/sapphire/Testing/ResultList.rb +18 -18
  71. data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
  72. data/lib/sapphire/Testing/TestResult.rb +21 -21
  73. data/lib/sapphire/Testing/TestRunnerAdapter.rb +85 -85
  74. data/lib/sapphire/UI/ProcessBuilder.rb +173 -173
  75. data/lib/sapphire/Virtualization.rb +7 -7
  76. data/lib/sapphire/Web.rb +2 -2
  77. data/lib/sapphire/WebAbstractions/Controls/AlertBox.rb +20 -20
  78. data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +12 -8
  79. data/lib/sapphire/WebAbstractions/Controls/Button.rb +7 -7
  80. data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
  81. data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +4 -4
  82. data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
  83. data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
  84. data/lib/sapphire/WebAbstractions/Controls/List.rb +11 -13
  85. data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
  86. data/lib/sapphire/version.rb +1 -1
  87. metadata +17 -21
@@ -1,17 +1,17 @@
1
- module Sapphire
2
- module DSL
3
- class StartsWithComparison < Comparison
4
-
5
- def Compare(left, right)
6
- return @comparator.Compare((left.start_with? right), true) if @comparator != nil
7
- left.start_with? right
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 StartsWithComparison < Comparison
4
+
5
+ def Compare(left, right)
6
+ return @comparator.Compare((left.start_with? right), true) if @comparator != nil
7
+ left.start_with? right
8
+ end
9
+
10
+ def Text
11
+ return @comparator.Text if @comparator != nil
12
+ ""
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -1,17 +1,17 @@
1
- module Sapphire
2
- module DSL
3
- class VisibleComparison < Comparison
4
-
5
- def Compare(left, right)
6
- return @comparator.Compare(left.Visible, true) if @comparator != nil
7
- left.Visible
8
- end
9
-
10
- def Text
11
- return @comparator.Text + " to be visible" if @comparator != nil
12
- " to be visible"
13
- end
14
-
15
- end
16
- end
17
- end
1
+ module Sapphire
2
+ module DSL
3
+ class VisibleComparison < Comparison
4
+
5
+ def Compare(left, right)
6
+ return @comparator.Compare(left.Visible, true) if @comparator != nil
7
+ left.Visible
8
+ end
9
+
10
+ def Text
11
+ return @comparator.Text + " to be visible" if @comparator != nil
12
+ " to be visible"
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -1,13 +1,13 @@
1
- module Sapphire
2
- module DSL
3
- module Configuration
4
- def ConfiguredBrowser(url)
5
- @rootUrl = url
6
- ConfigurationBrowser
7
- end
8
-
9
- class ConfigurationBrowser
10
- end
11
- end
12
- end
1
+ module Sapphire
2
+ module DSL
3
+ module Configuration
4
+ def ConfiguredBrowser(url)
5
+ @rootUrl = url
6
+ ConfigurationBrowser
7
+ end
8
+
9
+ class ConfigurationBrowser
10
+ end
11
+ end
12
+ end
13
13
  end
@@ -1,11 +1,11 @@
1
- module Sapphire
2
- module DSL
3
- module Configuration
4
- def configured_user
5
- $user
6
- end
7
- class ConfiguredUser
8
- end
9
- end
10
- end
1
+ module Sapphire
2
+ module DSL
3
+ module Configuration
4
+ def configured_user
5
+ $user
6
+ end
7
+ class ConfiguredUser
8
+ end
9
+ end
10
+ end
11
11
  end
@@ -1,18 +1,18 @@
1
- module Sapphire
2
- module DSL
3
- module Configuration
4
- def Use(user)
5
- if(user == ConfiguredUser)
6
- if AppConfig.Current.nil?
7
- raise "No App Config defined!"
8
- end
9
- $user = AppConfig.new().User
10
- else
11
- $user = user.new
12
- end
13
- end
14
- end
15
- end
16
- end
17
-
18
-
1
+ module Sapphire
2
+ module DSL
3
+ module Configuration
4
+ def Use(user)
5
+ if(user == ConfiguredUser)
6
+ if AppConfig.Current.nil?
7
+ raise "No App Config defined!"
8
+ end
9
+ $user = AppConfig.new().User
10
+ else
11
+ $user = user.new
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+
@@ -1,10 +1,10 @@
1
- module Sapphire
2
- module DSL
3
- module Data
4
- def Find(query, &block)
5
- query.Execute block
6
- end
7
- end
8
- end
9
- end
10
-
1
+ module Sapphire
2
+ module DSL
3
+ module Data
4
+ def Find(query, &block)
5
+ query.Execute block
6
+ end
7
+ end
8
+ end
9
+ end
10
+
@@ -1,13 +1,13 @@
1
- module Sapphire
2
- module DSL
3
- module Data
4
- def GetPageField(key)
5
-
6
- return $page.Get(key) if $page.Contains key
7
-
8
- raise "Could not find control for: " + key + " for page " + $page.to_s
9
- end
10
- end
11
- end
12
- end
13
-
1
+ module Sapphire
2
+ module DSL
3
+ module Data
4
+ def GetPageField(key)
5
+
6
+ return $page.Get(key) if $page.Contains key
7
+
8
+ raise "Could not find control for: " + key + " for page " + $page.to_s
9
+ end
10
+ end
11
+ end
12
+ end
13
+
@@ -1,10 +1,10 @@
1
- module Sapphire
2
- module DSL
3
- module Data
4
- def Verify(instance)
5
- instance.Verify
6
- end
7
- end
8
- end
9
- end
10
-
1
+ module Sapphire
2
+ module DSL
3
+ module Data
4
+ def Verify(instance)
5
+ instance.Verify
6
+ end
7
+ end
8
+ end
9
+ end
10
+
@@ -4,9 +4,9 @@ module Sapphire
4
4
 
5
5
  attr_reader :control
6
6
 
7
- def initialize(left, right, control)
7
+ def initialize(actual, expected, control)
8
8
  @control = control
9
- super left, right
9
+ super actual, expected
10
10
  end
11
11
  end
12
12
  end
@@ -29,11 +29,11 @@ module Sapphire
29
29
 
30
30
  def Output()
31
31
 
32
- if(!Compare(@left, @right))
33
- self.Failed(@control)
34
- else
35
- self.Passed(@control)
36
- end
32
+ if(!Compare(@left, @right))
33
+ self.Failed(@control)
34
+ else
35
+ self.Passed(@control)
36
+ end
37
37
 
38
38
  end
39
39
 
@@ -1,21 +1,21 @@
1
- module Sapphire
2
- module DSL
3
- class FieldNotDefinedEvaluation
4
-
5
- attr_reader :field
6
-
7
- def initialize(field, page)
8
- @field = field
9
- @page = page
10
- end
11
-
12
- def Output()
13
- messages = []
14
-
15
- messages << "Cannot find control " + @field.to_s + " defined for page " + @page.to_s
16
-
17
- raise ExpectationException.new(messages)
18
- end
19
- end
20
- end
1
+ module Sapphire
2
+ module DSL
3
+ class FieldNotDefinedEvaluation
4
+
5
+ attr_reader :field
6
+
7
+ def initialize(field, page)
8
+ @field = field
9
+ @page = page
10
+ end
11
+
12
+ def Output()
13
+ messages = []
14
+
15
+ messages << "Cannot find control " + @field.to_s + " defined for page " + @page.to_s
16
+
17
+ raise ExpectationException.new(messages)
18
+ end
19
+ end
20
+ end
21
21
  end
@@ -1,23 +1,23 @@
1
- module Sapphire
2
- module DSL
3
- class FieldNotFoundEvaluation
4
-
5
- attr_reader :field
6
-
7
- def initialize(field, page, message)
8
- @field = field
9
- @page = page
10
- @message = message
11
- end
12
-
13
- def Output()
14
- messages = []
15
-
16
- messages << "Cannot find control matching " + @field.to_s + " for page " + @page.to_s
17
- messages << "Reason: " + @message
18
-
19
- raise ExpectationException.new(messages)
20
- end
21
- end
22
- end
1
+ module Sapphire
2
+ module DSL
3
+ class FieldNotFoundEvaluation
4
+
5
+ attr_reader :field
6
+
7
+ def initialize(field, page, message)
8
+ @field = field
9
+ @page = page
10
+ @message = message
11
+ end
12
+
13
+ def Output()
14
+ messages = []
15
+
16
+ messages << "Cannot find control matching " + @field.to_s + " for page " + @page.to_s
17
+ messages << "Reason: " + @message
18
+
19
+ raise ExpectationException.new(messages)
20
+ end
21
+ end
22
+ end
23
23
  end
@@ -1,10 +1,10 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Contain(item)
5
- Evaluator.new(item) do |item, comparator| item.Contain(item, comparator) end
6
- end
7
- end
8
- end
9
- end
10
-
1
+ module Sapphire
2
+ module DSL
3
+ module Browser
4
+ def Contain(item)
5
+ Evaluator.new(item) do |item, comparator| item.Contain(item, comparator) end
6
+ end
7
+ end
8
+ end
9
+ end
10
+
@@ -1,9 +1,9 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Count(item)
5
- Evaluator.new(item) do |item, comparator| item.Count(item, comparator) end
6
- end
7
- end
8
- end
1
+ module Sapphire
2
+ module DSL
3
+ module Browser
4
+ def Count(item)
5
+ Evaluator.new(item) do |item, comparator| item.Count(item, comparator) end
6
+ end
7
+ end
8
+ end
9
9
  end
@@ -1,10 +1,10 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Differ(value)
5
- Evaluator.new(value) do |value, comparator| value.Differ(comparator) end
6
- end
7
- end
8
- end
9
- end
10
-
1
+ module Sapphire
2
+ module DSL
3
+ module Browser
4
+ def Differ(value)
5
+ Evaluator.new(value) do |value, comparator| value.Differ(comparator) end
6
+ end
7
+ end
8
+ end
9
+ end
10
+
@@ -1,9 +1,9 @@
1
- module Sapphire
2
- module DSL
3
- def Exist(value)
4
- Evaluator.new(value) do |item, comparator| item.NotBeNil(item, comparator) end
5
- end
6
- end
7
- end
8
-
9
-
1
+ module Sapphire
2
+ module DSL
3
+ def Exist(value)
4
+ Evaluator.new(value) do |item, comparator| item.NotBeNil(item, comparator) end
5
+ end
6
+ end
7
+ end
8
+
9
+
@@ -1,10 +1,10 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def In(item)
5
- Evaluator.new(item) do |item, comparator| item.In(item, comparator) end
6
- end
7
- end
8
- end
9
- end
10
-
1
+ module Sapphire
2
+ module DSL
3
+ module Browser
4
+ def In(item)
5
+ Evaluator.new(item) do |item, comparator| item.In(item, comparator) end
6
+ end
7
+ end
8
+ end
9
+ end
10
+