selenium-webdriver 2.45.0 → 2.46.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +18 -3
- data/Gemfile.lock +5 -5
- data/LICENSE +202 -0
- data/README.md +13 -8
- data/lib/selenium-client.rb +17 -0
- data/lib/selenium-webdriver.rb +17 -0
- data/lib/selenium/client.rb +17 -0
- data/lib/selenium/client/base.rb +17 -0
- data/lib/selenium/client/driver.rb +17 -0
- data/lib/selenium/client/errors.rb +17 -0
- data/lib/selenium/client/extensions.rb +1 -3
- data/lib/selenium/client/idiomatic.rb +17 -0
- data/lib/selenium/client/javascript_expression_builder.rb +17 -0
- data/lib/selenium/client/javascript_frameworks/jquery.rb +17 -0
- data/lib/selenium/client/javascript_frameworks/prototype.rb +17 -0
- data/lib/selenium/client/legacy_driver.rb +15 -15
- data/lib/selenium/client/protocol.rb +17 -0
- data/lib/selenium/client/selenium_helper.rb +18 -5
- data/lib/selenium/rake/server_task.rb +17 -0
- data/lib/selenium/server.rb +17 -0
- data/lib/selenium/webdriver.rb +18 -3
- data/lib/selenium/webdriver/android.rb +17 -0
- data/lib/selenium/webdriver/android/bridge.rb +18 -1
- data/lib/selenium/webdriver/chrome.rb +20 -3
- data/lib/selenium/webdriver/chrome/bridge.rb +17 -0
- data/lib/selenium/webdriver/chrome/profile.rb +18 -1
- data/lib/selenium/webdriver/chrome/service.rb +64 -21
- data/lib/selenium/webdriver/common.rb +19 -1
- data/lib/selenium/webdriver/common/action_builder.rb +17 -0
- data/lib/selenium/webdriver/common/alert.rb +17 -0
- data/lib/selenium/webdriver/common/bridge_helper.rb +18 -1
- data/lib/selenium/webdriver/common/core_ext/base64.rb +17 -0
- data/lib/selenium/webdriver/common/core_ext/dir.rb +17 -0
- data/lib/selenium/webdriver/common/core_ext/string.rb +17 -0
- data/lib/selenium/webdriver/common/driver.rb +18 -3
- data/lib/selenium/webdriver/common/driver_extensions/has_input_devices.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_location.rb +21 -4
- data/lib/selenium/webdriver/common/driver_extensions/has_network_connection.rb +57 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_remote_status.rb +21 -4
- data/lib/selenium/webdriver/common/driver_extensions/has_session_id.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/has_touch_screen.rb +21 -4
- data/lib/selenium/webdriver/common/driver_extensions/has_web_storage.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/rotatable.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb +17 -0
- data/lib/selenium/webdriver/common/driver_extensions/uploads_files.rb +17 -0
- data/lib/selenium/webdriver/common/element.rb +23 -3
- data/lib/selenium/webdriver/common/error.rb +17 -0
- data/lib/selenium/webdriver/common/file_reaper.rb +17 -0
- data/lib/selenium/webdriver/common/html5/local_storage.rb +21 -4
- data/lib/selenium/webdriver/common/html5/location.rb +17 -0
- data/lib/selenium/webdriver/common/html5/session_storage.rb +21 -4
- data/lib/selenium/webdriver/common/html5/shared_web_storage.rb +22 -5
- data/lib/selenium/webdriver/common/json_helper.rb +20 -3
- data/lib/selenium/webdriver/common/keyboard.rb +17 -0
- data/lib/selenium/webdriver/common/keys.rb +16 -1
- data/lib/selenium/webdriver/common/log_entry.rb +21 -3
- data/lib/selenium/webdriver/common/logs.rb +20 -3
- data/lib/selenium/webdriver/common/mouse.rb +17 -0
- data/lib/selenium/webdriver/common/navigation.rb +17 -0
- data/lib/selenium/webdriver/common/options.rb +17 -0
- data/lib/selenium/webdriver/common/platform.rb +17 -0
- data/lib/selenium/webdriver/common/port_prober.rb +17 -0
- data/lib/selenium/webdriver/common/profile_helper.rb +17 -0
- data/lib/selenium/webdriver/common/proxy.rb +17 -0
- data/lib/selenium/webdriver/common/search_context.rb +17 -0
- data/lib/selenium/webdriver/common/socket_lock.rb +76 -0
- data/lib/selenium/webdriver/common/socket_poller.rb +17 -0
- data/lib/selenium/webdriver/common/target_locator.rb +17 -0
- data/lib/selenium/webdriver/common/timeouts.rb +17 -0
- data/lib/selenium/webdriver/common/touch_action_builder.rb +20 -3
- data/lib/selenium/webdriver/common/touch_screen.rb +20 -3
- data/lib/selenium/webdriver/common/wait.rb +17 -0
- data/lib/selenium/webdriver/common/window.rb +20 -4
- data/lib/selenium/webdriver/common/zipper.rb +17 -0
- data/lib/selenium/webdriver/firefox.rb +20 -4
- data/lib/selenium/webdriver/firefox/binary.rb +17 -0
- data/lib/selenium/webdriver/firefox/bridge.rb +18 -3
- data/lib/selenium/webdriver/firefox/extension.rb +17 -0
- data/lib/selenium/webdriver/firefox/extension/prefs.json +2 -0
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/lib/selenium/webdriver/firefox/launcher.rb +17 -8
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/profile.rb +17 -0
- data/lib/selenium/webdriver/firefox/profiles_ini.rb +17 -0
- data/lib/selenium/webdriver/firefox/util.rb +17 -0
- data/lib/selenium/webdriver/ie.rb +21 -3
- data/lib/selenium/webdriver/ie/bridge.rb +17 -0
- data/lib/selenium/webdriver/ie/server.rb +21 -4
- data/lib/selenium/webdriver/iphone.rb +17 -0
- data/lib/selenium/webdriver/iphone/bridge.rb +17 -0
- data/lib/selenium/webdriver/phantomjs.rb +20 -3
- data/lib/selenium/webdriver/phantomjs/bridge.rb +17 -0
- data/lib/selenium/webdriver/phantomjs/service.rb +17 -0
- data/lib/selenium/webdriver/remote.rb +20 -5
- data/lib/selenium/webdriver/remote/bridge.rb +24 -9
- data/lib/selenium/webdriver/remote/capabilities.rb +17 -9
- data/lib/selenium/webdriver/remote/commands.rb +20 -4
- data/lib/selenium/webdriver/remote/http/common.rb +18 -1
- data/lib/selenium/webdriver/remote/http/curb.rb +17 -0
- data/lib/selenium/webdriver/remote/http/default.rb +26 -4
- data/lib/selenium/webdriver/remote/http/persistent.rb +17 -0
- data/lib/selenium/webdriver/remote/response.rb +17 -0
- data/lib/selenium/webdriver/remote/server_error.rb +19 -2
- data/lib/selenium/webdriver/safari.rb +20 -3
- data/lib/selenium/webdriver/safari/bridge.rb +21 -4
- data/lib/selenium/webdriver/safari/browser.rb +21 -5
- data/lib/selenium/webdriver/safari/extensions.rb +21 -4
- data/lib/selenium/webdriver/safari/options.rb +21 -4
- data/lib/selenium/webdriver/safari/resources/SafariDriver.safariextz +0 -0
- data/lib/selenium/webdriver/safari/resources/client.js +1 -1
- data/lib/selenium/webdriver/safari/server.rb +21 -4
- data/lib/selenium/webdriver/support.rb +17 -0
- data/lib/selenium/webdriver/support/abstract_event_listener.rb +21 -4
- data/lib/selenium/webdriver/support/block_event_listener.rb +21 -4
- data/lib/selenium/webdriver/support/color.rb +22 -5
- data/lib/selenium/webdriver/support/event_firing_bridge.rb +17 -0
- data/lib/selenium/webdriver/support/select.rb +21 -4
- data/selenium-webdriver.gemspec +2 -2
- metadata +78 -78
- data/lib/selenium/webdriver/opera.rb +0 -24
- data/lib/selenium/webdriver/opera/bridge.rb +0 -112
- data/lib/selenium/webdriver/opera/service.rb +0 -49
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
require 'selenium/webdriver/common/core_ext/dir'
|
2
19
|
require 'selenium/webdriver/common/core_ext/string'
|
3
20
|
require 'selenium/webdriver/common/core_ext/base64'
|
@@ -6,6 +23,7 @@ require 'selenium/webdriver/common/platform'
|
|
6
23
|
require 'selenium/webdriver/common/proxy'
|
7
24
|
require 'selenium/webdriver/common/log_entry'
|
8
25
|
require 'selenium/webdriver/common/file_reaper'
|
26
|
+
require 'selenium/webdriver/common/socket_lock'
|
9
27
|
require 'selenium/webdriver/common/socket_poller'
|
10
28
|
require 'selenium/webdriver/common/port_prober'
|
11
29
|
require 'selenium/webdriver/common/zipper'
|
@@ -28,13 +46,13 @@ require 'selenium/webdriver/common/html5/local_storage'
|
|
28
46
|
require 'selenium/webdriver/common/html5/session_storage'
|
29
47
|
require 'selenium/webdriver/common/driver_extensions/takes_screenshot'
|
30
48
|
require 'selenium/webdriver/common/driver_extensions/rotatable'
|
31
|
-
require 'selenium/webdriver/common/driver_extensions/has_browser_connection'
|
32
49
|
require 'selenium/webdriver/common/driver_extensions/has_input_devices'
|
33
50
|
require 'selenium/webdriver/common/driver_extensions/has_web_storage'
|
34
51
|
require 'selenium/webdriver/common/driver_extensions/has_location'
|
35
52
|
require 'selenium/webdriver/common/driver_extensions/has_session_id'
|
36
53
|
require 'selenium/webdriver/common/driver_extensions/has_touch_screen'
|
37
54
|
require 'selenium/webdriver/common/driver_extensions/has_remote_status'
|
55
|
+
require 'selenium/webdriver/common/driver_extensions/has_network_connection'
|
38
56
|
require 'selenium/webdriver/common/driver_extensions/uploads_files'
|
39
57
|
require 'selenium/webdriver/common/keys'
|
40
58
|
require 'selenium/webdriver/common/bridge_helper'
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
class Alert
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|
@@ -25,7 +42,7 @@ module Selenium
|
|
25
42
|
end
|
26
43
|
|
27
44
|
def element_id_from(id)
|
28
|
-
id['ELEMENT']
|
45
|
+
id['ELEMENT'] or id['element-6066-11e4-a52e-4f735466cecf']
|
29
46
|
end
|
30
47
|
|
31
48
|
def parse_cookie_string(str)
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
require 'base64'
|
2
19
|
|
3
20
|
module Base64
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
class Dir
|
2
19
|
# @api private
|
3
20
|
def self.mktmpdir(prefix_suffix=nil, tmpdir=nil)
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
unless '1.9'.respond_to?(:bytesize)
|
2
19
|
class String
|
3
20
|
alias :bytesize :size
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|
@@ -39,8 +56,6 @@ module Selenium
|
|
39
56
|
Android::Bridge.new(opts)
|
40
57
|
when :iphone
|
41
58
|
IPhone::Bridge.new(opts)
|
42
|
-
when :opera
|
43
|
-
Opera::Bridge.new(opts)
|
44
59
|
when :phantomjs
|
45
60
|
PhantomJS::Bridge.new(opts)
|
46
61
|
when :safari
|
@@ -201,7 +216,7 @@ module Selenium
|
|
201
216
|
# executed function as the last argument.
|
202
217
|
#
|
203
218
|
# @param [String] script
|
204
|
-
#
|
219
|
+
# JavaScript source to execute
|
205
220
|
# @param [WebDriver::Element,Integer, Float, Boolean, NilClass, String, Array] *args
|
206
221
|
# Arguments to the script. May be empty.
|
207
222
|
#
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
module DriverExtensions
|
@@ -18,8 +35,8 @@ module Selenium
|
|
18
35
|
def set_location(lat, lon, alt)
|
19
36
|
self.location = Location.new(Float(lat), Float(lon), Float(alt))
|
20
37
|
end
|
21
|
-
end
|
22
38
|
|
23
|
-
|
24
|
-
|
25
|
-
end
|
39
|
+
end #HasLocation
|
40
|
+
end # DriverExtensions
|
41
|
+
end # WebDriver
|
42
|
+
end # Selenium
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
module Selenium
|
19
|
+
module WebDriver
|
20
|
+
module DriverExtensions
|
21
|
+
module HasNetworkConnection
|
22
|
+
def network_connection_type
|
23
|
+
connection_value = @bridge.getNetworkConnection
|
24
|
+
|
25
|
+
connection_type = values_to_type[connection_value]
|
26
|
+
|
27
|
+
# In case the connection type is not recognized return the
|
28
|
+
# connection value.
|
29
|
+
connection_type || connection_value
|
30
|
+
end
|
31
|
+
|
32
|
+
def network_connection_type=(connection_type)
|
33
|
+
raise ArgumentError, "Invalid connection type" unless valid_type? connection_type
|
34
|
+
|
35
|
+
connection_value = type_to_values[connection_type]
|
36
|
+
|
37
|
+
@bridge.setNetworkConnection connection_value
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def type_to_values
|
43
|
+
{:airplane_mode => 1, :wifi => 2, :data => 4, :all => 6, :none => 0}
|
44
|
+
end
|
45
|
+
|
46
|
+
def values_to_type
|
47
|
+
type_to_values.invert
|
48
|
+
end
|
49
|
+
|
50
|
+
def valid_type?(type)
|
51
|
+
type_to_values.keys.include? type
|
52
|
+
end
|
53
|
+
|
54
|
+
end # HasNetworkConnection
|
55
|
+
end # DriverExtensions
|
56
|
+
end # WebDriver
|
57
|
+
end # Selenium
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
module DriverExtensions
|
@@ -7,7 +24,7 @@ module Selenium
|
|
7
24
|
@bridge.status
|
8
25
|
end
|
9
26
|
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
27
|
+
end # HasRemoteStatus
|
28
|
+
end # DriverExtensions
|
29
|
+
end # WebDriver
|
30
|
+
end # Selenium
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
module DriverExtensions
|
@@ -12,8 +29,8 @@ module Selenium
|
|
12
29
|
def touch_screen
|
13
30
|
TouchScreen.new @bridge
|
14
31
|
end
|
15
|
-
end
|
16
32
|
|
17
|
-
|
18
|
-
|
19
|
-
end
|
33
|
+
end # HasTouchScreen
|
34
|
+
end # DriverExtensions
|
35
|
+
end # WebDriver
|
36
|
+
end # Selenium
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|
@@ -1,3 +1,20 @@
|
|
1
|
+
# Licensed to the Software Freedom Conservancy (SFC) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The SFC licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
1
18
|
module Selenium
|
2
19
|
module WebDriver
|
3
20
|
|