browserstack-webdriver 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGES +791 -0
  3. data/README.md +31 -0
  4. data/build.desc +334 -0
  5. data/lib/selenium-client.rb +2 -0
  6. data/lib/selenium-webdriver.rb +1 -0
  7. data/lib/selenium/client.rb +37 -0
  8. data/lib/selenium/client/base.rb +132 -0
  9. data/lib/selenium/client/driver.rb +10 -0
  10. data/lib/selenium/client/errors.rb +9 -0
  11. data/lib/selenium/client/extensions.rb +118 -0
  12. data/lib/selenium/client/idiomatic.rb +488 -0
  13. data/lib/selenium/client/javascript_expression_builder.rb +116 -0
  14. data/lib/selenium/client/javascript_frameworks/jquery.rb +13 -0
  15. data/lib/selenium/client/javascript_frameworks/prototype.rb +13 -0
  16. data/lib/selenium/client/legacy_driver.rb +1720 -0
  17. data/lib/selenium/client/protocol.rb +104 -0
  18. data/lib/selenium/client/selenium_helper.rb +34 -0
  19. data/lib/selenium/rake/server_task.rb +157 -0
  20. data/lib/selenium/server.rb +248 -0
  21. data/lib/selenium/webdriver.rb +71 -0
  22. data/lib/selenium/webdriver/android.rb +9 -0
  23. data/lib/selenium/webdriver/android/bridge.rb +47 -0
  24. data/lib/selenium/webdriver/chrome.rb +26 -0
  25. data/lib/selenium/webdriver/chrome/bridge.rb +120 -0
  26. data/lib/selenium/webdriver/chrome/profile.rb +90 -0
  27. data/lib/selenium/webdriver/chrome/service.rb +75 -0
  28. data/lib/selenium/webdriver/common.rb +44 -0
  29. data/lib/selenium/webdriver/common/action_builder.rb +352 -0
  30. data/lib/selenium/webdriver/common/alert.rb +30 -0
  31. data/lib/selenium/webdriver/common/bridge_helper.rb +67 -0
  32. data/lib/selenium/webdriver/common/core_ext/base64.rb +9 -0
  33. data/lib/selenium/webdriver/common/core_ext/dir.rb +42 -0
  34. data/lib/selenium/webdriver/common/core_ext/string.rb +5 -0
  35. data/lib/selenium/webdriver/common/driver.rb +301 -0
  36. data/lib/selenium/webdriver/common/driver_extensions/has_browser_connection.rb +17 -0
  37. data/lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb +39 -0
  38. data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +25 -0
  39. data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +13 -0
  40. data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +22 -0
  41. data/lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb +19 -0
  42. data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +22 -0
  43. data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +45 -0
  44. data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +43 -0
  45. data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +46 -0
  46. data/lib/selenium/webdriver/common/element.rb +293 -0
  47. data/lib/selenium/webdriver/common/error.rb +207 -0
  48. data/lib/selenium/webdriver/common/file_reaper.rb +47 -0
  49. data/lib/selenium/webdriver/common/html5/local_storage.rb +42 -0
  50. data/lib/selenium/webdriver/common/html5/location.rb +0 -0
  51. data/lib/selenium/webdriver/common/html5/session_storage.rb +44 -0
  52. data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +42 -0
  53. data/lib/selenium/webdriver/common/json_helper.rb +34 -0
  54. data/lib/selenium/webdriver/common/keyboard.rb +55 -0
  55. data/lib/selenium/webdriver/common/keys.rb +109 -0
  56. data/lib/selenium/webdriver/common/log_entry.rb +29 -0
  57. data/lib/selenium/webdriver/common/logs.rb +23 -0
  58. data/lib/selenium/webdriver/common/mouse.rb +72 -0
  59. data/lib/selenium/webdriver/common/navigation.rb +43 -0
  60. data/lib/selenium/webdriver/common/options.rb +136 -0
  61. data/lib/selenium/webdriver/common/platform.rb +218 -0
  62. data/lib/selenium/webdriver/common/port_prober.rb +42 -0
  63. data/lib/selenium/webdriver/common/profile_helper.rb +67 -0
  64. data/lib/selenium/webdriver/common/proxy.rb +149 -0
  65. data/lib/selenium/webdriver/common/search_context.rb +92 -0
  66. data/lib/selenium/webdriver/common/socket_poller.rb +105 -0
  67. data/lib/selenium/webdriver/common/target_locator.rb +81 -0
  68. data/lib/selenium/webdriver/common/timeouts.rb +38 -0
  69. data/lib/selenium/webdriver/common/touch_action_builder.rb +64 -0
  70. data/lib/selenium/webdriver/common/touch_screen.rb +105 -0
  71. data/lib/selenium/webdriver/common/wait.rb +63 -0
  72. data/lib/selenium/webdriver/common/window.rb +104 -0
  73. data/lib/selenium/webdriver/common/zipper.rb +82 -0
  74. data/lib/selenium/webdriver/firefox.rb +37 -0
  75. data/lib/selenium/webdriver/firefox/binary.rb +158 -0
  76. data/lib/selenium/webdriver/firefox/bridge.rb +70 -0
  77. data/lib/selenium/webdriver/firefox/extension.rb +52 -0
  78. data/lib/selenium/webdriver/firefox/launcher.rb +106 -0
  79. data/lib/selenium/webdriver/firefox/profile.rb +263 -0
  80. data/lib/selenium/webdriver/firefox/profiles_ini.rb +62 -0
  81. data/lib/selenium/webdriver/firefox/socket_lock.rb +61 -0
  82. data/lib/selenium/webdriver/firefox/util.rb +29 -0
  83. data/lib/selenium/webdriver/ie.rb +19 -0
  84. data/lib/selenium/webdriver/ie/bridge.rb +68 -0
  85. data/lib/selenium/webdriver/ie/server.rb +86 -0
  86. data/lib/selenium/webdriver/iphone.rb +9 -0
  87. data/lib/selenium/webdriver/iphone/bridge.rb +45 -0
  88. data/lib/selenium/webdriver/opera.rb +24 -0
  89. data/lib/selenium/webdriver/opera/bridge.rb +112 -0
  90. data/lib/selenium/webdriver/opera/service.rb +49 -0
  91. data/lib/selenium/webdriver/phantomjs.rb +22 -0
  92. data/lib/selenium/webdriver/phantomjs/bridge.rb +59 -0
  93. data/lib/selenium/webdriver/phantomjs/service.rb +90 -0
  94. data/lib/selenium/webdriver/remote.rb +22 -0
  95. data/lib/selenium/webdriver/remote/bridge.rb +644 -0
  96. data/lib/selenium/webdriver/remote/capabilities.rb +267 -0
  97. data/lib/selenium/webdriver/remote/commands.rb +193 -0
  98. data/lib/selenium/webdriver/remote/http/common.rb +74 -0
  99. data/lib/selenium/webdriver/remote/http/curb.rb +79 -0
  100. data/lib/selenium/webdriver/remote/http/default.rb +139 -0
  101. data/lib/selenium/webdriver/remote/http/persistent.rb +38 -0
  102. data/lib/selenium/webdriver/remote/response.rb +97 -0
  103. data/lib/selenium/webdriver/remote/server_error.rb +17 -0
  104. data/lib/selenium/webdriver/safari.rb +46 -0
  105. data/lib/selenium/webdriver/safari/bridge.rb +110 -0
  106. data/lib/selenium/webdriver/safari/browser.rb +20 -0
  107. data/lib/selenium/webdriver/safari/extension.rb +120 -0
  108. data/lib/selenium/webdriver/safari/server.rb +145 -0
  109. data/lib/selenium/webdriver/support.rb +5 -0
  110. data/lib/selenium/webdriver/support/abstract_event_listener.rb +28 -0
  111. data/lib/selenium/webdriver/support/block_event_listener.rb +17 -0
  112. data/lib/selenium/webdriver/support/color.rb +110 -0
  113. data/lib/selenium/webdriver/support/event_firing_bridge.rb +112 -0
  114. data/lib/selenium/webdriver/support/select.rb +293 -0
  115. data/ruby.iml +13 -0
  116. data/spec/integration/selenium/client/api/backward_compatible_api_spec.rb +22 -0
  117. data/spec/integration/selenium/client/api/browser_xpath_library_spec.rb +17 -0
  118. data/spec/integration/selenium/client/api/click_spec.rb +39 -0
  119. data/spec/integration/selenium/client/api/cookie_spec.rb +39 -0
  120. data/spec/integration/selenium/client/api/element_spec.rb +14 -0
  121. data/spec/integration/selenium/client/api/highlight_located_element_spec.rb +19 -0
  122. data/spec/integration/selenium/client/api/retrieve_last_remote_control_logs_spec.rb +33 -0
  123. data/spec/integration/selenium/client/api/screenshot_spec.rb +31 -0
  124. data/spec/integration/selenium/client/api/select_window_spec.rb +46 -0
  125. data/spec/integration/selenium/client/api/start_stop_spec.rb +9 -0
  126. data/spec/integration/selenium/client/api/wait_for_ajax_spec.rb +27 -0
  127. data/spec/integration/selenium/client/api/wait_for_element_spec.rb +56 -0
  128. data/spec/integration/selenium/client/api/wait_for_field_value_spec.rb +52 -0
  129. data/spec/integration/selenium/client/api/wait_for_text_spec.rb +98 -0
  130. data/spec/integration/selenium/client/api/webdriver_backed_spec.rb +21 -0
  131. data/spec/integration/selenium/client/sample-app/public/jquery-1.3.2.js +4376 -0
  132. data/spec/integration/selenium/client/sample-app/public/jquery.html +55 -0
  133. data/spec/integration/selenium/client/sample-app/public/prototype-1.6.0.3.js +4320 -0
  134. data/spec/integration/selenium/client/sample-app/public/prototype.html +59 -0
  135. data/spec/integration/selenium/client/sample-app/sample_app.rb +32 -0
  136. data/spec/integration/selenium/client/spec_helper.rb +139 -0
  137. data/spec/integration/selenium/webdriver/app_cache_spec.rb +47 -0
  138. data/spec/integration/selenium/webdriver/browser_connection_spec.rb +20 -0
  139. data/spec/integration/selenium/webdriver/chrome/driver_spec.rb +28 -0
  140. data/spec/integration/selenium/webdriver/chrome/profile_spec.rb +63 -0
  141. data/spec/integration/selenium/webdriver/driver_spec.rb +266 -0
  142. data/spec/integration/selenium/webdriver/element_spec.rb +191 -0
  143. data/spec/integration/selenium/webdriver/error_spec.rb +30 -0
  144. data/spec/integration/selenium/webdriver/firefox/driver_spec.rb +21 -0
  145. data/spec/integration/selenium/webdriver/firefox/profile_spec.rb +141 -0
  146. data/spec/integration/selenium/webdriver/keyboard_spec.rb +57 -0
  147. data/spec/integration/selenium/webdriver/location_spec.rb +29 -0
  148. data/spec/integration/selenium/webdriver/mouse_spec.rb +57 -0
  149. data/spec/integration/selenium/webdriver/navigation_spec.rb +46 -0
  150. data/spec/integration/selenium/webdriver/opera/driver_spec.rb +47 -0
  151. data/spec/integration/selenium/webdriver/options_spec.rb +77 -0
  152. data/spec/integration/selenium/webdriver/remote/driver_spec.rb +19 -0
  153. data/spec/integration/selenium/webdriver/remote/element_spec.rb +26 -0
  154. data/spec/integration/selenium/webdriver/spec_helper.rb +36 -0
  155. data/spec/integration/selenium/webdriver/spec_support.rb +12 -0
  156. data/spec/integration/selenium/webdriver/spec_support/guards.rb +110 -0
  157. data/spec/integration/selenium/webdriver/spec_support/helpers.rb +51 -0
  158. data/spec/integration/selenium/webdriver/spec_support/rack_server.rb +123 -0
  159. data/spec/integration/selenium/webdriver/spec_support/test_environment.rb +239 -0
  160. data/spec/integration/selenium/webdriver/sql_database_spec.rb +59 -0
  161. data/spec/integration/selenium/webdriver/storage_spec.rb +96 -0
  162. data/spec/integration/selenium/webdriver/target_locator_spec.rb +186 -0
  163. data/spec/integration/selenium/webdriver/timeout_spec.rb +69 -0
  164. data/spec/integration/selenium/webdriver/touch_spec.rb +176 -0
  165. data/spec/integration/selenium/webdriver/window_spec.rb +70 -0
  166. data/spec/integration/selenium/webdriver/zipper_spec.rb +66 -0
  167. data/spec/unit/selenium/client/base_spec.rb +239 -0
  168. data/spec/unit/selenium/client/extensions_spec.rb +174 -0
  169. data/spec/unit/selenium/client/idiomatic_spec.rb +500 -0
  170. data/spec/unit/selenium/client/javascript_expression_builder_spec.rb +79 -0
  171. data/spec/unit/selenium/client/javascript_frameworks/jquery_spec.rb +10 -0
  172. data/spec/unit/selenium/client/javascript_frameworks/prototype_spec.rb +10 -0
  173. data/spec/unit/selenium/client/protocol_spec.rb +124 -0
  174. data/spec/unit/selenium/client/selenium_helper_spec.rb +56 -0
  175. data/spec/unit/selenium/client/spec_helper.rb +24 -0
  176. data/spec/unit/selenium/rake/task_spec.rb +79 -0
  177. data/spec/unit/selenium/server_spec.rb +150 -0
  178. data/spec/unit/selenium/webdriver/action_builder_spec.rb +97 -0
  179. data/spec/unit/selenium/webdriver/android/bridge_spec.rb +43 -0
  180. data/spec/unit/selenium/webdriver/chrome/bridge_spec.rb +137 -0
  181. data/spec/unit/selenium/webdriver/chrome/profile_spec.rb +57 -0
  182. data/spec/unit/selenium/webdriver/chrome/service_spec.rb +44 -0
  183. data/spec/unit/selenium/webdriver/error_spec.rb +41 -0
  184. data/spec/unit/selenium/webdriver/firefox/bridge_spec.rb +47 -0
  185. data/spec/unit/selenium/webdriver/ie/bridge_spec.rb +91 -0
  186. data/spec/unit/selenium/webdriver/iphone/bridge_spec.rb +42 -0
  187. data/spec/unit/selenium/webdriver/log_entry_spec.rb +11 -0
  188. data/spec/unit/selenium/webdriver/opera/bridge_spec.rb +44 -0
  189. data/spec/unit/selenium/webdriver/phantomjs/bridge_spec.rb +55 -0
  190. data/spec/unit/selenium/webdriver/proxy_spec.rb +106 -0
  191. data/spec/unit/selenium/webdriver/remote/bridge_spec.rb +16 -0
  192. data/spec/unit/selenium/webdriver/remote/capabilities_spec.rb +115 -0
  193. data/spec/unit/selenium/webdriver/remote/http/common_spec.rb +24 -0
  194. data/spec/unit/selenium/webdriver/remote/http/default_spec.rb +124 -0
  195. data/spec/unit/selenium/webdriver/search_context_spec.rb +61 -0
  196. data/spec/unit/selenium/webdriver/socket_poller_spec.rb +68 -0
  197. data/spec/unit/selenium/webdriver/spec_helper.rb +27 -0
  198. data/spec/unit/selenium/webdriver/support/color_spec.rb +119 -0
  199. data/spec/unit/selenium/webdriver/support/event_firing_spec.rb +111 -0
  200. data/spec/unit/selenium/webdriver/support/select_spec.rb +290 -0
  201. data/spec/unit/selenium/webdriver/wait_spec.rb +49 -0
  202. metadata +370 -0
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # selenium-webdriver
2
+
3
+ This gem provides Ruby bindings for WebDriver and has been tested to work on MRI (1.9.2 through 2.1), JRuby and Rubinius.
4
+
5
+ ## Install
6
+
7
+ gem install selenium-webdriver
8
+
9
+ ## Links
10
+
11
+ * http://rubygems.org/gems/selenium-webdriver
12
+ * http://selenium.googlecode.com/git/docs/api/rb/index.html
13
+ * http://code.google.com/p/selenium/wiki/RubyBindings
14
+ * http://code.google.com/p/selenium/issues/list
15
+
16
+ ## License
17
+
18
+ Copyright 2009-2013 Software Freedom Conservancy
19
+
20
+ Licensed under the Apache License, Version 2.0 (the "License");
21
+ you may not use this file except in compliance with the License.
22
+ You may obtain a copy of the License at
23
+
24
+ http://www.apache.org/licenses/LICENSE-2.0
25
+
26
+ Unless required by applicable law or agreed to in writing, software
27
+ distributed under the License is distributed on an "AS IS" BASIS,
28
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ See the License for the specific language governing permissions and
30
+ limitations under the License.
31
+
data/build.desc ADDED
@@ -0,0 +1,334 @@
1
+ rubygem(
2
+ version = "2.38.0.dev",
3
+ name = "selenium-webdriver",
4
+ dir = "build/rb",
5
+ deps = [
6
+ "//rb:android",
7
+ "//rb:chrome",
8
+ "//rb:common",
9
+ "//rb:support",
10
+ "//rb:firefox",
11
+ "//rb:ie",
12
+ "//rb:iphone",
13
+ "//rb:opera",
14
+ "//rb:phantomjs",
15
+ "//rb:remote",
16
+ "//rb:rc-client",
17
+ "//rb:safari"
18
+ ],
19
+ gemdeps = [
20
+ { "multi_json" : "~> 1.0" },
21
+ { "rubyzip" : "~> 1.0.0" },
22
+ { "childprocess" : ">= 0.2.5" },
23
+ { "websocket" : "~> 1.0.4" }
24
+ ],
25
+ devdeps = [
26
+ { "rspec" : "~> 2.0" },
27
+ { "rack" : "~> 1.0" },
28
+ { "ci_reporter" : "~> 1.6.2" },
29
+ { "webmock" : "~> 1.7.5" }
30
+ ],
31
+ summary = "The next generation developer focused tool for automated testing of webapps",
32
+ description = "WebDriver is a tool for writing automated tests of websites. It aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application.",
33
+ author = ["Jari Bakken"],
34
+ email = "jari.bakken@gmail.com",
35
+ homepage = "http://selenium.googlecode.com",
36
+ license = "Apache",
37
+ files = [
38
+ "lib/**/*",
39
+ "CHANGES",
40
+ "README.md",
41
+ "COPYING"
42
+ ],
43
+ required_ruby_version = ">= 1.9.2"
44
+ )
45
+
46
+ rubydocs(
47
+ files = [
48
+ "rb/lib/**/*.rb",
49
+ "CHANGES"
50
+ ],
51
+ readme = "rb/README.md",
52
+ output_dir = "docs/api/rb"
53
+ )
54
+
55
+ ruby_library(name = "common",
56
+ srcs = [
57
+ "lib/selenium/webdriver/common/**/*.rb",
58
+ "lib/selenium/webdriver/common.rb",
59
+ "lib/selenium/webdriver.rb",
60
+ "lib/selenium/server.rb",
61
+ "lib/selenium/rake/server_task.rb",
62
+ "lib/selenium-webdriver.rb",
63
+ "CHANGES",
64
+ "README.md"
65
+ ],
66
+ resources = [
67
+ { "../COPYING" : "rb/COPYING" }
68
+ ]
69
+ )
70
+
71
+ ruby_library(name = "support",
72
+ srcs = [
73
+ "lib/selenium/webdriver/support/**/*.rb",
74
+ "lib/selenium/webdriver/support.rb"
75
+ ]
76
+ )
77
+
78
+ ruby_library(name = "android",
79
+ srcs = [
80
+ "lib/selenium/webdriver/android/**/*.rb",
81
+ "lib/selenium/webdriver/android.rb"
82
+ ],
83
+ deps = [
84
+ ":common",
85
+ ":remote"
86
+ ]
87
+ )
88
+
89
+ ruby_test(name = "android",
90
+ srcs = [
91
+ "spec/integration/selenium/webdriver/*_spec.rb",
92
+ "spec/integration/selenium/webdriver/android/**/*_spec.rb"
93
+ ],
94
+ include = ["rb/spec/integration", "build/rb/lib"],
95
+ deps = [ ":android" ]
96
+ )
97
+
98
+ ruby_library(name = "chrome",
99
+ srcs = [
100
+ "lib/selenium/webdriver/chrome/**/*.rb",
101
+ "lib/selenium/webdriver/chrome.rb"
102
+ ],
103
+ deps = [
104
+ ":common",
105
+ ":remote"
106
+ ]
107
+ )
108
+
109
+ ruby_test(name = "chrome",
110
+ srcs = [
111
+ "spec/integration/selenium/webdriver/*_spec.rb",
112
+ "spec/integration/selenium/webdriver/chrome/**/*_spec.rb"
113
+ ],
114
+ include = ["rb/spec/integration", "build/rb/lib"],
115
+ deps = [ ":chrome" ]
116
+ )
117
+
118
+ ruby_library(name = "firefox",
119
+ srcs = [
120
+ "lib/selenium/webdriver/firefox/**/*.rb",
121
+ "lib/selenium/webdriver/firefox.rb"
122
+ ],
123
+ resources = [
124
+ { "//javascript/firefox-driver:webdriver" : "rb/lib/selenium/webdriver/firefox/extension/webdriver.xpi"},
125
+ { "//javascript/firefox-driver:webdriver_prefs" : "rb/lib/selenium/webdriver/firefox/extension/prefs.json" },
126
+ { "//cpp:noblur" : "rb/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so" },
127
+ { "//cpp:noblur64" : "rb/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so" }
128
+ ],
129
+ deps = [ ":remote" ]
130
+ )
131
+
132
+ ruby_test(name = "firefox",
133
+ srcs = [
134
+ "spec/integration/selenium/webdriver/*_spec.rb",
135
+ "spec/integration/selenium/webdriver/firefox/**/*_spec.rb"
136
+ ],
137
+ include = ["rb/spec/integration", "build/rb/lib"],
138
+ deps = [":firefox"]
139
+ )
140
+
141
+ ruby_library(name = "ie",
142
+ srcs = [
143
+ "lib/selenium/webdriver/ie/**/*.rb",
144
+ "lib/selenium/webdriver/ie.rb"
145
+ ],
146
+ deps = [
147
+ ":common",
148
+ ":remote"
149
+ ]
150
+ )
151
+
152
+ ruby_test(name = "ie",
153
+ srcs = [
154
+ "spec/integration/selenium/webdriver/*_spec.rb",
155
+ "spec/integration/selenium/webdriver/ie/**/*_spec.rb"
156
+ ],
157
+ include = ["rb/spec/integration", "build/rb/lib"],
158
+ deps = [ ":ie" ]
159
+ )
160
+
161
+ ruby_library(name = "iphone",
162
+ srcs = [
163
+ "lib/selenium/webdriver/iphone/**/*.rb",
164
+ "lib/selenium/webdriver/iphone.rb"
165
+ ],
166
+ deps = [
167
+ ":common",
168
+ ":remote"
169
+ ]
170
+ )
171
+
172
+ ruby_test(name = "iphone",
173
+ srcs = [
174
+ "spec/integration/selenium/webdriver/*_spec.rb",
175
+ "spec/integration/selenium/webdriver/iphone/**/*_spec.rb"
176
+ ],
177
+ include = ["rb/spec/integration", "build/rb/lib"],
178
+ deps = [ ":iphone" ]
179
+ )
180
+
181
+ ruby_library(name = "opera",
182
+ srcs = [
183
+ "lib/selenium/webdriver/opera/**/*.rb",
184
+ "lib/selenium/webdriver/opera.rb"
185
+ ],
186
+ deps = [
187
+ ":common",
188
+ ":remote"
189
+ ]
190
+ )
191
+
192
+ ruby_test(name = "opera",
193
+ srcs = [
194
+ "spec/integration/selenium/webdriver/*_spec.rb",
195
+ "spec/integration/selenium/webdriver/opera/**/*_spec.rb"
196
+ ],
197
+ include = ["rb/spec/integration", "build/rb/lib"],
198
+ deps = [
199
+ "//java/server/test/org/openqa/selenium:server-with-tests:uber",
200
+ ":opera"
201
+ ]
202
+ )
203
+
204
+ ruby_library(name = "phantomjs",
205
+ srcs = [
206
+ "lib/selenium/webdriver/phantomjs/**/*.rb",
207
+ "lib/selenium/webdriver/phantomjs.rb"
208
+ ],
209
+ deps = [
210
+ ":common"
211
+ ]
212
+ )
213
+
214
+ ruby_test(name = "phantomjs",
215
+ srcs = [
216
+ "spec/integration/selenium/webdriver/*_spec.rb",
217
+ "spec/integration/selenium/webdriver/phantomjs/**/*_spec.rb"
218
+ ],
219
+ include = ["rb/spec/integration", "build/rb/lib"],
220
+ deps = [
221
+ ":remote",
222
+ ":phantomjs"
223
+ ]
224
+ )
225
+ ruby_library(name = "remote",
226
+ srcs = [
227
+ "lib/selenium/webdriver/remote/**/*.rb",
228
+ "lib/selenium/webdriver/remote.rb"
229
+ ],
230
+ deps = [
231
+ ":common"
232
+ ]
233
+ )
234
+
235
+ ruby_test(name = "remote",
236
+ srcs = [
237
+ "spec/integration/selenium/webdriver/*_spec.rb",
238
+ "spec/integration/selenium/webdriver/remote/**/*_spec.rb"
239
+ ],
240
+ include = ["rb/spec/integration", "build/rb/lib"],
241
+ deps = [
242
+ "//java/server/test/org/openqa/selenium:server-with-tests:uber",
243
+ ":remote"
244
+ ]
245
+ )
246
+
247
+ ruby_library(name = "safari",
248
+ srcs = [
249
+ "lib/selenium/webdriver/safari/**/*.rb",
250
+ "lib/selenium/webdriver/safari.rb"
251
+ ],
252
+ deps = [
253
+ ":common",
254
+ ":remote",
255
+ ],
256
+ resources = [
257
+ { "//javascript/safari-driver/prebuilt:SafariDriver": "rb/lib/selenium/webdriver/safari/resources/SafariDriver.safariextz"},
258
+ { "//javascript/safari-driver:client": "rb/lib/selenium/webdriver/safari/resources/client.js"}
259
+ ]
260
+ )
261
+
262
+ ruby_test(name = "safari",
263
+ srcs = [
264
+ "spec/integration/selenium/webdriver/*_spec.rb",
265
+ "spec/integration/selenium/webdriver/safari/**/*_spec.rb"
266
+ ],
267
+ include = ["rb/spec/integration", "build/rb/lib"],
268
+ deps = [
269
+ ":safari"
270
+ ]
271
+ )
272
+
273
+ ruby_library(name = "rc-client",
274
+ srcs = [
275
+ "lib/selenium/client/**/*.rb",
276
+ "lib/selenium/client.rb",
277
+ "lib/selenium-client.rb",
278
+ "lib/selenium/rspec/**/*.rb",
279
+ ],
280
+ deps = [
281
+ ":common"
282
+ ]
283
+ )
284
+
285
+ ruby_test(name = "unit",
286
+ srcs = [
287
+ "spec/unit/selenium/webdriver/**/*_spec.rb",
288
+ "spec/unit/selenium/rake/*_spec.rb",
289
+ "spec/unit/selenium/*_spec.rb",
290
+ ],
291
+ include = ["rb/spec/unit", "build/rb/lib"],
292
+ deps = [
293
+ ":android",
294
+ ":chrome",
295
+ ":common",
296
+ ":firefox",
297
+ ":ie",
298
+ ":iphone",
299
+ ":opera",
300
+ ":remote",
301
+ ":phantomjs",
302
+ ":support",
303
+ ]
304
+ )
305
+
306
+ ruby_test(name = "rc-client-unit",
307
+ srcs = [
308
+ "spec/unit/selenium/client/**/*_spec.rb"
309
+ ],
310
+ include = [
311
+ "build/rb/lib",
312
+ "rb/spec/unit"
313
+ ],
314
+ deps = [
315
+ ":rc-client"
316
+ ]
317
+ )
318
+
319
+ ruby_test(name = "rc-client-integration",
320
+ srcs = [
321
+ "spec/integration/selenium/client/api/*_spec.rb",
322
+ "spec/integration/selenium/client/reporting/*_spec.rb",
323
+ "spec/integration/selenium/client/smoke/*_spec.rb"
324
+ ],
325
+ include = [
326
+ "build/rb/lib",
327
+ "rb/spec/integration"
328
+ ],
329
+ deps = [
330
+ "//java/server/test/org/openqa/selenium:server-with-tests:uber",
331
+ ":rc-client",
332
+ ":remote"
333
+ ]
334
+ )
@@ -0,0 +1,2 @@
1
+ require 'selenium/client'
2
+
@@ -0,0 +1 @@
1
+ require 'selenium/webdriver'
@@ -0,0 +1,37 @@
1
+ require 'net/http'
2
+ require 'uri'
3
+ require 'cgi'
4
+ require 'digest/md5'
5
+ require 'base64'
6
+ require 'fileutils'
7
+ require 'tmpdir'
8
+
9
+ require 'selenium/client/errors'
10
+ require 'selenium/client/protocol'
11
+ require 'selenium/client/legacy_driver'
12
+ require 'selenium/client/javascript_expression_builder'
13
+ require 'selenium/client/javascript_frameworks/prototype'
14
+ require 'selenium/client/javascript_frameworks/jquery'
15
+ require 'selenium/client/extensions'
16
+ require 'selenium/client/idiomatic'
17
+ require 'selenium/client/base'
18
+ require 'selenium/client/driver'
19
+ require 'selenium/client/selenium_helper'
20
+ require 'selenium/server'
21
+ require 'selenium/rake/server_task'
22
+
23
+ module Selenium
24
+ DEPRECATED_CONSTANTS = {
25
+ :SeleniumDriver => Selenium::Client::Driver,
26
+ :CommandError => Selenium::Client::CommandError
27
+ }
28
+
29
+ def self.const_missing(name)
30
+ if replacement = DEPRECATED_CONSTANTS[name.to_sym]
31
+ warn "the Selenium::#{name} constant has been deprecated, please use #{replacement} instead"
32
+ replacement
33
+ else
34
+ super
35
+ end
36
+ end
37
+ end # Selenium
@@ -0,0 +1,132 @@
1
+ module Selenium
2
+ module Client
3
+
4
+ # Driver constructor and session management commands
5
+ module Base
6
+ include Selenium::Client::Protocol
7
+ include Selenium::Client::GeneratedDriver
8
+ include Selenium::Client::Extensions
9
+ include Selenium::Client::Idiomatic
10
+
11
+ attr_reader :host, :port, :browser_string, :browser_url,
12
+ :default_timeout_in_seconds,
13
+ :default_javascript_framework,
14
+ :highlight_located_element_by_default
15
+
16
+ #
17
+ # Create a new client driver
18
+ #
19
+ # Example:
20
+ #
21
+ # Selenium::Client::Driver.new \
22
+ # :host => "localhost",
23
+ # :port => 4444,
24
+ # :browser => "*firefox",
25
+ # :timeout_in_seconds => 10,
26
+ # :url => "http://localhost:3000",
27
+ #
28
+ # You can also set the default javascript framework used for :wait_for
29
+ # AJAX and effects semantics (:prototype is the default value):
30
+ #
31
+ # Selenium::Client::Driver.new \
32
+ # :host => "localhost",
33
+ # :port => 4444,
34
+ # :browser => "*firefox",
35
+ # :timeout_in_seconds => 10,
36
+ # :url => "http://localhost:3000",
37
+ # :javascript_framework => :jquery
38
+ #
39
+ # You can also enables automatic highlighting of located elements
40
+ # by passing the highlight_located_element option, e.g.
41
+ #
42
+ # Selenium::Client::Driver.new \
43
+ # :host => "localhost",
44
+ # :port => 4444,
45
+ # :browser => "*firefox",
46
+ # :highlight_located_element => true
47
+ #
48
+ def initialize(*args)
49
+ if args[0].kind_of?(Hash)
50
+ options = args[0]
51
+ @host = options[:host]
52
+ @port = options[:port].to_i
53
+ @browser_string = options[:browser]
54
+ @browser_url = options[:url]
55
+ @default_timeout_in_seconds = (options[:timeout_in_seconds] || 300).to_i
56
+ @default_javascript_framework = options[:javascript_framework] || :prototype
57
+ @highlight_located_element_by_default = options[:highlight_located_element] || false
58
+ else
59
+ @host = args[0]
60
+ @port = args[1].to_i
61
+ @browser_string = args[2]
62
+ @browser_url = args[3]
63
+ @default_timeout_in_seconds = (args[4] || 300).to_i
64
+ @default_javascript_framework = :prototype
65
+ @highlight_located_element_by_default = false
66
+ end
67
+
68
+ @extension_js = ""
69
+ @session_id = nil
70
+ end
71
+
72
+ def session_started?
73
+ not @session_id.nil?
74
+ end
75
+
76
+ # Starts a new browser session (launching a new browser matching
77
+ # configuration provided at driver creation time).
78
+ #
79
+ # Browser session specific option can also be provided. e.g.
80
+ #
81
+ # driver.start_new_browser_session(:captureNetworkTraffic => true)
82
+ #
83
+ def start_new_browser_session(options={})
84
+ start_args = [@browser_string, @browser_url, @extension_js]
85
+
86
+ if driver = options.delete(:driver)
87
+ expected_browser_string = "*webdriver"
88
+ unless @browser_string == expected_browser_string
89
+ raise ArgumentError, "can't use :driver unless the browser string is #{expected_browser_string.inspect} (got #{@browser_string.inspect})"
90
+ end
91
+
92
+ sid = driver.capabilities['webdriver.remote.sessionid']
93
+ sid or raise ArgumentError, "This driver can not be wrapped in the RC API."
94
+
95
+ start_args << "webdriver.remote.sessionid=#{sid}"
96
+ end
97
+
98
+ start_args << options.collect {|key,value| "#{key.to_s}=#{value.to_s}"}.sort.join(";")
99
+
100
+ @session_id = string_command "getNewBrowserSession", start_args
101
+ # Consistent timeout on the remote control and driver side.
102
+ # Intuitive and this is what you want 90% of the time
103
+ self.remote_control_timeout_in_seconds = @default_timeout_in_seconds
104
+ self.highlight_located_element = true if highlight_located_element_by_default
105
+ end
106
+
107
+ def close_current_browser_session
108
+ remote_control_command "testComplete" if @session_id
109
+ @session_id = nil
110
+ end
111
+
112
+ def start(opts = {})
113
+ start_new_browser_session opts
114
+ end
115
+
116
+ def stop
117
+ close_current_browser_session
118
+ end
119
+
120
+ def chrome_backend?
121
+ ["*chrome", "*firefox", "*firefox2", "*firefox3"].include?(@browser_string)
122
+ end
123
+
124
+ def javascript_extension=(new_javascript_extension)
125
+ @extension_js = new_javascript_extension
126
+ end
127
+ alias :set_extension_js :javascript_extension=
128
+
129
+ end
130
+
131
+ end
132
+ end