2015-04-04 09:53:59 -07:00
|
|
|
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
|
|
|
// or more contributor license agreements. See the NOTICE file
|
|
|
|
|
// distributed with this work for additional information
|
|
|
|
|
// regarding copyright ownership. The SFC licenses this file
|
|
|
|
|
// to you under the Apache License, Version 2.0 (the
|
|
|
|
|
// "License"); you may not use this file except in compliance
|
|
|
|
|
// with the License. You may obtain a copy of the License at
|
2014-11-12 19:33:37 +00:00
|
|
|
//
|
2015-04-04 09:53:59 -07:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2014-11-12 19:33:37 +00:00
|
|
|
//
|
2015-04-04 09:53:59 -07:00
|
|
|
// Unless required by applicable law or agreed to in writing,
|
|
|
|
|
// software distributed under the License is distributed on an
|
|
|
|
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
|
// KIND, either express or implied. See the License for the
|
|
|
|
|
// specific language governing permissions and limitations
|
|
|
|
|
// under the License.
|
2011-12-02 23:04:50 +00:00
|
|
|
|
2011-11-30 23:59:48 +00:00
|
|
|
goog.provide('webdriver.test.testutil');
|
2015-01-18 17:04:52 -08:00
|
|
|
goog.provide('webdriver.test.testutil.StubError');
|
2011-11-30 23:59:48 +00:00
|
|
|
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
goog.require('goog.array');
|
2015-01-18 17:04:52 -08:00
|
|
|
goog.require('goog.debug.Error');
|
2011-12-29 02:33:00 +00:00
|
|
|
goog.require('goog.string');
|
|
|
|
|
goog.require('goog.testing.recordFunction');
|
2013-06-14 07:03:52 -07:00
|
|
|
goog.require('webdriver.stacktrace');
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
2015-01-18 17:04:52 -08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A custom error used for testing.
|
|
|
|
|
* @param {string=} opt_msg The error message to use.
|
|
|
|
|
* @constructor
|
|
|
|
|
* @extends {goog.debug.Error}
|
|
|
|
|
* @final
|
|
|
|
|
*/
|
|
|
|
|
webdriver.test.testutil.StubError = function(opt_msg) {
|
|
|
|
|
webdriver.test.testutil.StubError.base(this, 'constructor', opt_msg);
|
|
|
|
|
};
|
|
|
|
|
goog.inherits(webdriver.test.testutil.StubError, goog.debug.Error);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @override */
|
|
|
|
|
webdriver.test.testutil.StubError.prototype.name = 'StubError';
|
|
|
|
|
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
/** @type {Array.<!string>} */
|
2011-12-29 23:45:22 +00:00
|
|
|
webdriver.test.testutil.messages = [];
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
2013-06-14 07:03:52 -07:00
|
|
|
webdriver.test.testutil.getStackTrace = function() {
|
|
|
|
|
return webdriver.stacktrace.get();
|
|
|
|
|
};
|
|
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
webdriver.test.testutil.throwStubError = function() {
|
2015-01-18 17:04:52 -08:00
|
|
|
throw new webdriver.test.testutil.StubError;
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
2011-12-21 18:47:10 +00:00
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
webdriver.test.testutil.assertIsStubError = function(error) {
|
2015-01-18 17:04:52 -08:00
|
|
|
assertTrue(error + ' is not an instanceof StubError',
|
|
|
|
|
error instanceof webdriver.test.testutil.StubError);
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
/**
|
|
|
|
|
* Asserts the contents of the {@link webdriver.test.testutil.messages} array
|
|
|
|
|
* are as expected.
|
|
|
|
|
* @param {...*} var_args The expected contents.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.test.testutil.assertMessages = function(var_args) {
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
var args = Array.prototype.slice.call(arguments, 0);
|
2011-12-29 23:45:22 +00:00
|
|
|
assertArrayEquals(args, webdriver.test.testutil.messages);
|
|
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
/**
|
|
|
|
|
* Wraps a call to {@link webdriver.test.testutil.assertMessages} so it can
|
|
|
|
|
* be passed as a callback.
|
|
|
|
|
* @param {...*} var_args The expected contents.
|
|
|
|
|
* @return {!Function} The wrapped function.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.test.testutil.assertingMessages = function(var_args) {
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
var args = goog.array.slice(arguments, 0);
|
|
|
|
|
return function() {
|
2011-12-29 23:45:22 +00:00
|
|
|
return webdriver.test.testutil.assertMessages.apply(null, args);
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
/**
|
|
|
|
|
* Asserts an object is a promise.
|
|
|
|
|
* @param {*} obj The object to check.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.test.testutil.assertIsPromise = function(obj) {
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
assertTrue('Value is not a promise: ' + goog.typeOf(obj),
|
|
|
|
|
webdriver.promise.isPromise(obj));
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
/**
|
|
|
|
|
* Asserts an object is not a promise.
|
|
|
|
|
* @param {*} obj The object to check.
|
|
|
|
|
*/
|
|
|
|
|
webdriver.test.testutil.assertNotPromise = function(obj) {
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
assertFalse(webdriver.promise.isPromise(obj));
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
2011-11-16 01:32:18 +00:00
|
|
|
/**
|
|
|
|
|
* Wraps a function. The wrapped function will have several utility functions:
|
|
|
|
|
* <ul>
|
|
|
|
|
* <li>assertCalled: Asserts that the function was called.
|
|
|
|
|
* <li>assertNotCalled: Asserts that the function was not called.
|
2013-06-14 07:03:52 -07:00
|
|
|
* </ul>
|
2011-11-16 01:32:18 +00:00
|
|
|
* @param {Function=} opt_fn The function to wrap; defaults to
|
|
|
|
|
* goog.nullFunction.
|
|
|
|
|
* @return {!Function} The wrapped function.
|
2011-12-29 23:45:22 +00:00
|
|
|
* @see goog.testing.recordFunction
|
2011-11-16 01:32:18 +00:00
|
|
|
*/
|
2011-12-29 23:45:22 +00:00
|
|
|
webdriver.test.testutil.callbackHelper = function(opt_fn) {
|
2011-12-29 02:33:00 +00:00
|
|
|
var callback = goog.testing.recordFunction(opt_fn);
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
2011-12-29 02:33:00 +00:00
|
|
|
callback.getExpectedCallCountMessage = function(n, opt_prefix, opt_noJoin) {
|
|
|
|
|
var message = [];
|
|
|
|
|
if (opt_prefix) message.push(opt_prefix);
|
|
|
|
|
|
|
|
|
|
var calls = callback.getCalls();
|
|
|
|
|
message.push(
|
|
|
|
|
'Expected to be called ' + n + ' times.',
|
|
|
|
|
' was called ' + calls.length + ' times:');
|
Update WebDriverJS to support parallel flows. Documentation to follow in a future
update to the WebDriverJs wiki page.
This change renames several low-level classes and functions in the promise module:
promise.Application -> promise.ControlFlow
#schedule(string, function) -> #execute(function, [string])
#scheduleTimeout(string, number) -> #timeout(number, [string])
#scheduleWait(string, function, number, [string]) -> #wait(function, number, [string])
The old schedule* functions are still present, but will print a warning message if called.
They will be removed in 2.31.
This change also renames the //javascript/node:webdriver target to
//javascript/node:selenium-webdriver. We will soon publish the module to npm as
"selenium-webdriver".
Fixes issue 4640.
2013-01-27 15:00:18 -08:00
|
|
|
goog.array.forEach(calls, function(call) {
|
|
|
|
|
var e = call.getError();
|
|
|
|
|
if (e) {
|
|
|
|
|
throw e;
|
|
|
|
|
}
|
|
|
|
|
});
|
2011-12-29 02:33:00 +00:00
|
|
|
return opt_noJoin ? message : message.join('\n');
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
callback.assertCalled = function(opt_message) {
|
2011-12-29 02:33:00 +00:00
|
|
|
assertEquals(callback.getExpectedCallCountMessage(1, opt_message),
|
|
|
|
|
1, callback.getCallCount());
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
callback.assertNotCalled = function(opt_message) {
|
2012-01-20 22:19:16 +00:00
|
|
|
assertEquals(callback.getExpectedCallCountMessage(0, opt_message),
|
2011-12-29 02:33:00 +00:00
|
|
|
0, callback.getCallCount());
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return callback;
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a utility for managing a pair of callbacks, capable of asserting only
|
|
|
|
|
* one of the pair was ever called.
|
|
|
|
|
*
|
|
|
|
|
* @param {Function=} opt_callback The callback to manage.
|
|
|
|
|
* @param {Function=} opt_errback The errback to manage.
|
|
|
|
|
*/
|
2011-12-29 23:45:22 +00:00
|
|
|
webdriver.test.testutil.callbackPair = function(opt_callback, opt_errback) {
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
var pair = {
|
2011-12-29 23:45:22 +00:00
|
|
|
callback: webdriver.test.testutil.callbackHelper(opt_callback),
|
|
|
|
|
errback: webdriver.test.testutil.callbackHelper(opt_errback)
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
Update WebDriverJS to support parallel flows. Documentation to follow in a future
update to the WebDriverJs wiki page.
This change renames several low-level classes and functions in the promise module:
promise.Application -> promise.ControlFlow
#schedule(string, function) -> #execute(function, [string])
#scheduleTimeout(string, number) -> #timeout(number, [string])
#scheduleWait(string, function, number, [string]) -> #wait(function, number, [string])
The old schedule* functions are still present, but will print a warning message if called.
They will be removed in 2.31.
This change also renames the //javascript/node:webdriver target to
//javascript/node:selenium-webdriver. We will soon publish the module to npm as
"selenium-webdriver".
Fixes issue 4640.
2013-01-27 15:00:18 -08:00
|
|
|
/** @param {string=} opt_message Optional failure message. */
|
2011-12-21 18:47:10 +00:00
|
|
|
pair.assertEither = function(opt_message) {
|
2011-12-29 02:33:00 +00:00
|
|
|
if (!pair.callback.getCallCount() &&
|
|
|
|
|
!pair.errback.getCallCount()) {
|
2011-12-21 18:47:10 +00:00
|
|
|
var message = ['Neither callback nor errback has been called'];
|
|
|
|
|
if (opt_message) goog.array.insertAt(message, opt_message);
|
|
|
|
|
fail(message.join('\n'));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
Update WebDriverJS to support parallel flows. Documentation to follow in a future
update to the WebDriverJs wiki page.
This change renames several low-level classes and functions in the promise module:
promise.Application -> promise.ControlFlow
#schedule(string, function) -> #execute(function, [string])
#scheduleTimeout(string, number) -> #timeout(number, [string])
#scheduleWait(string, function, number, [string]) -> #wait(function, number, [string])
The old schedule* functions are still present, but will print a warning message if called.
They will be removed in 2.31.
This change also renames the //javascript/node:webdriver target to
//javascript/node:selenium-webdriver. We will soon publish the module to npm as
"selenium-webdriver".
Fixes issue 4640.
2013-01-27 15:00:18 -08:00
|
|
|
/** @param {string=} opt_message Optional failure message. */
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
pair.assertNeither = function(opt_message) {
|
Update WebDriverJS to support parallel flows. Documentation to follow in a future
update to the WebDriverJs wiki page.
This change renames several low-level classes and functions in the promise module:
promise.Application -> promise.ControlFlow
#schedule(string, function) -> #execute(function, [string])
#scheduleTimeout(string, number) -> #timeout(number, [string])
#scheduleWait(string, function, number, [string]) -> #wait(function, number, [string])
The old schedule* functions are still present, but will print a warning message if called.
They will be removed in 2.31.
This change also renames the //javascript/node:webdriver target to
//javascript/node:selenium-webdriver. We will soon publish the module to npm as
"selenium-webdriver".
Fixes issue 4640.
2013-01-27 15:00:18 -08:00
|
|
|
var message = (opt_message || '') + 'Did not expect callback or errback';
|
|
|
|
|
pair.callback.assertNotCalled(message);
|
|
|
|
|
pair.errback.assertNotCalled(message);
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
Update WebDriverJS to support parallel flows. Documentation to follow in a future
update to the WebDriverJs wiki page.
This change renames several low-level classes and functions in the promise module:
promise.Application -> promise.ControlFlow
#schedule(string, function) -> #execute(function, [string])
#scheduleTimeout(string, number) -> #timeout(number, [string])
#scheduleWait(string, function, number, [string]) -> #wait(function, number, [string])
The old schedule* functions are still present, but will print a warning message if called.
They will be removed in 2.31.
This change also renames the //javascript/node:webdriver target to
//javascript/node:selenium-webdriver. We will soon publish the module to npm as
"selenium-webdriver".
Fixes issue 4640.
2013-01-27 15:00:18 -08:00
|
|
|
/** @param {string=} opt_message Optional failure message. */
|
|
|
|
|
pair.assertCallback = function(opt_message) {
|
|
|
|
|
var message = opt_message ? (opt_message + ': ') : '';
|
|
|
|
|
pair.errback.assertNotCalled(message + 'Expected callback, not errback');
|
|
|
|
|
pair.callback.assertCalled(message + 'Callback not called');
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
Update WebDriverJS to support parallel flows. Documentation to follow in a future
update to the WebDriverJs wiki page.
This change renames several low-level classes and functions in the promise module:
promise.Application -> promise.ControlFlow
#schedule(string, function) -> #execute(function, [string])
#scheduleTimeout(string, number) -> #timeout(number, [string])
#scheduleWait(string, function, number, [string]) -> #wait(function, number, [string])
The old schedule* functions are still present, but will print a warning message if called.
They will be removed in 2.31.
This change also renames the //javascript/node:webdriver target to
//javascript/node:selenium-webdriver. We will soon publish the module to npm as
"selenium-webdriver".
Fixes issue 4640.
2013-01-27 15:00:18 -08:00
|
|
|
/** @param {string=} opt_message Optional failure message. */
|
|
|
|
|
pair.assertErrback = function(opt_message) {
|
|
|
|
|
var message = opt_message ? (opt_message + ': ') : '';
|
|
|
|
|
pair.callback.assertNotCalled(message + 'Expected errback, not callback');
|
|
|
|
|
pair.errback.assertCalled(message + 'Errback not called');
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pair.reset = function() {
|
|
|
|
|
pair.callback.reset();
|
|
|
|
|
pair.errback.reset();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return pair;
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
|
|
|
|
|
|
2011-12-29 23:45:22 +00:00
|
|
|
webdriver.test.testutil.assertObjectEquals = function(expected, actual) {
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
assertObjectEquals(
|
2015-06-18 14:22:02 -07:00
|
|
|
'Expected: ' + JSON.stringify(expected) + '\n' +
|
|
|
|
|
'Actual: ' + JSON.stringify(actual),
|
JasonLeyba: The return of the WebDriver JSAPI. This initial version supports
Firefox, Chrome, IE, and Opera through the Java Selenium server. For the
browsers that support CORS (currently Firefox + webkit), a cross-domain XHR is
used to communicate with the WebDriver server. For the other browsers, we have
to use JSONP. While IE technically supports CORS, it does not support sending
DELETE requests via CORS. Since there are quite a few DELETE commands in the
wire protocol, we have to use JSONP for IE too (yay, IE).
To create a deployable webdriver.js, run $./go webdriverjs
The generated file (build/javascript/webdriver-jsapi/webdriver.js) can be used
in either the browser or with node.
WebDriverJS may only be used in a browser already under WebDriver's control.
Furthermore, the WebDriver server URL and session ID must be passed to the
script via the wdurl and wdsid query parameters, respectively. To help with
debugging, this change includes a simple Node app:
$ ./go webdriverjs build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ java -jar build/java/server/src/org/openqa/selenium/server/server-standalone.jar
$ node javascript/webdriver-jsapi/node/demo.js --help
To manually run the browser demo tests:
$ ./go debug-server
$ node javascript/webdriver-jsapi/node/demo.js \
--browser=chrome \
--wdUrl=http://localhost:4444/wd/hub \
--url=http://localhost:2310/javascript/webdriver-jsapi/test/e2e/example_test.html
There's still a lot to do:
- Fix the :webdriverjs build task
- Wiki/design documentation
- Improve the debug story (as in, write one)
- Write a pure-JS command executor using the atoms. This could theoretically
be used to replace Selenium Core
- Better Node integration
r14327
2011-10-22 01:15:11 +00:00
|
|
|
expected, actual);
|
2011-12-29 23:45:22 +00:00
|
|
|
};
|