sapphire 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/lib/sapphire.rb +30 -0
  2. data/lib/sapphire/DSL/Browser/Browser.rb +13 -0
  3. data/lib/sapphire/DSL/Browser/Check.rb +12 -0
  4. data/lib/sapphire/DSL/Browser/Clear.rb +15 -0
  5. data/lib/sapphire/DSL/Browser/Click.rb +12 -0
  6. data/lib/sapphire/DSL/Browser/Close.rb +12 -0
  7. data/lib/sapphire/DSL/Browser/Complete.rb +15 -0
  8. data/lib/sapphire/DSL/Browser/CurrentUrl.rb +11 -0
  9. data/lib/sapphire/DSL/Browser/Error.rb +12 -0
  10. data/lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb +45 -0
  11. data/lib/sapphire/DSL/Browser/Exists.rb +22 -0
  12. data/lib/sapphire/DSL/Browser/For.rb +10 -0
  13. data/lib/sapphire/DSL/Browser/Hide.rb +10 -0
  14. data/lib/sapphire/DSL/Browser/IsHidden.rb +28 -0
  15. data/lib/sapphire/DSL/Browser/IsVisible.rb +25 -0
  16. data/lib/sapphire/DSL/Browser/MouseOver.rb +12 -0
  17. data/lib/sapphire/DSL/Browser/Navigate.rb +11 -0
  18. data/lib/sapphire/DSL/Browser/Reload.rb +11 -0
  19. data/lib/sapphire/DSL/Browser/Set.rb +12 -0
  20. data/lib/sapphire/DSL/Browser/Should.rb +10 -0
  21. data/lib/sapphire/DSL/Browser/Show.rb +26 -0
  22. data/lib/sapphire/DSL/Browser/Start.rb +16 -0
  23. data/lib/sapphire/DSL/Browser/To.rb +10 -0
  24. data/lib/sapphire/DSL/Browser/Tracker.rb +15 -0
  25. data/lib/sapphire/DSL/Browser/Transition.rb +10 -0
  26. data/lib/sapphire/DSL/Browser/Uncheck.rb +12 -0
  27. data/lib/sapphire/DSL/Browser/With.rb +10 -0
  28. data/lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb +13 -0
  29. data/lib/sapphire/DSL/Configuration/ConfiguredUser.rb +11 -0
  30. data/lib/sapphire/DSL/Configuration/Use.rb +15 -0
  31. data/lib/sapphire/DSL/Data/Exist.rb +11 -0
  32. data/lib/sapphire/DSL/Data/Find.rb +10 -0
  33. data/lib/sapphire/DSL/Data/GetPageField.rb +17 -0
  34. data/lib/sapphire/DSL/Data/Underscore.rb +9 -0
  35. data/lib/sapphire/DSL/Data/Validate.rb +16 -0
  36. data/lib/sapphire/DSL/Data/Verify.rb +10 -0
  37. data/lib/sapphire/DSL/Scenarios/Is.rb +9 -0
  38. data/lib/sapphire/DSL/Scenarios/Pending.rb +29 -0
  39. data/lib/sapphire/DSL/Scenarios/and.rb +25 -0
  40. data/lib/sapphire/DSL/Scenarios/background.rb +23 -0
  41. data/lib/sapphire/DSL/Scenarios/dsl.rb +60 -0
  42. data/lib/sapphire/DSL/Scenarios/finally.rb +32 -0
  43. data/lib/sapphire/DSL/Scenarios/given.rb +57 -0
  44. data/lib/sapphire/DSL/Scenarios/runner.rb +30 -0
  45. data/lib/sapphire/DSL/Scenarios/scenario.rb +51 -0
  46. data/lib/sapphire/DSL/Scenarios/then.rb +34 -0
  47. data/lib/sapphire/DSL/Scenarios/when.rb +47 -0
  48. data/lib/sapphire/DataAbstractions/Database.rb +57 -0
  49. data/lib/sapphire/DataAbstractions/Query.rb +20 -0
  50. data/lib/sapphire/Testing/Executable.rb +30 -0
  51. data/lib/sapphire/Testing/RSpecRunner.rb +85 -0
  52. data/lib/sapphire/Testing/RakeTask.rb +109 -0
  53. data/lib/sapphire/Testing/ResultList.rb +19 -0
  54. data/lib/sapphire/Testing/ResultTree.rb +37 -0
  55. data/lib/sapphire/Testing/ScenarioResult.rb +31 -0
  56. data/lib/sapphire/Testing/TestResult.rb +24 -0
  57. data/lib/sapphire/Testing/TestRunnerAdapter.rb +62 -0
  58. data/lib/sapphire/WebAbstractions/Controls/Base/Control.rb +74 -0
  59. data/lib/sapphire/WebAbstractions/Controls/Base/Page.rb +47 -0
  60. data/lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb +74 -0
  61. data/lib/sapphire/WebAbstractions/Controls/Button.rb +9 -0
  62. data/lib/sapphire/WebAbstractions/Controls/CheckBox.rb +28 -0
  63. data/lib/sapphire/WebAbstractions/Controls/Chrome.rb +21 -0
  64. data/lib/sapphire/WebAbstractions/Controls/DropDown.rb +25 -0
  65. data/lib/sapphire/WebAbstractions/Controls/FireFox.rb +22 -0
  66. data/lib/sapphire/WebAbstractions/Controls/Hyperlink.rb +8 -0
  67. data/lib/sapphire/WebAbstractions/Controls/Image.rb +9 -0
  68. data/lib/sapphire/WebAbstractions/Controls/InternetExplorer.rb +21 -0
  69. data/lib/sapphire/WebAbstractions/Controls/Label.rb +8 -0
  70. data/lib/sapphire/WebAbstractions/Controls/RadioButton.rb +18 -0
  71. data/lib/sapphire/WebAbstractions/Controls/TextBox.rb +31 -0
  72. data/lib/sapphire/WebAbstractions/Controls/Title.rb +12 -0
  73. data/lib/sapphire/version.rb +3 -0
  74. metadata +152 -0
@@ -0,0 +1,21 @@
1
+ module Sapphire
2
+ module WebAbstractions
3
+ def InternetExplorer(url)
4
+ driver = InternetExplorerBrowser.new
5
+ driver
6
+ end
7
+
8
+ class InternetExplorerBrowser < DelegateClass(Selenium::WebDriver::IE::Bridge)
9
+ include WebBrowser
10
+
11
+ attr_reader :browser
12
+
13
+ def initialize
14
+ #@browser = Selenium::WebDriver.for :ie
15
+ super(@browser)
16
+ $browser = @browser
17
+ end
18
+ end
19
+ end
20
+ end
21
+
@@ -0,0 +1,8 @@
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Label < Control
4
+
5
+ end
6
+ end
7
+ end
8
+
@@ -0,0 +1,18 @@
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class RadioButton < Control
4
+
5
+ def Text
6
+ self.Find().text
7
+ end
8
+
9
+ def Check (value)
10
+
11
+ radio = self.Find
12
+ radio.click
13
+
14
+ end
15
+ end
16
+ end
17
+ end
18
+
@@ -0,0 +1,31 @@
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class TextBox < Control
4
+
5
+ def Text= (value)
6
+ text = self.Find
7
+ text.send_keys value
8
+ end
9
+
10
+ def Text
11
+ text = self.Find
12
+ text.text
13
+ end
14
+
15
+ def Set(value)
16
+ if(value == "")
17
+ self.Clear
18
+ else
19
+ text = self.Find
20
+ text.send_keys value
21
+ end
22
+ end
23
+
24
+ def Clear
25
+ text = self.Find
26
+ text.clear
27
+ end
28
+ end
29
+ end
30
+ end
31
+
@@ -0,0 +1,12 @@
1
+ module Sapphire
2
+ module WebAbstractions
3
+ class Title < Control
4
+
5
+ def Text
6
+ @browser.title
7
+ end
8
+
9
+ end
10
+ end
11
+ end
12
+
@@ -0,0 +1,3 @@
1
+ module Sapphire
2
+ VERSION = "0.0.2"
3
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sapphire
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Marcus Bratton
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-06-30 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: albacore
16
+ requirement: &9604584 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *9604584
25
+ - !ruby/object:Gem::Dependency
26
+ name: selenium-webdriver
27
+ requirement: &9604164 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *9604164
36
+ - !ruby/object:Gem::Dependency
37
+ name: activesupport
38
+ requirement: &9603792 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *9603792
47
+ description: An automated web acceptance test framework for non-technical resources
48
+ using selenium-wedriver.
49
+ email:
50
+ - marcus.bratton@gmail.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - lib/sapphire/DataAbstractions/Database.rb
56
+ - lib/sapphire/DataAbstractions/Query.rb
57
+ - lib/sapphire/DSL/Browser/Browser.rb
58
+ - lib/sapphire/DSL/Browser/Check.rb
59
+ - lib/sapphire/DSL/Browser/Clear.rb
60
+ - lib/sapphire/DSL/Browser/Click.rb
61
+ - lib/sapphire/DSL/Browser/Close.rb
62
+ - lib/sapphire/DSL/Browser/Complete.rb
63
+ - lib/sapphire/DSL/Browser/CurrentUrl.rb
64
+ - lib/sapphire/DSL/Browser/Error.rb
65
+ - lib/sapphire/DSL/Browser/ExecuteAgainstControl.rb
66
+ - lib/sapphire/DSL/Browser/Exists.rb
67
+ - lib/sapphire/DSL/Browser/For.rb
68
+ - lib/sapphire/DSL/Browser/Hide.rb
69
+ - lib/sapphire/DSL/Browser/IsHidden.rb
70
+ - lib/sapphire/DSL/Browser/IsVisible.rb
71
+ - lib/sapphire/DSL/Browser/MouseOver.rb
72
+ - lib/sapphire/DSL/Browser/Navigate.rb
73
+ - lib/sapphire/DSL/Browser/Reload.rb
74
+ - lib/sapphire/DSL/Browser/Set.rb
75
+ - lib/sapphire/DSL/Browser/Should.rb
76
+ - lib/sapphire/DSL/Browser/Show.rb
77
+ - lib/sapphire/DSL/Browser/Start.rb
78
+ - lib/sapphire/DSL/Browser/To.rb
79
+ - lib/sapphire/DSL/Browser/Tracker.rb
80
+ - lib/sapphire/DSL/Browser/Transition.rb
81
+ - lib/sapphire/DSL/Browser/Uncheck.rb
82
+ - lib/sapphire/DSL/Browser/With.rb
83
+ - lib/sapphire/DSL/Configuration/ConfiguredBrowser.rb
84
+ - lib/sapphire/DSL/Configuration/ConfiguredUser.rb
85
+ - lib/sapphire/DSL/Configuration/Use.rb
86
+ - lib/sapphire/DSL/Data/Exist.rb
87
+ - lib/sapphire/DSL/Data/Find.rb
88
+ - lib/sapphire/DSL/Data/GetPageField.rb
89
+ - lib/sapphire/DSL/Data/Underscore.rb
90
+ - lib/sapphire/DSL/Data/Validate.rb
91
+ - lib/sapphire/DSL/Data/Verify.rb
92
+ - lib/sapphire/DSL/Scenarios/and.rb
93
+ - lib/sapphire/DSL/Scenarios/background.rb
94
+ - lib/sapphire/DSL/Scenarios/dsl.rb
95
+ - lib/sapphire/DSL/Scenarios/finally.rb
96
+ - lib/sapphire/DSL/Scenarios/given.rb
97
+ - lib/sapphire/DSL/Scenarios/Is.rb
98
+ - lib/sapphire/DSL/Scenarios/Pending.rb
99
+ - lib/sapphire/DSL/Scenarios/runner.rb
100
+ - lib/sapphire/DSL/Scenarios/scenario.rb
101
+ - lib/sapphire/DSL/Scenarios/then.rb
102
+ - lib/sapphire/DSL/Scenarios/when.rb
103
+ - lib/sapphire/Testing/Executable.rb
104
+ - lib/sapphire/Testing/RakeTask.rb
105
+ - lib/sapphire/Testing/ResultList.rb
106
+ - lib/sapphire/Testing/ResultTree.rb
107
+ - lib/sapphire/Testing/RSpecRunner.rb
108
+ - lib/sapphire/Testing/ScenarioResult.rb
109
+ - lib/sapphire/Testing/TestResult.rb
110
+ - lib/sapphire/Testing/TestRunnerAdapter.rb
111
+ - lib/sapphire/version.rb
112
+ - lib/sapphire/WebAbstractions/Controls/Base/Control.rb
113
+ - lib/sapphire/WebAbstractions/Controls/Base/Page.rb
114
+ - lib/sapphire/WebAbstractions/Controls/Base/WebBrowser.rb
115
+ - lib/sapphire/WebAbstractions/Controls/Button.rb
116
+ - lib/sapphire/WebAbstractions/Controls/CheckBox.rb
117
+ - lib/sapphire/WebAbstractions/Controls/Chrome.rb
118
+ - lib/sapphire/WebAbstractions/Controls/DropDown.rb
119
+ - lib/sapphire/WebAbstractions/Controls/FireFox.rb
120
+ - lib/sapphire/WebAbstractions/Controls/Hyperlink.rb
121
+ - lib/sapphire/WebAbstractions/Controls/Image.rb
122
+ - lib/sapphire/WebAbstractions/Controls/InternetExplorer.rb
123
+ - lib/sapphire/WebAbstractions/Controls/Label.rb
124
+ - lib/sapphire/WebAbstractions/Controls/RadioButton.rb
125
+ - lib/sapphire/WebAbstractions/Controls/TextBox.rb
126
+ - lib/sapphire/WebAbstractions/Controls/Title.rb
127
+ - lib/sapphire.rb
128
+ homepage: http://github.com/MarcusTheBold/Sapphire/
129
+ licenses: []
130
+ post_install_message:
131
+ rdoc_options: []
132
+ require_paths:
133
+ - lib
134
+ required_ruby_version: !ruby/object:Gem::Requirement
135
+ none: false
136
+ requirements:
137
+ - - ! '>='
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ none: false
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ requirements: []
147
+ rubyforge_project:
148
+ rubygems_version: 1.8.5
149
+ signing_key:
150
+ specification_version: 3
151
+ summary: An automated web acceptance test framework for non-technical resources
152
+ test_files: []