selenium-webdriver 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/chrome/src/extension/background.js +19 -14
- data/chrome/src/extension/manifest-nonwin.json +1 -2
- data/chrome/src/extension/manifest-win.json +1 -2
- data/chrome/src/rb/lib/selenium/webdriver/chrome/bridge.rb +5 -1
- data/common/src/js/abstractcommandprocessor.js +0 -33
- data/common/src/js/asserts.js +2 -2
- data/common/src/js/by.js +2 -0
- data/common/src/js/command.js +130 -36
- data/common/src/js/future.js +42 -23
- data/common/src/js/localcommandprocessor.js +0 -1
- data/common/src/js/testrunner.js +9 -16
- data/common/src/js/webdriver.js +225 -254
- data/common/src/js/webelement.js +76 -197
- data/common/src/rb/lib/selenium/webdriver/driver.rb +4 -0
- data/common/src/rb/lib/selenium/webdriver/element.rb +4 -0
- data/firefox/src/extension/components/badCertListener.js +186 -0
- data/firefox/src/extension/components/firefoxDriver.js +7 -16
- data/firefox/src/extension/components/nsCommandProcessor.js +10 -9
- data/firefox/src/extension/components/utils.js +5 -5
- data/firefox/src/extension/components/webdriverserver.js +5 -0
- data/firefox/src/extension/components/wrappedElement.js +10 -6
- data/firefox/src/rb/lib/selenium/webdriver/firefox/bridge.rb +11 -12
- data/firefox/src/rb/lib/selenium/webdriver/firefox/extension_connection.rb +2 -2
- data/firefox/src/rb/lib/selenium/webdriver/firefox/profile.rb +2 -1
- metadata +3 -4
- data/chrome/src/extension/toolstrip.html +0 -28
- data/common/src/js/wait.js +0 -199
@@ -21,7 +21,7 @@ module Selenium
|
|
21
21
|
}
|
22
22
|
|
23
23
|
attr_reader :name, :directory
|
24
|
-
attr_accessor :port
|
24
|
+
attr_accessor :port, :secure_ssl
|
25
25
|
|
26
26
|
class << self
|
27
27
|
|
@@ -60,6 +60,7 @@ module Selenium
|
|
60
60
|
def update_user_prefs
|
61
61
|
prefs = existing_user_prefs.merge DEFAULT_PREFERENCES
|
62
62
|
prefs['webdriver.firefox_port'] = @port
|
63
|
+
prefs['webdriver_accept_untrusted_certs'] = "true" unless @secure_ssl == true
|
63
64
|
|
64
65
|
write_prefs prefs
|
65
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-webdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-29 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -91,7 +91,6 @@ files:
|
|
91
91
|
- common/src/js/logging.js
|
92
92
|
- common/src/js/testrunner.js
|
93
93
|
- common/src/js/timing.js
|
94
|
-
- common/src/js/wait.js
|
95
94
|
- common/src/js/webdriver.js
|
96
95
|
- common/src/js/webelement.js
|
97
96
|
- firefox/src/rb/lib/selenium/webdriver/firefox/binary.rb
|
@@ -103,6 +102,7 @@ files:
|
|
103
102
|
- firefox/src/rb/lib/selenium/webdriver/firefox/util.rb
|
104
103
|
- firefox/src/rb/lib/selenium/webdriver/firefox.rb
|
105
104
|
- firefox/src/extension/chrome.manifest
|
105
|
+
- firefox/src/extension/components/badCertListener.js
|
106
106
|
- firefox/src/extension/components/context.js
|
107
107
|
- firefox/src/extension/components/driver-component.js
|
108
108
|
- firefox/src/extension/components/firefoxDriver.js
|
@@ -135,7 +135,6 @@ files:
|
|
135
135
|
- chrome/src/extension/icons/free.png
|
136
136
|
- chrome/src/extension/manifest-nonwin.json
|
137
137
|
- chrome/src/extension/manifest-win.json
|
138
|
-
- chrome/src/extension/toolstrip.html
|
139
138
|
- chrome/src/extension/utils.js
|
140
139
|
- chrome/prebuilt/Win32/Release/npchromedriver.dll
|
141
140
|
- chrome/prebuilt/x64/Release/npchromedriver.dll
|
@@ -1,28 +0,0 @@
|
|
1
|
-
<html>
|
2
|
-
<head>
|
3
|
-
<script type="text/javascript">
|
4
|
-
function setWebdriverToolstripBusy() {
|
5
|
-
document.getElementById("toolstripText").className = "toolstripTextBusy";
|
6
|
-
}
|
7
|
-
|
8
|
-
function setWebdriverToolstripFree() {
|
9
|
-
document.getElementById("toolstripText").className = "toolstripTextFree";
|
10
|
-
}
|
11
|
-
</script>
|
12
|
-
|
13
|
-
<style type="text/css">
|
14
|
-
.toolstripTextBusy {
|
15
|
-
color: red;
|
16
|
-
}
|
17
|
-
|
18
|
-
.toolstripTextFree {
|
19
|
-
color: black;
|
20
|
-
}
|
21
|
-
</style>
|
22
|
-
</head>
|
23
|
-
<body>
|
24
|
-
<div>
|
25
|
-
<span id="toolstripText" class="toolstripTextFree">WebDriver</span>
|
26
|
-
</div>
|
27
|
-
</body>
|
28
|
-
</html>
|
data/common/src/js/wait.js
DELETED
@@ -1,199 +0,0 @@
|
|
1
|
-
/** @license
|
2
|
-
Copyright 2007-2009 WebDriver committers
|
3
|
-
Copyright 2007-2009 Google Inc.
|
4
|
-
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
you may not use this file except in compliance with the License.
|
7
|
-
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, software
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
See the License for the specific language governing permissions and
|
15
|
-
limitations under the License.
|
16
|
-
*/
|
17
|
-
|
18
|
-
/**
|
19
|
-
* @fileoverview Defines a mechanism for blocking {@code webdriver.WebDriver}
|
20
|
-
* command execution on user-defined conditions.
|
21
|
-
* @author jmleyba@gmail.com (Jason Leyba)
|
22
|
-
*/
|
23
|
-
|
24
|
-
goog.provide('webdriver.Wait');
|
25
|
-
|
26
|
-
goog.require('goog.events');
|
27
|
-
goog.require('webdriver.Future');
|
28
|
-
goog.require('webdriver.timing');
|
29
|
-
|
30
|
-
|
31
|
-
/**
|
32
|
-
* Controls polling a condition that a {@code webdriver.WebDriver} instance
|
33
|
-
* should block command execution on.
|
34
|
-
* @param {function} conditionFn The condition function that the driver will
|
35
|
-
* poll. The function should require no arguments and return a boolean or a
|
36
|
-
* {@code webdriver.Future} that will evaluate to a boolean.
|
37
|
-
* @param {number} timeout The amount of time to wait, in milliseconds, for the
|
38
|
-
* condition to hold.
|
39
|
-
* @constructor
|
40
|
-
* @private
|
41
|
-
*/
|
42
|
-
webdriver.Wait = function(conditionFn, timeout) {
|
43
|
-
|
44
|
-
/**
|
45
|
-
* Function to call for evaluating the condition being waited on.
|
46
|
-
* @type {function: boolean}
|
47
|
-
* @private
|
48
|
-
*/
|
49
|
-
this.conditionFn_ = conditionFn;
|
50
|
-
|
51
|
-
/**
|
52
|
-
* The maximum amount of time in milliseconds to wait for condition.
|
53
|
-
* @type {number}
|
54
|
-
* @private
|
55
|
-
*/
|
56
|
-
this.timeout_ = timeout;
|
57
|
-
|
58
|
-
/**
|
59
|
-
* When the wait began. Set on the first call to {@code #start()}.
|
60
|
-
* @type {number}
|
61
|
-
* @private
|
62
|
-
*/
|
63
|
-
this.started_ = 0;
|
64
|
-
|
65
|
-
/**
|
66
|
-
* ID of the timeout timer. Initialized on the first call to {@code #start()}.
|
67
|
-
* @type {number}
|
68
|
-
* @private
|
69
|
-
*/
|
70
|
-
this.timeoutId_ = null;
|
71
|
-
|
72
|
-
/**
|
73
|
-
* ID of the interval timer. Initialized on the first call to
|
74
|
-
* {@code #start()}.
|
75
|
-
* @type {number}
|
76
|
-
* @private
|
77
|
-
*/
|
78
|
-
this.pollingIntervalId_ = null;
|
79
|
-
|
80
|
-
/**
|
81
|
-
* Whether to wait on the inverse of the wait condition.
|
82
|
-
* @type {boolean}
|
83
|
-
* @private
|
84
|
-
*/
|
85
|
-
this.waitOnInverse_ = false;
|
86
|
-
};
|
87
|
-
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Set this instance to wait for the inverse of its condition.
|
91
|
-
* @param {boolean} wait Whether to wait for the inverse of the condition.
|
92
|
-
*/
|
93
|
-
webdriver.Wait.prototype.waitOnInverse = function(wait) {
|
94
|
-
this.waitOnInverse_ = wait;
|
95
|
-
};
|
96
|
-
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Starts the timer the and starts evaluating the condition.
|
100
|
-
* @param {function} callbackFn The function to call with the result. The
|
101
|
-
* function should take 3 arguments: a boolean for whether the wait timed
|
102
|
-
* out (will only be true on a timeout), the amount of time spent in the
|
103
|
-
* wait. The 3rd parameter will be an Error, if any, that caused the wait
|
104
|
-
* to abort early.
|
105
|
-
*/
|
106
|
-
webdriver.Wait.prototype.start = function(callbackFn) {
|
107
|
-
if (!!!this.started_) {
|
108
|
-
this.started_ = goog.now();
|
109
|
-
|
110
|
-
var tickHandler = goog.bind(this.onTick_, this, callbackFn);
|
111
|
-
var timeoutHandler = goog.bind(this.onTimeout_, this, callbackFn);
|
112
|
-
|
113
|
-
this.pollingIntervalId_ = webdriver.timing.setInterval(tickHandler, 5);
|
114
|
-
this.timeoutId_ =
|
115
|
-
webdriver.timing.setTimeout(timeoutHandler, this.timeout_);
|
116
|
-
|
117
|
-
this.onTick_(callbackFn);
|
118
|
-
}
|
119
|
-
};
|
120
|
-
|
121
|
-
|
122
|
-
/**
|
123
|
-
* Callback for when the wait times out.
|
124
|
-
* @param {function} callbackFn The function to call with the result.
|
125
|
-
* @private
|
126
|
-
*/
|
127
|
-
webdriver.Wait.prototype.onTimeout_ = function(callbackFn) {
|
128
|
-
webdriver.timing.clearInterval(this.pollingIntervalId_);
|
129
|
-
if (this.pendingFuture_) {
|
130
|
-
this.pendingFuture_.dispose();
|
131
|
-
}
|
132
|
-
callbackFn(true, goog.now() - this.started_);
|
133
|
-
};
|
134
|
-
|
135
|
-
|
136
|
-
/**
|
137
|
-
* Evaluates the wait condition and determines whether to abort the wait.
|
138
|
-
* @param {function} callbackFn The function to call with the result.
|
139
|
-
* @private
|
140
|
-
*/
|
141
|
-
webdriver.Wait.prototype.onTick_ = function(callbackFn) {
|
142
|
-
if (this.pendingFuture_) {
|
143
|
-
return;
|
144
|
-
}
|
145
|
-
|
146
|
-
var elapsed = goog.now() - this.started_;
|
147
|
-
var value;
|
148
|
-
try {
|
149
|
-
value = this.conditionFn_();
|
150
|
-
if (value instanceof webdriver.Future) {
|
151
|
-
if (value.isSet() &&
|
152
|
-
this.checkValue_(value.getValue(), elapsed, callbackFn)) {
|
153
|
-
return;
|
154
|
-
}
|
155
|
-
|
156
|
-
this.pendingFuture_ = value;
|
157
|
-
goog.events.listenOnce(value, goog.events.EventType.CHANGE, function() {
|
158
|
-
this.pendingFuture_ = null;
|
159
|
-
this.checkValue_(value.getValue(), goog.now() - this.started_,
|
160
|
-
callbackFn);
|
161
|
-
}, false, this);
|
162
|
-
|
163
|
-
} else {
|
164
|
-
this.checkValue_(value, elapsed, callbackFn);
|
165
|
-
}
|
166
|
-
|
167
|
-
} catch (ex) {
|
168
|
-
webdriver.timing.clearInterval(this.pollingIntervalId_);
|
169
|
-
webdriver.timing.clearTimeout(this.timeoutId_);
|
170
|
-
if (this.pendingFuture_) {
|
171
|
-
this.pendingFuture_.dispose();
|
172
|
-
}
|
173
|
-
callbackFn(true, elapsed, ex);
|
174
|
-
}
|
175
|
-
};
|
176
|
-
|
177
|
-
|
178
|
-
/**
|
179
|
-
* Checks the value returned by the condition function.
|
180
|
-
* @param {boolean} value The result of the condition function.
|
181
|
-
* @param {number} elapsed The time elapsed since the wait started.
|
182
|
-
* @param {function} callbackFn The function to call with the result.
|
183
|
-
* @private
|
184
|
-
*/
|
185
|
-
webdriver.Wait.prototype.checkValue_ = function(value, elapsed, callbackFn) {
|
186
|
-
value = !!value;
|
187
|
-
if (this.waitOnInverse_) {
|
188
|
-
value = !value;
|
189
|
-
}
|
190
|
-
if (value) {
|
191
|
-
webdriver.timing.clearInterval(this.pollingIntervalId_);
|
192
|
-
webdriver.timing.clearTimeout(this.timeoutId_);
|
193
|
-
if (this.pendingFuture_) {
|
194
|
-
this.pendingFuture_.dispose();
|
195
|
-
}
|
196
|
-
callbackFn(false, elapsed);
|
197
|
-
}
|
198
|
-
return value;
|
199
|
-
};
|