sapphire 0.7.26 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/lib/sapphire.rb +51 -40
  2. data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +24 -68
  3. data/lib/sapphire/DSL.rb +18 -16
  4. data/lib/sapphire/DSL/Browser/Create.rb +10 -10
  5. data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +20 -20
  6. data/lib/sapphire/DSL/Browser/Fluff/By.rb +10 -10
  7. data/lib/sapphire/DSL/Browser/Fluff/To.rb +10 -10
  8. data/lib/sapphire/DSL/Browser/Fluff/With.rb +10 -10
  9. data/lib/sapphire/DSL/Browser/Nouns/Browser.rb +17 -17
  10. data/lib/sapphire/DSL/Browser/Nouns/Enter.rb +10 -10
  11. data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
  12. data/lib/sapphire/DSL/Browser/Verbs/Accept.rb +8 -8
  13. data/lib/sapphire/DSL/Browser/Verbs/Check.rb +10 -10
  14. data/lib/sapphire/DSL/Browser/Verbs/Clear.rb +8 -8
  15. data/lib/sapphire/DSL/Browser/Verbs/Click.rb +10 -10
  16. data/lib/sapphire/DSL/Browser/Verbs/Compare.rb +18 -18
  17. data/lib/sapphire/DSL/Browser/Verbs/Complete.rb +13 -13
  18. data/lib/sapphire/DSL/Browser/Verbs/Exists.rb +16 -16
  19. data/lib/sapphire/DSL/Browser/Verbs/Exit.rb +11 -11
  20. data/lib/sapphire/DSL/Browser/Verbs/MouseOver.rb +10 -10
  21. data/lib/sapphire/DSL/Browser/Verbs/Navigate.rb +10 -10
  22. data/lib/sapphire/DSL/Browser/Verbs/Press.rb +8 -8
  23. data/lib/sapphire/DSL/Browser/Verbs/Reload.rb +11 -11
  24. data/lib/sapphire/DSL/Browser/Verbs/Set.rb +10 -10
  25. data/lib/sapphire/DSL/Browser/Verbs/Uncheck.rb +10 -10
  26. data/lib/sapphire/DSL/Comparisons/CheckedComparison.rb +17 -17
  27. data/lib/sapphire/DSL/Comparisons/Comparison.rb +50 -50
  28. data/lib/sapphire/DSL/Comparisons/ContainsComparison.rb +17 -17
  29. data/lib/sapphire/DSL/Comparisons/DifferComparison.rb +17 -17
  30. data/lib/sapphire/DSL/Comparisons/EqualsComparison.rb +16 -16
  31. data/lib/sapphire/DSL/Comparisons/NotComparison.rb +20 -20
  32. data/lib/sapphire/DSL/Comparisons/SelectedComparison.rb +17 -17
  33. data/lib/sapphire/DSL/Comparisons/StartsWithComparison.rb +17 -17
  34. data/lib/sapphire/DSL/Comparisons/VisibleComparison.rb +17 -17
  35. data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
  36. data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
  37. data/lib/sapphire/DSL/Configuration/Use.rb +18 -18
  38. data/lib/sapphire/DSL/Data/Find.rb +10 -10
  39. data/lib/sapphire/DSL/Data/GetPageField.rb +13 -13
  40. data/lib/sapphire/DSL/Data/Verify.rb +10 -10
  41. data/lib/sapphire/DSL/Evaluations/ControlEvaluation.rb +13 -0
  42. data/lib/sapphire/DSL/Evaluations/Evaluation.rb +55 -45
  43. data/lib/sapphire/DSL/Evaluations/FieldNotDefinedEvaluation.rb +20 -20
  44. data/lib/sapphire/DSL/Evaluations/FieldNotFoundEvaluation.rb +22 -22
  45. data/lib/sapphire/DSL/Evaluators/Contain.rb +10 -10
  46. data/lib/sapphire/DSL/Evaluators/Count.rb +8 -8
  47. data/lib/sapphire/DSL/Evaluators/Differ.rb +10 -10
  48. data/lib/sapphire/DSL/Evaluators/Exist.rb +9 -9
  49. data/lib/sapphire/DSL/Evaluators/In.rb +10 -10
  50. data/lib/sapphire/DSL/Evaluators/Selected.rb +10 -10
  51. data/lib/sapphire/DSL/Evaluators/Show.rb +10 -10
  52. data/lib/sapphire/DSL/Evaluators/Transition.rb +10 -10
  53. data/lib/sapphire/DSL/Evaluators/Validate.rb +8 -8
  54. data/lib/sapphire/DSL/Events/Data.rb +12 -0
  55. data/lib/sapphire/DSL/Events/DataSegment.rb +18 -0
  56. data/lib/sapphire/DSL/Events/Event.rb +11 -3
  57. data/lib/sapphire/DSL/Events/Expect.rb +3 -11
  58. data/lib/sapphire/DSL/Events/Expectation.rb +14 -0
  59. data/lib/sapphire/DSL/Events/For.rb +11 -0
  60. data/lib/sapphire/DSL/Events/From.rb +9 -0
  61. data/lib/sapphire/DSL/Events/Where.rb +11 -0
  62. data/lib/sapphire/DSL/Profiles/Profile.rb +26 -0
  63. data/lib/sapphire/DSL/Profiles/Table.rb +9 -0
  64. data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
  65. data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
  66. data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
  67. data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
  68. data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
  69. data/lib/sapphire/Data.rb +1 -1
  70. data/lib/sapphire/DataAbstractions/Database.rb +57 -57
  71. data/lib/sapphire/DataAbstractions/Query.rb +20 -20
  72. data/lib/sapphire/Extensions/Class.rb +2 -2
  73. data/lib/sapphire/Extensions/Hash.rb +112 -112
  74. data/lib/sapphire/Extensions/Module.rb +11 -0
  75. data/lib/sapphire/Extensions/Numeric.rb +6 -6
  76. data/lib/sapphire/Extensions/Object.rb +4 -0
  77. data/lib/sapphire/Extensions/String.rb +30 -23
  78. data/lib/sapphire/Extensions/Symbol.rb +1 -1
  79. data/lib/sapphire/JobAbstractions/Job.rb +32 -32
  80. data/lib/sapphire/Observable.rb +87 -0
  81. data/lib/sapphire/Observers.rb +2 -0
  82. data/lib/sapphire/Observers/FailedControlHighlighter.rb +41 -0
  83. data/lib/sapphire/Observers/Highlighter.rb +40 -0
  84. data/lib/sapphire/Observers/Observer.rb +23 -0
  85. data/lib/sapphire/Observers/ObserverRepository.rb +37 -0
  86. data/lib/sapphire/Observers/PassedControlHighlighter.rb +42 -0
  87. data/lib/sapphire/Observers/VerboseObserver.rb +36 -0
  88. data/lib/sapphire/TeamCity.rb +10 -10
  89. data/lib/sapphire/Testing.rb +3 -3
  90. data/lib/sapphire/Testing/RakeTask.rb +108 -108
  91. data/lib/sapphire/Testing/ResultList.rb +18 -18
  92. data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
  93. data/lib/sapphire/Testing/TestResult.rb +21 -21
  94. data/lib/sapphire/Testing/TestRunnerAdapter.rb +85 -85
  95. data/lib/sapphire/UI/ProcessBuilder.rb +173 -173
  96. data/lib/sapphire/Virtualization.rb +7 -7
  97. data/lib/sapphire/Web.rb +2 -2
  98. data/lib/sapphire/WebAbstractions/Controls/AlertBox.rb +20 -20
  99. data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +43 -26
  100. data/lib/sapphire/WebAbstractions/Controls/Button.rb +7 -7
  101. data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +3 -3
  102. data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
  103. data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +6 -8
  104. data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
  105. data/lib/sapphire/WebAbstractions/Controls/Image.rb +19 -19
  106. data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
  107. data/lib/sapphire/WebAbstractions/Controls/List.rb +16 -16
  108. data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +2 -2
  109. data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
  110. data/lib/sapphire/version.rb +1 -1
  111. metadata +26 -8
@@ -14,13 +14,13 @@ module Sapphire
14
14
  def Selected
15
15
  radio = self.Find
16
16
  val = radio.attribute("selected")
17
- return Evaluation.new(val != nil, true)
17
+ return ControlEvaluation.new(val != nil, true, self)
18
18
  end
19
19
 
20
20
  def Visible
21
21
  radio = self.Find
22
22
  x = radio.attribute("disabled")
23
- Evaluation.new((x == "false"), true)
23
+ ControlEvaluation.new((x == "false"), true, self)
24
24
  end
25
25
 
26
26
  end
@@ -1,12 +1,12 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Title < Control
4
-
5
- def Text
6
- $driver.Browser().title
7
- end
8
-
9
- end
10
- end
11
- end
12
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Title < Control
4
+
5
+ def Text
6
+ $driver.Browser().title
7
+ end
8
+
9
+ end
10
+ end
11
+ end
12
+
@@ -1,3 +1,3 @@
1
1
  module Sapphire
2
- VERSION = "0.7.26"
2
+ VERSION = "0.8.0"
3
3
  end
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.7.26
4
+ version: 0.8.0
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: 2012-05-07 00:00:00.000000000Z
12
+ date: 2012-06-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &24466884 !ruby/object:Gem::Requirement
16
+ requirement: &21358128 !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: *24466884
24
+ version_requirements: *21358128
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &24466632 !ruby/object:Gem::Requirement
27
+ requirement: &21357876 !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: *24466632
35
+ version_requirements: *21357876
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &24466380 !ruby/object:Gem::Requirement
38
+ requirement: &21357624 !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: *24466380
46
+ version_requirements: *21357624
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email:
@@ -124,6 +124,7 @@ files:
124
124
  - lib/sapphire/DSL/Data/GetPageField.rb
125
125
  - lib/sapphire/DSL/Data/Verify.rb
126
126
  - lib/sapphire/DSL/Data/Write.rb
127
+ - lib/sapphire/DSL/Evaluations/ControlEvaluation.rb
127
128
  - lib/sapphire/DSL/Evaluations/Evaluation.rb
128
129
  - lib/sapphire/DSL/Evaluations/FieldNotDefinedEvaluation.rb
129
130
  - lib/sapphire/DSL/Evaluations/FieldNotFoundEvaluation.rb
@@ -141,8 +142,16 @@ files:
141
142
  - lib/sapphire/DSL/Evaluators/Transition.rb
142
143
  - lib/sapphire/DSL/Evaluators/Validate.rb
143
144
  - lib/sapphire/DSL/Events/Causes.rb
145
+ - lib/sapphire/DSL/Events/Data.rb
146
+ - lib/sapphire/DSL/Events/DataSegment.rb
144
147
  - lib/sapphire/DSL/Events/Event.rb
145
148
  - lib/sapphire/DSL/Events/Expect.rb
149
+ - lib/sapphire/DSL/Events/Expectation.rb
150
+ - lib/sapphire/DSL/Events/For.rb
151
+ - lib/sapphire/DSL/Events/From.rb
152
+ - lib/sapphire/DSL/Events/Where.rb
153
+ - lib/sapphire/DSL/Profiles/Profile.rb
154
+ - lib/sapphire/DSL/Profiles/Table.rb
146
155
  - lib/sapphire/DSL/Scenarios/and.rb
147
156
  - lib/sapphire/DSL/Scenarios/background.rb
148
157
  - lib/sapphire/DSL/Scenarios/Broken.rb
@@ -163,12 +172,21 @@ files:
163
172
  - lib/sapphire/DSL.rb
164
173
  - lib/sapphire/Extensions/Class.rb
165
174
  - lib/sapphire/Extensions/Hash.rb
175
+ - lib/sapphire/Extensions/Module.rb
166
176
  - lib/sapphire/Extensions/Numeric.rb
167
177
  - lib/sapphire/Extensions/Object.rb
168
178
  - lib/sapphire/Extensions/String.rb
169
179
  - lib/sapphire/Extensions/Symbol.rb
170
180
  - lib/sapphire/Extensions.rb
171
181
  - lib/sapphire/JobAbstractions/Job.rb
182
+ - lib/sapphire/Observable.rb
183
+ - lib/sapphire/Observers/FailedControlHighlighter.rb
184
+ - lib/sapphire/Observers/Highlighter.rb
185
+ - lib/sapphire/Observers/Observer.rb
186
+ - lib/sapphire/Observers/ObserverRepository.rb
187
+ - lib/sapphire/Observers/PassedControlHighlighter.rb
188
+ - lib/sapphire/Observers/VerboseObserver.rb
189
+ - lib/sapphire/Observers.rb
172
190
  - lib/sapphire/TeamCity/RubyMineReporter.rb
173
191
  - lib/sapphire/TeamCity/TeamCityReporter.rb
174
192
  - lib/sapphire/TeamCity.rb