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,7 +1,7 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Button < Control
4
- end
5
- end
6
- end
7
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Button < Control
4
+ end
5
+ end
6
+ end
7
+
@@ -1,12 +1,12 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Date < Control
4
-
5
- def Text
6
- control = self.Find
7
- return DateTime.strptime(control.text, "%m/%d/%Y %H:%M:%S %p").to_date
8
- end
9
-
10
- end
11
- end
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Date < Control
4
+
5
+ def Text
6
+ control = self.Find
7
+ return DateTime.strptime(control.text, "%m/%d/%Y %H:%M:%S %p").to_date
8
+ end
9
+
10
+ end
11
+ end
12
12
  end
@@ -26,16 +26,16 @@ module Sapphire
26
26
  selection.click
27
27
  end
28
28
 
29
- def Contain(value)
29
+ def Contain(expected_value)
30
30
  ddl = self.Find
31
31
  items = ddl.find_elements(:tag_name, "option")
32
32
  items.each do |item|
33
- if item.text == value
34
- return ControlEvaluation.new(item.text, value, self)
33
+ if item.text == expected_value
34
+ return ControlEvaluation.new(item.text, expected_value, self)
35
35
  end
36
36
  end
37
37
 
38
- return ControlEvaluation.new("Value not found in list", value, self)
38
+ return ControlEvaluation.new("Value not found in list", expected_value, self)
39
39
  end
40
40
 
41
41
  def Count(value)
@@ -1,8 +1,8 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Hyperlink < Control
4
-
5
- end
6
- end
7
- end
8
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Hyperlink < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
@@ -1,8 +1,8 @@
1
- module Sapphire
2
- module WebAbstractions
3
- class Label < Control
4
-
5
- end
6
- end
7
- end
8
-
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Label < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
@@ -43,27 +43,25 @@ module Sapphire
43
43
  return ControlEvaluation.new(values, alltext, self)
44
44
  end
45
45
 
46
- def Contain(value)
47
- x = self.FindAll
48
- x.each do |item|
49
- if item.Text.include? value
50
- return ContainsComparison.new(ControlEvaluation.new(value, item.Text, item))
46
+ def Contain(expected_text)
47
+ text = self.Text
48
+ text.each do |t|
49
+ if t.include? expected_text
50
+ return ContainsComparison.new(ControlEvaluation.new(t, expected_text, nil))
51
51
  end
52
52
  end
53
53
 
54
- return ControlEvaluation.new("Value not found in list", value, self)
54
+ return ControlEvaluation.new("Value not found in list", expected_text, self)
55
55
  end
56
56
 
57
57
  def Click
58
58
  wait = Selenium::WebDriver::Wait.new(:timeout => 20)
59
59
  begin
60
60
  clicked = wait.until { items = self.FindAll
61
- if items.empty? == false
62
- if items.first.Visible == true
63
- items.first.Click
64
- return true
65
- end
66
- end
61
+ if !items.empty? && items.first.Visible
62
+ items.first.Click
63
+ return true
64
+ end
67
65
  }
68
66
  return nil
69
67
  rescue
@@ -87,7 +85,7 @@ module Sapphire
87
85
  values = []
88
86
  x = self.FindAll
89
87
  x.each do |item|
90
- values << item.Text
88
+ values << item.control.text
91
89
  end
92
90
 
93
91
  return values
@@ -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.8.3"
2
+ VERSION = "0.8.4"
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.8.3
4
+ version: 0.8.4
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-07-11 00:00:00.000000000 Z
12
+ date: 2012-07-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &25588344 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,21 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
24
+ version_requirements: *25588344
25
+ - !ruby/object:Gem::Dependency
26
+ name: ffi
27
+ requirement: &25588044 !ruby/object:Gem::Requirement
25
28
  none: false
26
29
  requirements:
27
- - - ! '>='
30
+ - - =
28
31
  - !ruby/object:Gem::Version
29
- version: '0'
32
+ version: 1.0.9
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *25588044
30
36
  - !ruby/object:Gem::Dependency
31
37
  name: colorize
32
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &25587792 !ruby/object:Gem::Requirement
33
39
  none: false
34
40
  requirements:
35
41
  - - ! '>='
@@ -37,15 +43,10 @@ dependencies:
37
43
  version: '0'
38
44
  type: :runtime
39
45
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
+ version_requirements: *25587792
46
47
  - !ruby/object:Gem::Dependency
47
48
  name: Platform
48
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &25826892 !ruby/object:Gem::Requirement
49
50
  none: false
50
51
  requirements:
51
52
  - - ! '>='
@@ -53,12 +54,7 @@ dependencies:
53
54
  version: '0'
54
55
  type: :runtime
55
56
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
57
+ version_requirements: *25826892
62
58
  description: An automated web acceptance test framework for non-technical resources
63
59
  using selenium-wedriver.
64
60
  email:
@@ -268,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
264
  version: '0'
269
265
  requirements: []
270
266
  rubyforge_project:
271
- rubygems_version: 1.8.24
267
+ rubygems_version: 1.7.2
272
268
  signing_key:
273
269
  specification_version: 3
274
270
  summary: An automated web acceptance test framework for non-technical resources