sapphire 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb +190 -190
  2. data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +34 -45
  3. data/lib/sapphire/DSL/Browser/Extensions/Class.rb +29 -0
  4. data/lib/sapphire/DSL/Browser/Extensions/Hash.rb +11 -0
  5. data/lib/sapphire/DSL/Browser/Extensions/Numeric.rb +7 -0
  6. data/lib/sapphire/DSL/Browser/Extensions/Symbol.rb +37 -0
  7. data/lib/sapphire/DSL/Browser/{By.rb → Fluff/By.rb} +10 -10
  8. data/lib/sapphire/DSL/Browser/{To.rb → Fluff/To.rb} +10 -10
  9. data/lib/sapphire/DSL/Browser/{With.rb → Fluff/With.rb} +10 -10
  10. data/lib/sapphire/DSL/Browser/For.rb +10 -10
  11. data/lib/sapphire/DSL/Browser/{AlertBox.rb → Nouns/AlertBox.rb} +14 -14
  12. data/lib/sapphire/DSL/Browser/{Browser.rb → Nouns/Browser.rb} +17 -17
  13. data/lib/sapphire/DSL/Browser/{Day.rb → Nouns/Day.rb} +24 -24
  14. data/lib/sapphire/DSL/Browser/{Keys → Nouns}/Enter.rb +10 -10
  15. data/lib/sapphire/DSL/Browser/{Month.rb → Nouns/Month.rb} +24 -24
  16. data/lib/sapphire/DSL/Browser/{Popup.rb → Nouns/Popup.rb} +0 -0
  17. data/lib/sapphire/DSL/Browser/Should.rb +42 -42
  18. data/lib/sapphire/DSL/Browser/Tracker.rb +15 -15
  19. data/lib/sapphire/DSL/Browser/{Accept.rb → Verbs/Accept.rb} +9 -9
  20. data/lib/sapphire/DSL/Browser/Verbs/Check.rb +11 -0
  21. data/lib/sapphire/DSL/Browser/{IsHidden.rb → Verbs/Clear.rb} +9 -10
  22. data/lib/sapphire/DSL/Browser/Verbs/Click.rb +11 -0
  23. data/lib/sapphire/DSL/Browser/{Close.rb → Verbs/Close.rb} +11 -12
  24. data/lib/sapphire/DSL/Browser/{Compare.rb → Verbs/Compare.rb} +18 -18
  25. data/lib/sapphire/DSL/Browser/Verbs/Complete.rb +10 -0
  26. data/lib/sapphire/DSL/Browser/{Differ.rb → Verbs/Differ.rb} +18 -18
  27. data/lib/sapphire/DSL/Browser/{Disable.rb → Verbs/Disable.rb} +0 -0
  28. data/lib/sapphire/DSL/Browser/{Error.rb → Verbs/Error.rb} +25 -26
  29. data/lib/sapphire/DSL/Browser/{Exists.rb → Verbs/Exists.rb} +22 -22
  30. data/lib/sapphire/DSL/Browser/{Hide.rb → Verbs/Hide.rb} +25 -26
  31. data/lib/sapphire/DSL/Browser/Verbs/MouseOver.rb +11 -0
  32. data/lib/sapphire/DSL/Browser/{Navigate.rb → Verbs/Navigate.rb} +11 -11
  33. data/lib/sapphire/DSL/Browser/{Press.rb → Verbs/Press.rb} +8 -10
  34. data/lib/sapphire/DSL/Browser/{Reload.rb → Verbs/Reload.rb} +11 -11
  35. data/lib/sapphire/DSL/Browser/Verbs/Set.rb +10 -0
  36. data/lib/sapphire/DSL/Browser/{Show.rb → Verbs/Show.rb} +25 -26
  37. data/lib/sapphire/DSL/Browser/{Start.rb → Verbs/Start.rb} +16 -16
  38. data/lib/sapphire/DSL/Browser/{Switch.rb → Verbs/Switch.rb} +0 -0
  39. data/lib/sapphire/DSL/Browser/{Transition.rb → Verbs/Transition.rb} +25 -26
  40. data/lib/sapphire/DSL/Browser/Verbs/Uncheck.rb +11 -0
  41. data/lib/sapphire/DSL/Browser/{Virtually.rb → Verbs/Virtually.rb} +0 -0
  42. data/lib/sapphire/DSL/Browser/{Wait.rb → Verbs/Wait.rb} +2 -2
  43. data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +12 -12
  44. data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +10 -10
  45. data/lib/sapphire/DSL/Configuration/Use.rb +15 -15
  46. data/lib/sapphire/DSL/Data/Exist.rb +27 -27
  47. data/lib/sapphire/DSL/Data/Find.rb +10 -10
  48. data/lib/sapphire/DSL/Data/GetPageField.rb +17 -17
  49. data/lib/sapphire/DSL/Data/Underscore.rb +8 -8
  50. data/lib/sapphire/DSL/Data/Validate.rb +26 -26
  51. data/lib/sapphire/DSL/Data/Verify.rb +10 -10
  52. data/lib/sapphire/DSL/Scenarios/Is.rb +9 -9
  53. data/lib/sapphire/DSL/Scenarios/Pending.rb +28 -28
  54. data/lib/sapphire/DSL/Scenarios/and.rb +25 -25
  55. data/lib/sapphire/DSL/Scenarios/background.rb +33 -33
  56. data/lib/sapphire/DSL/Scenarios/dsl.rb +59 -59
  57. data/lib/sapphire/DSL/Scenarios/finally.rb +33 -33
  58. data/lib/sapphire/DSL/Scenarios/given.rb +57 -57
  59. data/lib/sapphire/DSL/Scenarios/runner.rb +40 -40
  60. data/lib/sapphire/DSL/Scenarios/scenario.rb +53 -53
  61. data/lib/sapphire/DSL/Scenarios/then.rb +34 -34
  62. data/lib/sapphire/DSL/Scenarios/when.rb +47 -47
  63. data/lib/sapphire/DSL.rb +10 -6
  64. data/lib/sapphire/Data.rb +1 -1
  65. data/lib/sapphire/DataAbstractions/Database.rb +57 -57
  66. data/lib/sapphire/DataAbstractions/Query.rb +19 -19
  67. data/lib/sapphire/JobAbstractions/Job.rb +32 -32
  68. data/lib/sapphire/Strategies/ClassStrategy.rb +1 -1
  69. data/lib/sapphire/Strategies/Strategy.rb +1 -2
  70. data/lib/sapphire/Strategies.rb +1 -1
  71. data/lib/sapphire/TeamCity.rb +8 -8
  72. data/lib/sapphire/Testing/Executable.rb +30 -30
  73. data/lib/sapphire/Testing/RakeTask.rb +108 -108
  74. data/lib/sapphire/Testing/ResultList.rb +18 -18
  75. data/lib/sapphire/Testing/ResultTree.rb +44 -44
  76. data/lib/sapphire/Testing/ScenarioResult.rb +36 -36
  77. data/lib/sapphire/Testing/TestResult.rb +21 -21
  78. data/lib/sapphire/Testing/TestRunnerAdapter.rb +69 -69
  79. data/lib/sapphire/Testing.rb +2 -2
  80. data/lib/sapphire/Virtualization.rb +7 -7
  81. data/lib/sapphire/Web.rb +2 -2
  82. data/lib/sapphire/WebAbstractions/Browsers/Chrome.rb +21 -21
  83. data/lib/sapphire/WebAbstractions/Browsers/FireFox.rb +22 -22
  84. data/lib/sapphire/WebAbstractions/Browsers/InternetExplorer.rb +21 -21
  85. data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +58 -59
  86. data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +61 -62
  87. data/lib/sapphire/WebAbstractions/Controls/Button.rb +7 -9
  88. data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +28 -28
  89. data/lib/sapphire/WebAbstractions/Controls/Date.rb +11 -11
  90. data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +26 -26
  91. data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -8
  92. data/lib/sapphire/WebAbstractions/Controls/Image.rb +9 -9
  93. data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -8
  94. data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +18 -18
  95. data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +31 -31
  96. data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -12
  97. data/lib/sapphire/version.rb +3 -3
  98. data/lib/sapphire.rb +38 -38
  99. metadata +46 -45
  100. data/lib/sapphire/DSL/Browser/Check.rb +0 -12
  101. data/lib/sapphire/DSL/Browser/Clear.rb +0 -13
  102. data/lib/sapphire/DSL/Browser/Click.rb +0 -12
  103. data/lib/sapphire/DSL/Browser/Complete.rb +0 -15
  104. data/lib/sapphire/DSL/Browser/CurrentUrl.rb +0 -11
  105. data/lib/sapphire/DSL/Browser/IsVisible.rb +0 -33
  106. data/lib/sapphire/DSL/Browser/MouseOver.rb +0 -12
  107. data/lib/sapphire/DSL/Browser/Set.rb +0 -18
  108. data/lib/sapphire/DSL/Browser/Uncheck.rb +0 -12
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.5.3
4
+ version: 0.5.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: 2011-11-08 00:00:00.000000000 Z
12
+ date: 2011-11-15 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: selenium-webdriver
16
- requirement: &20481660 !ruby/object:Gem::Requirement
16
+ requirement: &10127556 !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: *20481660
24
+ version_requirements: *10127556
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: colorize
27
- requirement: &20481384 !ruby/object:Gem::Requirement
27
+ requirement: &10127304 !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: *20481384
35
+ version_requirements: *10127304
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: Platform
38
- requirement: &20481120 !ruby/object:Gem::Requirement
38
+ requirement: &10127052 !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: *20481120
46
+ version_requirements: *10127052
47
47
  description: An automated web acceptance test framework for non-technical resources
48
48
  using selenium-wedriver.
49
49
  email:
@@ -64,47 +64,48 @@ files:
64
64
  - lib/sapphire/DataAbstractions/Database.rb
65
65
  - lib/sapphire/DataAbstractions/NonQuery.rb
66
66
  - lib/sapphire/DataAbstractions/Query.rb
67
- - lib/sapphire/DSL/Browser/Accept.rb
68
- - lib/sapphire/DSL/Browser/AlertBox.rb
69
- - lib/sapphire/DSL/Browser/Browser.rb
70
- - lib/sapphire/DSL/Browser/By.rb
71
- - lib/sapphire/DSL/Browser/Check.rb
72
- - lib/sapphire/DSL/Browser/Clear.rb
73
- - lib/sapphire/DSL/Browser/Click.rb
74
- - lib/sapphire/DSL/Browser/Close.rb
75
- - lib/sapphire/DSL/Browser/Compare.rb
76
- - lib/sapphire/DSL/Browser/Complete.rb
77
- - lib/sapphire/DSL/Browser/CurrentUrl.rb
78
- - lib/sapphire/DSL/Browser/Day.rb
79
- - lib/sapphire/DSL/Browser/Differ.rb
80
- - lib/sapphire/DSL/Browser/Disable.rb
81
- - lib/sapphire/DSL/Browser/Error.rb
82
67
  - lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb
83
- - lib/sapphire/DSL/Browser/Exists.rb
68
+ - lib/sapphire/DSL/Browser/Extensions/Class.rb
69
+ - lib/sapphire/DSL/Browser/Extensions/Hash.rb
70
+ - lib/sapphire/DSL/Browser/Extensions/Numeric.rb
71
+ - lib/sapphire/DSL/Browser/Extensions/Symbol.rb
72
+ - lib/sapphire/DSL/Browser/Fluff/By.rb
73
+ - lib/sapphire/DSL/Browser/Fluff/To.rb
74
+ - lib/sapphire/DSL/Browser/Fluff/With.rb
84
75
  - lib/sapphire/DSL/Browser/For.rb
85
- - lib/sapphire/DSL/Browser/Hide.rb
86
- - lib/sapphire/DSL/Browser/IsHidden.rb
87
- - lib/sapphire/DSL/Browser/IsVisible.rb
88
- - lib/sapphire/DSL/Browser/Keys/Enter.rb
89
- - lib/sapphire/DSL/Browser/Month.rb
90
- - lib/sapphire/DSL/Browser/MouseOver.rb
91
- - lib/sapphire/DSL/Browser/Navigate.rb
92
76
  - lib/sapphire/DSL/Browser/Not.rb
93
- - lib/sapphire/DSL/Browser/Popup.rb
94
- - lib/sapphire/DSL/Browser/Press.rb
95
- - lib/sapphire/DSL/Browser/Reload.rb
96
- - lib/sapphire/DSL/Browser/Set.rb
77
+ - lib/sapphire/DSL/Browser/Nouns/AlertBox.rb
78
+ - lib/sapphire/DSL/Browser/Nouns/Browser.rb
79
+ - lib/sapphire/DSL/Browser/Nouns/Day.rb
80
+ - lib/sapphire/DSL/Browser/Nouns/Enter.rb
81
+ - lib/sapphire/DSL/Browser/Nouns/Month.rb
82
+ - lib/sapphire/DSL/Browser/Nouns/Popup.rb
97
83
  - lib/sapphire/DSL/Browser/Should.rb
98
- - lib/sapphire/DSL/Browser/Show.rb
99
- - lib/sapphire/DSL/Browser/Start.rb
100
- - lib/sapphire/DSL/Browser/Switch.rb
101
- - lib/sapphire/DSL/Browser/To.rb
102
84
  - lib/sapphire/DSL/Browser/Tracker.rb
103
- - lib/sapphire/DSL/Browser/Transition.rb
104
- - lib/sapphire/DSL/Browser/Uncheck.rb
105
- - lib/sapphire/DSL/Browser/Virtually.rb
106
- - lib/sapphire/DSL/Browser/Wait.rb
107
- - lib/sapphire/DSL/Browser/With.rb
85
+ - lib/sapphire/DSL/Browser/Verbs/Accept.rb
86
+ - lib/sapphire/DSL/Browser/Verbs/Check.rb
87
+ - lib/sapphire/DSL/Browser/Verbs/Clear.rb
88
+ - lib/sapphire/DSL/Browser/Verbs/Click.rb
89
+ - lib/sapphire/DSL/Browser/Verbs/Close.rb
90
+ - lib/sapphire/DSL/Browser/Verbs/Compare.rb
91
+ - lib/sapphire/DSL/Browser/Verbs/Complete.rb
92
+ - lib/sapphire/DSL/Browser/Verbs/Differ.rb
93
+ - lib/sapphire/DSL/Browser/Verbs/Disable.rb
94
+ - lib/sapphire/DSL/Browser/Verbs/Error.rb
95
+ - lib/sapphire/DSL/Browser/Verbs/Exists.rb
96
+ - lib/sapphire/DSL/Browser/Verbs/Hide.rb
97
+ - lib/sapphire/DSL/Browser/Verbs/MouseOver.rb
98
+ - lib/sapphire/DSL/Browser/Verbs/Navigate.rb
99
+ - lib/sapphire/DSL/Browser/Verbs/Press.rb
100
+ - lib/sapphire/DSL/Browser/Verbs/Reload.rb
101
+ - lib/sapphire/DSL/Browser/Verbs/Set.rb
102
+ - lib/sapphire/DSL/Browser/Verbs/Show.rb
103
+ - lib/sapphire/DSL/Browser/Verbs/Start.rb
104
+ - lib/sapphire/DSL/Browser/Verbs/Switch.rb
105
+ - lib/sapphire/DSL/Browser/Verbs/Transition.rb
106
+ - lib/sapphire/DSL/Browser/Verbs/Uncheck.rb
107
+ - lib/sapphire/DSL/Browser/Verbs/Virtually.rb
108
+ - lib/sapphire/DSL/Browser/Verbs/Wait.rb
108
109
  - lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb
109
110
  - lib/sapphire/DSL/Configuration/ConfiguredUser.rb
110
111
  - lib/sapphire/DSL/Configuration/Use.rb
@@ -199,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
200
  version: '0'
200
201
  requirements: []
201
202
  rubyforge_project:
202
- rubygems_version: 1.8.11
203
+ rubygems_version: 1.8.5
203
204
  signing_key:
204
205
  specification_version: 3
205
206
  summary: An automated web acceptance test framework for non-technical resources
@@ -1,12 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Check(*args)
5
- ExecuteAgainstControl(args) do |control, arg|
6
- control.Check true
7
- end
8
- end
9
- end
10
- end
11
- end
12
-
@@ -1,13 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Clear(item)
5
- if(item.is_a? Class)
6
- x = item.new @browser
7
- x.Clear
8
- return
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -1,12 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Click(*args)
5
- ExecuteAgainstControl(args) do |control, arg|
6
- control.Click
7
- end
8
- end
9
- end
10
- end
11
- end
12
-
@@ -1,15 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Complete(page)
5
- if(page.is_a? Class)
6
- x = page.new(@browser)
7
- else
8
- x = page
9
- end
10
- @page = x.Complete
11
- end
12
- end
13
- end
14
- end
15
-
@@ -1,11 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def CurrentUrl(value)
5
- url = @browser.CurrentUrl
6
- url == value
7
- end
8
- end
9
- end
10
- end
11
-
@@ -1,33 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def IsVisible(args)
5
- @page.fields.each do |field|
6
- field.keys.each do |field_key|
7
- if(field_key == args)
8
- begin
9
- x = field[field_key].Find
10
- if(x)
11
- begin
12
- wait = Selenium::WebDriver::Wait.new(:timeout => 30)
13
- result = wait.until { y = x.displayed?
14
- y unless y == false
15
- }
16
- return result
17
- rescue
18
- return false
19
- end
20
- end
21
- rescue
22
- return false
23
- end
24
- end
25
- end
26
- end
27
-
28
- raise "cannot find control matching " + args.to_s + " for page " + @page.to_s
29
- end
30
- end
31
- end
32
- end
33
-
@@ -1,12 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def MouseOver(*args)
5
- ExecuteAgainstControl(args) do |control, arg|
6
- control.MouseOver
7
- end
8
- end
9
- end
10
- end
11
- end
12
-
@@ -1,18 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Set(hash)
5
- if(hash.keys.first == AlertBox)
6
- text = hash[item.keys.first]
7
- klass = hash.keys.first.new
8
- klass.Set text
9
- else
10
- ExecuteHashAgainstControl(hash, @page) do |control, arg|
11
- control.Set arg
12
- end
13
- end
14
- end
15
- end
16
- end
17
- end
18
-
@@ -1,12 +0,0 @@
1
- module Sapphire
2
- module DSL
3
- module Browser
4
- def Uncheck(*args)
5
- ExecuteAgainstControl(args) do |control, arg|
6
- control.Check false
7
- end
8
- end
9
- end
10
- end
11
- end
12
-