browserstack-webdriver 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGES +791 -0
- data/README.md +31 -0
- data/build.desc +334 -0
- data/lib/selenium-client.rb +2 -0
- data/lib/selenium-webdriver.rb +1 -0
- data/lib/selenium/client.rb +37 -0
- data/lib/selenium/client/base.rb +132 -0
- data/lib/selenium/client/driver.rb +10 -0
- data/lib/selenium/client/errors.rb +9 -0
- data/lib/selenium/client/extensions.rb +118 -0
- data/lib/selenium/client/idiomatic.rb +488 -0
- data/lib/selenium/client/javascript_expression_builder.rb +116 -0
- data/lib/selenium/client/javascript_frameworks/jquery.rb +13 -0
- data/lib/selenium/client/javascript_frameworks/prototype.rb +13 -0
- data/lib/selenium/client/legacy_driver.rb +1720 -0
- data/lib/selenium/client/protocol.rb +104 -0
- data/lib/selenium/client/selenium_helper.rb +34 -0
- data/lib/selenium/rake/server_task.rb +157 -0
- data/lib/selenium/server.rb +248 -0
- data/lib/selenium/webdriver.rb +71 -0
- data/lib/selenium/webdriver/android.rb +9 -0
- data/lib/selenium/webdriver/android/bridge.rb +47 -0
- data/lib/selenium/webdriver/chrome.rb +26 -0
- data/lib/selenium/webdriver/chrome/bridge.rb +120 -0
- data/lib/selenium/webdriver/chrome/profile.rb +90 -0
- data/lib/selenium/webdriver/chrome/service.rb +75 -0
- data/lib/selenium/webdriver/common.rb +44 -0
- data/lib/selenium/webdriver/common/action_builder.rb +352 -0
- data/lib/selenium/webdriver/common/alert.rb +30 -0
- data/lib/selenium/webdriver/common/bridge_helper.rb +67 -0
- data/lib/selenium/webdriver/common/core_ext/base64.rb +9 -0
- data/lib/selenium/webdriver/common/core_ext/dir.rb +42 -0
- data/lib/selenium/webdriver/common/core_ext/string.rb +5 -0
- data/lib/selenium/webdriver/common/driver.rb +301 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_browser_connection.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb +39 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +25 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +13 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +22 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb +19 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +22 -0
- data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +45 -0
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +43 -0
- data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +46 -0
- data/lib/selenium/webdriver/common/element.rb +293 -0
- data/lib/selenium/webdriver/common/error.rb +207 -0
- data/lib/selenium/webdriver/common/file_reaper.rb +47 -0
- data/lib/selenium/webdriver/common/html5/local_storage.rb +42 -0
- data/lib/selenium/webdriver/common/html5/location.rb +0 -0
- data/lib/selenium/webdriver/common/html5/session_storage.rb +44 -0
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +42 -0
- data/lib/selenium/webdriver/common/json_helper.rb +34 -0
- data/lib/selenium/webdriver/common/keyboard.rb +55 -0
- data/lib/selenium/webdriver/common/keys.rb +109 -0
- data/lib/selenium/webdriver/common/log_entry.rb +29 -0
- data/lib/selenium/webdriver/common/logs.rb +23 -0
- data/lib/selenium/webdriver/common/mouse.rb +72 -0
- data/lib/selenium/webdriver/common/navigation.rb +43 -0
- data/lib/selenium/webdriver/common/options.rb +136 -0
- data/lib/selenium/webdriver/common/platform.rb +218 -0
- data/lib/selenium/webdriver/common/port_prober.rb +42 -0
- data/lib/selenium/webdriver/common/profile_helper.rb +67 -0
- data/lib/selenium/webdriver/common/proxy.rb +149 -0
- data/lib/selenium/webdriver/common/search_context.rb +92 -0
- data/lib/selenium/webdriver/common/socket_poller.rb +105 -0
- data/lib/selenium/webdriver/common/target_locator.rb +81 -0
- data/lib/selenium/webdriver/common/timeouts.rb +38 -0
- data/lib/selenium/webdriver/common/touch_action_builder.rb +64 -0
- data/lib/selenium/webdriver/common/touch_screen.rb +105 -0
- data/lib/selenium/webdriver/common/wait.rb +63 -0
- data/lib/selenium/webdriver/common/window.rb +104 -0
- data/lib/selenium/webdriver/common/zipper.rb +82 -0
- data/lib/selenium/webdriver/firefox.rb +37 -0
- data/lib/selenium/webdriver/firefox/binary.rb +158 -0
- data/lib/selenium/webdriver/firefox/bridge.rb +70 -0
- data/lib/selenium/webdriver/firefox/extension.rb +52 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +106 -0
- data/lib/selenium/webdriver/firefox/profile.rb +263 -0
- data/lib/selenium/webdriver/firefox/profiles_ini.rb +62 -0
- data/lib/selenium/webdriver/firefox/socket_lock.rb +61 -0
- data/lib/selenium/webdriver/firefox/util.rb +29 -0
- data/lib/selenium/webdriver/ie.rb +19 -0
- data/lib/selenium/webdriver/ie/bridge.rb +68 -0
- data/lib/selenium/webdriver/ie/server.rb +86 -0
- data/lib/selenium/webdriver/iphone.rb +9 -0
- data/lib/selenium/webdriver/iphone/bridge.rb +45 -0
- data/lib/selenium/webdriver/opera.rb +24 -0
- data/lib/selenium/webdriver/opera/bridge.rb +112 -0
- data/lib/selenium/webdriver/opera/service.rb +49 -0
- data/lib/selenium/webdriver/phantomjs.rb +22 -0
- data/lib/selenium/webdriver/phantomjs/bridge.rb +59 -0
- data/lib/selenium/webdriver/phantomjs/service.rb +90 -0
- data/lib/selenium/webdriver/remote.rb +22 -0
- data/lib/selenium/webdriver/remote/bridge.rb +644 -0
- data/lib/selenium/webdriver/remote/capabilities.rb +267 -0
- data/lib/selenium/webdriver/remote/commands.rb +193 -0
- data/lib/selenium/webdriver/remote/http/common.rb +74 -0
- data/lib/selenium/webdriver/remote/http/curb.rb +79 -0
- data/lib/selenium/webdriver/remote/http/default.rb +139 -0
- data/lib/selenium/webdriver/remote/http/persistent.rb +38 -0
- data/lib/selenium/webdriver/remote/response.rb +97 -0
- data/lib/selenium/webdriver/remote/server_error.rb +17 -0
- data/lib/selenium/webdriver/safari.rb +46 -0
- data/lib/selenium/webdriver/safari/bridge.rb +110 -0
- data/lib/selenium/webdriver/safari/browser.rb +20 -0
- data/lib/selenium/webdriver/safari/extension.rb +120 -0
- data/lib/selenium/webdriver/safari/server.rb +145 -0
- data/lib/selenium/webdriver/support.rb +5 -0
- data/lib/selenium/webdriver/support/abstract_event_listener.rb +28 -0
- data/lib/selenium/webdriver/support/block_event_listener.rb +17 -0
- data/lib/selenium/webdriver/support/color.rb +110 -0
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +112 -0
- data/lib/selenium/webdriver/support/select.rb +293 -0
- data/ruby.iml +13 -0
- data/spec/integration/selenium/client/api/backward_compatible_api_spec.rb +22 -0
- data/spec/integration/selenium/client/api/browser_xpath_library_spec.rb +17 -0
- data/spec/integration/selenium/client/api/click_spec.rb +39 -0
- data/spec/integration/selenium/client/api/cookie_spec.rb +39 -0
- data/spec/integration/selenium/client/api/element_spec.rb +14 -0
- data/spec/integration/selenium/client/api/highlight_located_element_spec.rb +19 -0
- data/spec/integration/selenium/client/api/retrieve_last_remote_control_logs_spec.rb +33 -0
- data/spec/integration/selenium/client/api/screenshot_spec.rb +31 -0
- data/spec/integration/selenium/client/api/select_window_spec.rb +46 -0
- data/spec/integration/selenium/client/api/start_stop_spec.rb +9 -0
- data/spec/integration/selenium/client/api/wait_for_ajax_spec.rb +27 -0
- data/spec/integration/selenium/client/api/wait_for_element_spec.rb +56 -0
- data/spec/integration/selenium/client/api/wait_for_field_value_spec.rb +52 -0
- data/spec/integration/selenium/client/api/wait_for_text_spec.rb +98 -0
- data/spec/integration/selenium/client/api/webdriver_backed_spec.rb +21 -0
- data/spec/integration/selenium/client/sample-app/public/jquery-1.3.2.js +4376 -0
- data/spec/integration/selenium/client/sample-app/public/jquery.html +55 -0
- data/spec/integration/selenium/client/sample-app/public/prototype-1.6.0.3.js +4320 -0
- data/spec/integration/selenium/client/sample-app/public/prototype.html +59 -0
- data/spec/integration/selenium/client/sample-app/sample_app.rb +32 -0
- data/spec/integration/selenium/client/spec_helper.rb +139 -0
- data/spec/integration/selenium/webdriver/app_cache_spec.rb +47 -0
- data/spec/integration/selenium/webdriver/browser_connection_spec.rb +20 -0
- data/spec/integration/selenium/webdriver/chrome/driver_spec.rb +28 -0
- data/spec/integration/selenium/webdriver/chrome/profile_spec.rb +63 -0
- data/spec/integration/selenium/webdriver/driver_spec.rb +266 -0
- data/spec/integration/selenium/webdriver/element_spec.rb +191 -0
- data/spec/integration/selenium/webdriver/error_spec.rb +30 -0
- data/spec/integration/selenium/webdriver/firefox/driver_spec.rb +21 -0
- data/spec/integration/selenium/webdriver/firefox/profile_spec.rb +141 -0
- data/spec/integration/selenium/webdriver/keyboard_spec.rb +57 -0
- data/spec/integration/selenium/webdriver/location_spec.rb +29 -0
- data/spec/integration/selenium/webdriver/mouse_spec.rb +57 -0
- data/spec/integration/selenium/webdriver/navigation_spec.rb +46 -0
- data/spec/integration/selenium/webdriver/opera/driver_spec.rb +47 -0
- data/spec/integration/selenium/webdriver/options_spec.rb +77 -0
- data/spec/integration/selenium/webdriver/remote/driver_spec.rb +19 -0
- data/spec/integration/selenium/webdriver/remote/element_spec.rb +26 -0
- data/spec/integration/selenium/webdriver/spec_helper.rb +36 -0
- data/spec/integration/selenium/webdriver/spec_support.rb +12 -0
- data/spec/integration/selenium/webdriver/spec_support/guards.rb +110 -0
- data/spec/integration/selenium/webdriver/spec_support/helpers.rb +51 -0
- data/spec/integration/selenium/webdriver/spec_support/rack_server.rb +123 -0
- data/spec/integration/selenium/webdriver/spec_support/test_environment.rb +239 -0
- data/spec/integration/selenium/webdriver/sql_database_spec.rb +59 -0
- data/spec/integration/selenium/webdriver/storage_spec.rb +96 -0
- data/spec/integration/selenium/webdriver/target_locator_spec.rb +186 -0
- data/spec/integration/selenium/webdriver/timeout_spec.rb +69 -0
- data/spec/integration/selenium/webdriver/touch_spec.rb +176 -0
- data/spec/integration/selenium/webdriver/window_spec.rb +70 -0
- data/spec/integration/selenium/webdriver/zipper_spec.rb +66 -0
- data/spec/unit/selenium/client/base_spec.rb +239 -0
- data/spec/unit/selenium/client/extensions_spec.rb +174 -0
- data/spec/unit/selenium/client/idiomatic_spec.rb +500 -0
- data/spec/unit/selenium/client/javascript_expression_builder_spec.rb +79 -0
- data/spec/unit/selenium/client/javascript_frameworks/jquery_spec.rb +10 -0
- data/spec/unit/selenium/client/javascript_frameworks/prototype_spec.rb +10 -0
- data/spec/unit/selenium/client/protocol_spec.rb +124 -0
- data/spec/unit/selenium/client/selenium_helper_spec.rb +56 -0
- data/spec/unit/selenium/client/spec_helper.rb +24 -0
- data/spec/unit/selenium/rake/task_spec.rb +79 -0
- data/spec/unit/selenium/server_spec.rb +150 -0
- data/spec/unit/selenium/webdriver/action_builder_spec.rb +97 -0
- data/spec/unit/selenium/webdriver/android/bridge_spec.rb +43 -0
- data/spec/unit/selenium/webdriver/chrome/bridge_spec.rb +137 -0
- data/spec/unit/selenium/webdriver/chrome/profile_spec.rb +57 -0
- data/spec/unit/selenium/webdriver/chrome/service_spec.rb +44 -0
- data/spec/unit/selenium/webdriver/error_spec.rb +41 -0
- data/spec/unit/selenium/webdriver/firefox/bridge_spec.rb +47 -0
- data/spec/unit/selenium/webdriver/ie/bridge_spec.rb +91 -0
- data/spec/unit/selenium/webdriver/iphone/bridge_spec.rb +42 -0
- data/spec/unit/selenium/webdriver/log_entry_spec.rb +11 -0
- data/spec/unit/selenium/webdriver/opera/bridge_spec.rb +44 -0
- data/spec/unit/selenium/webdriver/phantomjs/bridge_spec.rb +55 -0
- data/spec/unit/selenium/webdriver/proxy_spec.rb +106 -0
- data/spec/unit/selenium/webdriver/remote/bridge_spec.rb +16 -0
- data/spec/unit/selenium/webdriver/remote/capabilities_spec.rb +115 -0
- data/spec/unit/selenium/webdriver/remote/http/common_spec.rb +24 -0
- data/spec/unit/selenium/webdriver/remote/http/default_spec.rb +124 -0
- data/spec/unit/selenium/webdriver/search_context_spec.rb +61 -0
- data/spec/unit/selenium/webdriver/socket_poller_spec.rb +68 -0
- data/spec/unit/selenium/webdriver/spec_helper.rb +27 -0
- data/spec/unit/selenium/webdriver/support/color_spec.rb +119 -0
- data/spec/unit/selenium/webdriver/support/event_firing_spec.rb +111 -0
- data/spec/unit/selenium/webdriver/support/select_spec.rb +290 -0
- data/spec/unit/selenium/webdriver/wait_spec.rb +49 -0
- 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 @@
|
|
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
|