selenium-webdriver 0.0.24 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- data/{common/src/rb/CHANGES → CHANGES} +13 -0
- data/{common/src/rb/README → README} +1 -1
- data/{common/src/rb/lib → lib}/selenium-webdriver.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver.rb +2 -1
- data/{common/src/rb/lib → lib}/selenium/webdriver/bridge_helper.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/child_process.rb +0 -0
- data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome.rb +0 -0
- data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome/bridge.rb +2 -2
- data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome/command_executor.rb +0 -0
- data/lib/selenium/webdriver/chrome/extension.zip +0 -0
- data/{chrome/src/rb/lib → lib}/selenium/webdriver/chrome/launcher.rb +26 -20
- data/{common/src/rb/lib → lib}/selenium/webdriver/core_ext/dir.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/core_ext/string.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/driver.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/driver_extensions/takes_screenshot.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/element.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/error.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/file_reaper.rb +2 -1
- data/{common/src/rb/lib → lib}/selenium/webdriver/find.rb +0 -0
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox.rb +2 -1
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/binary.rb +32 -6
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/bridge.rb +0 -0
- data/lib/selenium/webdriver/firefox/extension/webdriver.xpi +0 -0
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/launcher.rb +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/amd64/x_ignore_nofocus.so +0 -0
- data/lib/selenium/webdriver/firefox/native/linux/x86/x_ignore_nofocus.so +0 -0
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/profile.rb +37 -72
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/profiles_ini.rb +0 -0
- data/{firefox/src/rb/lib → lib}/selenium/webdriver/firefox/util.rb +0 -0
- data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie.rb +2 -2
- data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie/bridge.rb +7 -2
- data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie/lib.rb +0 -0
- data/{jobbie/prebuilt/Win32/Release → lib/selenium/webdriver/ie/native/win32}/InternetExplorerDriver.dll +0 -0
- data/lib/selenium/webdriver/ie/native/x64/InternetExplorerDriver.dll +0 -0
- data/{jobbie/src/rb/lib → lib}/selenium/webdriver/ie/util.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/keys.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/navigation.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/options.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/platform.rb +5 -1
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/bridge.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/capabilities.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/commands.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/http/common.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/http/curb.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/http/default.rb +5 -1
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/response.rb +0 -0
- data/{remote/client/src/rb/lib → lib}/selenium/webdriver/remote/server_error.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/target_locator.rb +0 -0
- data/{common/src/rb/lib → lib}/selenium/webdriver/timeouts.rb +0 -0
- data/lib/selenium/webdriver/zip_helper.rb +30 -0
- metadata +73 -214
- data/COPYING +0 -204
- data/chrome/prebuilt/Win32/Release/npchromedriver.dll +0 -0
- data/chrome/prebuilt/x64/Release/npchromedriver.dll +0 -0
- data/chrome/src/extension/background.html +0 -9
- data/chrome/src/extension/background.js +0 -1029
- data/chrome/src/extension/content_script.js +0 -1488
- data/chrome/src/extension/icons/busy.png +0 -0
- data/chrome/src/extension/icons/free.png +0 -0
- data/chrome/src/extension/manifest-nonwin.json +0 -19
- data/chrome/src/extension/manifest-win.json +0 -20
- data/chrome/src/extension/utils.js +0 -231
- data/common/src/js/abstractcommandprocessor.js +0 -132
- data/common/src/js/asserts.js +0 -296
- data/common/src/js/by.js +0 -149
- data/common/src/js/command.js +0 -380
- data/common/src/js/core/Blank.html +0 -7
- data/common/src/js/core/InjectedRemoteRunner.html +0 -8
- data/common/src/js/core/RemoteRunner.html +0 -101
- data/common/src/js/core/SeleniumLog.html +0 -109
- data/common/src/js/core/TestPrompt.html +0 -145
- data/common/src/js/core/TestRunner-splash.html +0 -55
- data/common/src/js/core/TestRunner.html +0 -165
- data/common/src/js/core/icons/all.png +0 -0
- data/common/src/js/core/icons/continue.png +0 -0
- data/common/src/js/core/icons/continue_disabled.png +0 -0
- data/common/src/js/core/icons/pause.png +0 -0
- data/common/src/js/core/icons/pause_disabled.png +0 -0
- data/common/src/js/core/icons/selected.png +0 -0
- data/common/src/js/core/icons/step.png +0 -0
- data/common/src/js/core/icons/step_disabled.png +0 -0
- data/common/src/js/core/lib/cssQuery/cssQuery-p.js +0 -6
- data/common/src/js/core/lib/cssQuery/src/cssQuery-level2.js +0 -142
- data/common/src/js/core/lib/cssQuery/src/cssQuery-level3.js +0 -150
- data/common/src/js/core/lib/cssQuery/src/cssQuery-standard.js +0 -53
- data/common/src/js/core/lib/cssQuery/src/cssQuery.js +0 -356
- data/common/src/js/core/lib/prototype.js +0 -2006
- data/common/src/js/core/lib/scriptaculous/builder.js +0 -101
- data/common/src/js/core/lib/scriptaculous/controls.js +0 -815
- data/common/src/js/core/lib/scriptaculous/dragdrop.js +0 -915
- data/common/src/js/core/lib/scriptaculous/effects.js +0 -958
- data/common/src/js/core/lib/scriptaculous/scriptaculous.js +0 -47
- data/common/src/js/core/lib/scriptaculous/slider.js +0 -283
- data/common/src/js/core/lib/scriptaculous/unittest.js +0 -383
- data/common/src/js/core/lib/snapsie.js +0 -91
- data/common/src/js/core/scripts/find_matching_child.js +0 -69
- data/common/src/js/core/scripts/htmlutils.js +0 -8716
- data/common/src/js/core/scripts/injection.html +0 -72
- data/common/src/js/core/scripts/selenium-api.js +0 -3291
- data/common/src/js/core/scripts/selenium-browserbot.js +0 -2457
- data/common/src/js/core/scripts/selenium-browserdetect.js +0 -153
- data/common/src/js/core/scripts/selenium-commandhandlers.js +0 -379
- data/common/src/js/core/scripts/selenium-executionloop.js +0 -175
- data/common/src/js/core/scripts/selenium-logging.js +0 -148
- data/common/src/js/core/scripts/selenium-remoterunner.js +0 -695
- data/common/src/js/core/scripts/selenium-testrunner.js +0 -1362
- data/common/src/js/core/scripts/selenium-version.js +0 -5
- data/common/src/js/core/scripts/ui-doc.html +0 -808
- data/common/src/js/core/scripts/ui-element.js +0 -1644
- data/common/src/js/core/scripts/ui-map-sample.js +0 -979
- data/common/src/js/core/scripts/user-extensions.js +0 -3
- data/common/src/js/core/scripts/user-extensions.js.sample +0 -75
- data/common/src/js/core/scripts/xmlextras.js +0 -153
- data/common/src/js/core/selenium-logo.png +0 -0
- data/common/src/js/core/selenium-test.css +0 -43
- data/common/src/js/core/selenium.css +0 -316
- data/common/src/js/core/xpath/dom.js +0 -566
- data/common/src/js/core/xpath/javascript-xpath-0.1.11.js +0 -2816
- data/common/src/js/core/xpath/util.js +0 -549
- data/common/src/js/core/xpath/xmltoken.js +0 -149
- data/common/src/js/core/xpath/xpath.js +0 -2481
- data/common/src/js/extension/README +0 -2
- data/common/src/js/extension/dommessenger.js +0 -152
- data/common/src/js/factory.js +0 -55
- data/common/src/js/future.js +0 -141
- data/common/src/js/jsunit.js +0 -40
- data/common/src/js/jsunit/app/css/jsUnitStyle.css +0 -50
- data/common/src/js/jsunit/app/css/readme +0 -10
- data/common/src/js/jsunit/app/emptyPage.html +0 -11
- data/common/src/js/jsunit/app/jsUnitCore.js +0 -534
- data/common/src/js/jsunit/app/jsUnitMockTimeout.js +0 -81
- data/common/src/js/jsunit/app/jsUnitTestManager.js +0 -705
- data/common/src/js/jsunit/app/jsUnitTestSuite.js +0 -44
- data/common/src/js/jsunit/app/jsUnitTracer.js +0 -102
- data/common/src/js/jsunit/app/jsUnitVersionCheck.js +0 -59
- data/common/src/js/jsunit/app/main-counts-errors.html +0 -12
- data/common/src/js/jsunit/app/main-counts-failures.html +0 -13
- data/common/src/js/jsunit/app/main-counts-runs.html +0 -13
- data/common/src/js/jsunit/app/main-counts.html +0 -21
- data/common/src/js/jsunit/app/main-data.html +0 -178
- data/common/src/js/jsunit/app/main-errors.html +0 -23
- data/common/src/js/jsunit/app/main-frame.html +0 -19
- data/common/src/js/jsunit/app/main-loader.html +0 -45
- data/common/src/js/jsunit/app/main-progress.html +0 -25
- data/common/src/js/jsunit/app/main-results.html +0 -67
- data/common/src/js/jsunit/app/main-status.html +0 -13
- data/common/src/js/jsunit/app/testContainer.html +0 -16
- data/common/src/js/jsunit/app/testContainerController.html +0 -77
- data/common/src/js/jsunit/app/xbDebug.js +0 -306
- data/common/src/js/jsunit/changelog.txt +0 -60
- data/common/src/js/jsunit/css/jsUnitStyle.css +0 -83
- data/common/src/js/jsunit/images/green.gif +0 -0
- data/common/src/js/jsunit/images/logo_jsunit.gif +0 -0
- data/common/src/js/jsunit/images/powerby-transparent.gif +0 -0
- data/common/src/js/jsunit/images/red.gif +0 -0
- data/common/src/js/jsunit/licenses/JDOM_license.txt +0 -56
- data/common/src/js/jsunit/licenses/Jetty_license.html +0 -213
- data/common/src/js/jsunit/licenses/MPL-1.1.txt +0 -470
- data/common/src/js/jsunit/licenses/gpl-2.txt +0 -340
- data/common/src/js/jsunit/licenses/index.html +0 -141
- data/common/src/js/jsunit/licenses/lgpl-2.1.txt +0 -504
- data/common/src/js/jsunit/licenses/mpl-tri-license-c.txt +0 -35
- data/common/src/js/jsunit/licenses/mpl-tri-license-html.txt +0 -35
- data/common/src/js/jsunit/readme.txt +0 -19
- data/common/src/js/jsunit/testRunner.html +0 -167
- data/common/src/js/jsunit/version.txt +0 -1
- data/common/src/js/key.js +0 -117
- data/common/src/js/localcommandprocessor.js +0 -171
- data/common/src/js/testcase.js +0 -219
- data/common/src/js/timing.js +0 -89
- data/common/src/js/webdriver.js +0 -860
- data/common/src/js/webelement.js +0 -483
- data/firefox/prebuilt/Win32/Release/webdriver-firefox.dll +0 -0
- data/firefox/prebuilt/amd64/libnoblur64.so +0 -0
- data/firefox/prebuilt/i386/libnoblur.so +0 -0
- data/firefox/prebuilt/linux/Release/libwebdriver-firefox.so +0 -0
- data/firefox/prebuilt/linux64/Release/libwebdriver-firefox.so +0 -0
- data/firefox/prebuilt/nsICommandProcessor.xpt +0 -0
- data/firefox/prebuilt/nsINativeEvents.xpt +0 -0
- data/firefox/prebuilt/nsIResponseHandler.xpt +0 -0
- data/firefox/src/extension/chrome.manifest +0 -3
- data/firefox/src/extension/components/badCertListener.js +0 -295
- data/firefox/src/extension/components/dispatcher.js +0 -495
- data/firefox/src/extension/components/driver-component.js +0 -130
- data/firefox/src/extension/components/errorcode.js +0 -70
- data/firefox/src/extension/components/firefoxDriver.js +0 -831
- data/firefox/src/extension/components/json2.js +0 -273
- data/firefox/src/extension/components/keytest.html +0 -554
- data/firefox/src/extension/components/nsCommandProcessor.js +0 -684
- data/firefox/src/extension/components/promptService.js +0 -208
- data/firefox/src/extension/components/request.js +0 -219
- data/firefox/src/extension/components/response.js +0 -276
- data/firefox/src/extension/components/screenshooter.js +0 -81
- data/firefox/src/extension/components/session.js +0 -314
- data/firefox/src/extension/components/sessionstore.js +0 -226
- data/firefox/src/extension/components/socketListener.js +0 -435
- data/firefox/src/extension/components/utils.js +0 -1335
- data/firefox/src/extension/components/webLoadingListener.js +0 -57
- data/firefox/src/extension/components/webdriverserver.js +0 -110
- data/firefox/src/extension/components/wrappedElement.js +0 -706
- data/firefox/src/extension/content/fxdriver.xul +0 -30
- data/firefox/src/extension/content/server.js +0 -95
- data/firefox/src/extension/idl/nsICommandProcessor.idl +0 -38
- data/firefox/src/extension/idl/nsIResponseHandler.idl +0 -34
- data/firefox/src/extension/install.rdf +0 -29
- data/jobbie/prebuilt/x64/Release/InternetExplorerDriver.dll +0 -0
@@ -1,3 +1,16 @@
|
|
1
|
+
0.0.25 (2010-07-19)
|
2
|
+
===================
|
3
|
+
|
4
|
+
* Prevent Firefox from launching in offline mode (issue #587).
|
5
|
+
* Add ability to set Firefox' binary path through Selenium::WebDriver::Firefox::Binary.path=
|
6
|
+
* Add ability to install Firefox XPIs through Profile#add_extension.
|
7
|
+
* Better packaging/building of Firefox/Chrome extensions, which adds rubyzip as a dependency.
|
8
|
+
* Remote client supports HTTPS (issue #613 - thanks kkaempf).
|
9
|
+
* Fix error message for TimeOutError in the IE driver (issue #602)
|
10
|
+
* Add ability to use Chrome's default profile.
|
11
|
+
* Fix for frame behaviour in Chrome (issue #273).
|
12
|
+
* Standard gem directory structure (issue #475).
|
13
|
+
|
1
14
|
0.0.24 (2010-06-17)
|
2
15
|
==================
|
3
16
|
|
@@ -15,7 +15,7 @@ gem install selenium-webdriver
|
|
15
15
|
|
16
16
|
= LICENSE
|
17
17
|
|
18
|
-
Copyright 2009 WebDriver committers
|
18
|
+
Copyright 2009-2010 WebDriver committers
|
19
19
|
|
20
20
|
Licensed under the Apache License, Version 2.0 (the "License");
|
21
21
|
you may not use this file except in compliance with the License.
|
File without changes
|
@@ -39,6 +39,7 @@ require "selenium/webdriver/error"
|
|
39
39
|
require "selenium/webdriver/platform"
|
40
40
|
require "selenium/webdriver/child_process"
|
41
41
|
require "selenium/webdriver/file_reaper"
|
42
|
+
require "selenium/webdriver/zip_helper"
|
42
43
|
require "selenium/webdriver/target_locator"
|
43
44
|
require "selenium/webdriver/navigation"
|
44
45
|
require "selenium/webdriver/timeouts"
|
@@ -61,7 +62,7 @@ module Selenium
|
|
61
62
|
autoload :Firefox, 'selenium/webdriver/firefox'
|
62
63
|
|
63
64
|
def self.root
|
64
|
-
@root ||= File.expand_path(File.join(File.dirname(__FILE__), ".."
|
65
|
+
@root ||= File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
65
66
|
end
|
66
67
|
|
67
68
|
#
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,10 +5,10 @@ module Selenium
|
|
5
5
|
# @private
|
6
6
|
class Bridge < Remote::Bridge
|
7
7
|
|
8
|
-
def initialize
|
8
|
+
def initialize(opts = {})
|
9
9
|
@executor = CommandExecutor.new
|
10
10
|
|
11
|
-
@launcher = Launcher.launcher
|
11
|
+
@launcher = Launcher.launcher(:default_profile => opts[:default_profile])
|
12
12
|
@launcher.launch(@executor.uri)
|
13
13
|
end
|
14
14
|
|
File without changes
|
Binary file
|
@@ -8,14 +8,14 @@ module Selenium
|
|
8
8
|
|
9
9
|
attr_reader :pid
|
10
10
|
|
11
|
-
def self.launcher
|
11
|
+
def self.launcher(*args)
|
12
12
|
launcher = case Platform.os
|
13
13
|
when :windows
|
14
|
-
WindowsLauncher.new
|
14
|
+
WindowsLauncher.new(*args)
|
15
15
|
when :macosx
|
16
|
-
MacOSXLauncher.new
|
16
|
+
MacOSXLauncher.new(*args)
|
17
17
|
when :unix, :linux
|
18
|
-
UnixLauncher.new
|
18
|
+
UnixLauncher.new(*args)
|
19
19
|
else
|
20
20
|
raise "unknown OS: #{Platform.os}"
|
21
21
|
end
|
@@ -23,6 +23,11 @@ module Selenium
|
|
23
23
|
launcher
|
24
24
|
end
|
25
25
|
|
26
|
+
def initialize(opts = {})
|
27
|
+
super()
|
28
|
+
@default_profile = opts[:default_profile]
|
29
|
+
end
|
30
|
+
|
26
31
|
def self.binary_path
|
27
32
|
@binary_path ||= (
|
28
33
|
path = possible_paths.find { |f| File.exist?(f) }
|
@@ -51,7 +56,6 @@ module Selenium
|
|
51
56
|
cp_r ext_path, tmp_extension_dir
|
52
57
|
|
53
58
|
if Platform.win?
|
54
|
-
cp linked_lib_path, tmp_extension_dir
|
55
59
|
mv "#{tmp_extension_dir}/manifest-win.json", "#{tmp_extension_dir}/manifest.json"
|
56
60
|
else
|
57
61
|
mv "#{tmp_extension_dir}/manifest-nonwin.json", "#{tmp_extension_dir}/manifest.json"
|
@@ -64,19 +68,26 @@ module Selenium
|
|
64
68
|
end
|
65
69
|
|
66
70
|
def launch_chrome(server_url)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
71
|
+
args = [
|
72
|
+
Platform.wrap_in_quotes_if_necessary(self.class.binary_path),
|
73
|
+
"--load-extension=#{Platform.wrap_in_quotes_if_necessary tmp_extension_dir}",
|
74
|
+
"--activate-on-launch",
|
75
|
+
"--disable-hang-monitor",
|
76
|
+
"--disable-popup-blocking",
|
77
|
+
"--disable-prompt-on-repost"
|
78
|
+
]
|
79
|
+
|
80
|
+
unless @default_profile
|
81
|
+
args << "--user-data-dir=#{Platform.wrap_in_quotes_if_necessary tmp_profile_dir}"
|
82
|
+
end
|
83
|
+
|
84
|
+
args << server_url
|
85
|
+
|
86
|
+
@process = ChildProcess.new(*args).start
|
76
87
|
end
|
77
88
|
|
78
89
|
def ext_path
|
79
|
-
@ext_path ||= "#{WebDriver.root}/chrome/
|
90
|
+
@ext_path ||= ZipHelper.unzip("#{WebDriver.root}/selenium/webdriver/chrome/extension.zip")
|
80
91
|
end
|
81
92
|
|
82
93
|
def tmp_extension_dir
|
@@ -122,11 +133,6 @@ module Selenium
|
|
122
133
|
nil
|
123
134
|
end
|
124
135
|
|
125
|
-
def linked_lib_path
|
126
|
-
# TODO: x64
|
127
|
-
@linked_lib_path ||= "#{WebDriver.root}/chrome/prebuilt/Win32/Release/npchromedriver.dll"
|
128
|
-
end
|
129
|
-
|
130
136
|
def quit
|
131
137
|
# looks like we need a kill right away on Windows + MRI
|
132
138
|
@process.kill if Platform.engine == :ruby
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "timeout"
|
2
2
|
require "socket"
|
3
|
+
require "rexml/document"
|
3
4
|
|
4
5
|
require "selenium/webdriver/firefox/util"
|
5
6
|
require "selenium/webdriver/firefox/binary"
|
@@ -19,7 +20,7 @@ module Selenium
|
|
19
20
|
DEFAULT_ENABLE_NATIVE_EVENTS = Platform.os == :windows
|
20
21
|
DEFAULT_SECURE_SSL = false
|
21
22
|
DEFAULT_ASSUME_UNTRUSTED_ISSUER = true
|
22
|
-
DEFAULT_LOAD_NO_FOCUS_LIB =
|
23
|
+
DEFAULT_LOAD_NO_FOCUS_LIB = false
|
23
24
|
|
24
25
|
end
|
25
26
|
end
|
@@ -5,9 +5,11 @@ module Selenium
|
|
5
5
|
# @private
|
6
6
|
class Binary
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
NO_FOCUS_LIBRARY_NAME = "x_ignore_nofocus.so"
|
9
|
+
NO_FOCUS_LIBRARIES = [
|
10
|
+
["#{WebDriver.root}/selenium/webdriver/firefox/native/linux/amd64/#{NO_FOCUS_LIBRARY_NAME}", "amd64/#{NO_FOCUS_LIBRARY_NAME}"],
|
11
|
+
["#{WebDriver.root}/selenium/webdriver/firefox/native/linux/x86/#{NO_FOCUS_LIBRARY_NAME}", "x86/#{NO_FOCUS_LIBRARY_NAME}"],
|
12
|
+
]
|
11
13
|
|
12
14
|
def create_base_profile(name)
|
13
15
|
execute("-CreateProfile", name)
|
@@ -24,6 +26,12 @@ module Selenium
|
|
24
26
|
|
25
27
|
def start_with(profile, *args)
|
26
28
|
ENV['XRE_PROFILE_PATH'] = profile.absolute_path
|
29
|
+
ENV['MOZ_NO_REMOTE'] = '1' # able to launch multiple instances
|
30
|
+
|
31
|
+
if Platform.linux? && (profile.native_events? || profile.load_no_focus_lib?)
|
32
|
+
modify_link_library_path profile
|
33
|
+
end
|
34
|
+
|
27
35
|
execute(*args)
|
28
36
|
cope_with_mac_strangeness(args) if Platform.mac?
|
29
37
|
end
|
@@ -67,7 +75,27 @@ module Selenium
|
|
67
75
|
|
68
76
|
private
|
69
77
|
|
78
|
+
def modify_link_library_path(profile)
|
79
|
+
paths = []
|
80
|
+
profile_path = profile.absolute_path
|
81
|
+
|
82
|
+
NO_FOCUS_LIBRARIES.each do |from, to|
|
83
|
+
dest = File.join(profile_path, to)
|
84
|
+
FileUtils.mkdir_p File.dirname(dest)
|
85
|
+
FileUtils.cp from, dest
|
86
|
+
|
87
|
+
paths << File.expand_path(File.dirname(dest))
|
88
|
+
end
|
89
|
+
|
90
|
+
paths += ENV['LD_LIBRARY_PATH'].to_s.split(File::PATH_SEPARATOR)
|
91
|
+
|
92
|
+
ENV['LD_LIBRARY_PATH'] = paths.uniq.join(File::PATH_SEPARATOR)
|
93
|
+
ENV['LD_PRELOAD'] = NO_FOCUS_LIBRARY_NAME
|
94
|
+
end
|
95
|
+
|
70
96
|
class << self
|
97
|
+
attr_writer :path
|
98
|
+
|
71
99
|
def path
|
72
100
|
@path ||= case Platform.os
|
73
101
|
when :macosx
|
@@ -81,7 +109,7 @@ module Selenium
|
|
81
109
|
end
|
82
110
|
|
83
111
|
unless File.file?(@path)
|
84
|
-
raise Error::WebDriverError, "Could not find Firefox binary. Make sure Firefox is installed
|
112
|
+
raise Error::WebDriverError, "Could not find Firefox binary (os=#{Platform.os}). Make sure Firefox is installed or set the path manually with #{self}.path="
|
85
113
|
end
|
86
114
|
|
87
115
|
@path
|
@@ -105,9 +133,7 @@ module Selenium
|
|
105
133
|
end
|
106
134
|
rescue LoadError
|
107
135
|
# older JRuby or IronRuby does not have win32/registry
|
108
|
-
nil
|
109
136
|
rescue Win32::Registry::Error
|
110
|
-
raise Error::WebDriverError, "Firefox not found in the Windows registry. Make sure Firefox is installed"
|
111
137
|
end
|
112
138
|
end # class << self
|
113
139
|
|
File without changes
|
Binary file
|
File without changes
|
Binary file
|
@@ -3,37 +3,10 @@ module Selenium
|
|
3
3
|
module Firefox
|
4
4
|
class Profile
|
5
5
|
|
6
|
-
ANONYMOUS_PROFILE_NAME
|
7
|
-
EXTENSION_NAME
|
8
|
-
EM_NAMESPACE_URI
|
9
|
-
|
10
|
-
|
11
|
-
DEFAULT_EXTENSION_SOURCE = File.expand_path("#{WebDriver.root}/firefox/src/extension")
|
12
|
-
|
13
|
-
XPTS = [
|
14
|
-
["#{WebDriver.root}/firefox/prebuilt/nsINativeEvents.xpt", "components/nsINativeEvents.xpt"],
|
15
|
-
["#{WebDriver.root}/firefox/prebuilt/nsICommandProcessor.xpt", "components/nsICommandProcessor.xpt"],
|
16
|
-
["#{WebDriver.root}/firefox/prebuilt/nsIResponseHandler.xpt", "components/nsIResponseHandler.xpt"],
|
17
|
-
]
|
18
|
-
|
19
|
-
NATIVE_WINDOWS = [
|
20
|
-
"#{WebDriver.root}/firefox/prebuilt/Win32/Release/webdriver-firefox.dll",
|
21
|
-
"platform/WINNT_x86-msvc/components/webdriver-firefox.dll"
|
22
|
-
]
|
23
|
-
|
24
|
-
NATIVE_LINUX = [
|
25
|
-
["#{WebDriver.root}/firefox/prebuilt/linux/Release/libwebdriver-firefox.so", "platform/Linux_x86-gcc3/components/libwebdriver-firefox.so"],
|
26
|
-
["#{WebDriver.root}/firefox/prebuilt/linux64/Release/libwebdriver-firefox.so", "platform/Linux_x86_64-gcc3/components/libwebdriver-firefox.so"]
|
27
|
-
]
|
28
|
-
|
29
|
-
NO_FOCUS = [
|
30
|
-
["#{WebDriver.root}/firefox/prebuilt/amd64/libnoblur64.so", "amd64/#{NO_FOCUS_LIBRARY_NAME}"],
|
31
|
-
["#{WebDriver.root}/firefox/prebuilt/i386/libnoblur.so", "x86/#{NO_FOCUS_LIBRARY_NAME}"],
|
32
|
-
]
|
33
|
-
|
34
|
-
SHARED = [
|
35
|
-
["#{WebDriver.root}/common/src/js/extension/dommessenger.js", "content/dommessenger.js"]
|
36
|
-
]
|
6
|
+
ANONYMOUS_PROFILE_NAME = "WEBDRIVER_ANONYMOUS_PROFILE"
|
7
|
+
EXTENSION_NAME = "fxdriver@googlecode.com"
|
8
|
+
EM_NAMESPACE_URI = "http://www.mozilla.org/2004/em-rdf#"
|
9
|
+
WEBDRIVER_EXTENSION_PATH = File.expand_path("#{WebDriver.root}/selenium/webdriver/firefox/extension/webdriver.xpi")
|
37
10
|
|
38
11
|
attr_reader :name, :directory
|
39
12
|
attr_writer :secure_ssl, :native_events, :load_no_focus_lib
|
@@ -72,7 +45,6 @@ module Selenium
|
|
72
45
|
|
73
46
|
# TODO: replace constants with options hash
|
74
47
|
@port = DEFAULT_PORT
|
75
|
-
@extension_source = DEFAULT_EXTENSION_SOURCE
|
76
48
|
@native_events = DEFAULT_ENABLE_NATIVE_EVENTS
|
77
49
|
@secure_ssl = DEFAULT_SECURE_SSL
|
78
50
|
@untrusted_issuer = DEFAULT_ASSUME_UNTRUSTED_ISSUER
|
@@ -132,44 +104,40 @@ module Selenium
|
|
132
104
|
def add_webdriver_extension(force_creation = false)
|
133
105
|
ext_path = File.join(extensions_dir, EXTENSION_NAME)
|
134
106
|
|
135
|
-
if File.exists?
|
107
|
+
if File.exists? ext_path
|
136
108
|
return unless force_creation
|
137
109
|
end
|
138
110
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
from_to = XPTS + SHARED
|
144
|
-
|
145
|
-
if native_events?
|
146
|
-
case Platform.os
|
147
|
-
when :linux
|
148
|
-
NATIVE_LINUX.each do |lib|
|
149
|
-
from_to << lib
|
150
|
-
end
|
151
|
-
when :windows
|
152
|
-
from_to << NATIVE_WINDOWS
|
153
|
-
else
|
154
|
-
raise Error::WebDriverError, "can't enable native events on #{Platform.os.inspect}"
|
155
|
-
end
|
156
|
-
end
|
111
|
+
add_extension WEBDRIVER_EXTENSION_PATH
|
112
|
+
delete_extensions_cache
|
113
|
+
end
|
157
114
|
|
158
|
-
|
159
|
-
|
160
|
-
|
115
|
+
#
|
116
|
+
# Aadd the extension (directory, .zip or .xpi) at the given path to the profile.
|
117
|
+
#
|
118
|
+
|
119
|
+
def add_extension(path)
|
120
|
+
unless File.exist?(path)
|
121
|
+
raise Error::WebDriverError, "could not find extension at #{path.inspect}"
|
161
122
|
end
|
162
123
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
124
|
+
if File.directory? path
|
125
|
+
root = path
|
126
|
+
else
|
127
|
+
unless %w[.zip .xpi].include? File.extname(path)
|
128
|
+
raise Error::WebDriverError, "expected .zip or .xpi extension, got #{path.inspect}"
|
129
|
+
end
|
130
|
+
|
131
|
+
root = ZipHelper.unzip(path)
|
167
132
|
end
|
168
133
|
|
169
|
-
|
170
|
-
|
134
|
+
id = read_id_from_install_rdf(root)
|
135
|
+
ext_path = File.join(extensions_dir, id)
|
171
136
|
|
172
|
-
|
137
|
+
FileUtils.rm_rf ext_path
|
138
|
+
FileUtils.mkdir_p File.dirname(ext_path), :mode => 0700
|
139
|
+
FileUtils.cp_r root, ext_path
|
140
|
+
end
|
173
141
|
|
174
142
|
def extensions_dir
|
175
143
|
@extensions_dir ||= File.join(directory, "extensions")
|
@@ -184,17 +152,6 @@ module Selenium
|
|
184
152
|
FileUtils.rm_f cache if File.exist?(cache)
|
185
153
|
end
|
186
154
|
|
187
|
-
def modify_link_library_path(paths)
|
188
|
-
old_path = ENV['LD_LIBRARY_PATH']
|
189
|
-
|
190
|
-
unless [nil, ''].include?(old_path)
|
191
|
-
paths << old_path
|
192
|
-
end
|
193
|
-
|
194
|
-
ENV['LD_LIBRARY_PATH'] = paths.join(File::PATH_SEPARATOR)
|
195
|
-
ENV['LD_PRELOAD'] = NO_FOCUS_LIBRARY_NAME
|
196
|
-
end
|
197
|
-
|
198
155
|
def native_events?
|
199
156
|
@native_events == true
|
200
157
|
end
|
@@ -217,6 +174,13 @@ module Selenium
|
|
217
174
|
|
218
175
|
private
|
219
176
|
|
177
|
+
def read_id_from_install_rdf(directory)
|
178
|
+
rdf_path = File.join(directory, "install.rdf")
|
179
|
+
doc = REXML::Document.new(File.read(rdf_path))
|
180
|
+
|
181
|
+
REXML::XPath.first(doc, "//em:id").text
|
182
|
+
end
|
183
|
+
|
220
184
|
def create_tmp_copy(directory)
|
221
185
|
tmp_directory = Dir.mktmpdir("webdriver-rb-profilecopy")
|
222
186
|
|
@@ -274,6 +238,7 @@ module Selenium
|
|
274
238
|
"dom.disable_open_during_load" => 'false',
|
275
239
|
"extensions.update.enabled" => 'false',
|
276
240
|
"extensions.update.notifyUser" => 'false',
|
241
|
+
"network.manage-offline-status" => 'false',
|
277
242
|
"security.warn_entering_secure" => 'false',
|
278
243
|
"security.warn_submit_insecure" => 'false',
|
279
244
|
"security.warn_entering_secure.show_once" => 'false',
|
File without changes
|
File without changes
|
@@ -4,8 +4,8 @@ module Selenium
|
|
4
4
|
# @private
|
5
5
|
module IE
|
6
6
|
DLLS = {
|
7
|
-
:win32 => "#{WebDriver.root}/
|
8
|
-
:x64 => "#{WebDriver.root}/
|
7
|
+
:win32 => "#{WebDriver.root}/selenium/webdriver/ie/native/win32/InternetExplorerDriver.dll",
|
8
|
+
:x64 => "#{WebDriver.root}/selenium/webdriver/ie/native/x64/InternetExplorerDriver.dll"
|
9
9
|
}
|
10
10
|
end
|
11
11
|
end
|