selenium-webdriver 2.43.5 → 2.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +20 -0
- package/README.md +8 -13
- package/builder.js +4 -3
- package/docs/class_webdriver_Alert.html +6 -6
- package/docs/class_webdriver_AlertPromise.html +6 -6
- package/docs/class_webdriver_UnhandledAlertError.html +4 -4
- package/docs/class_webdriver_WebDriver.html +39 -37
- package/docs/class_webdriver_WebDriver_Logs.html +3 -3
- package/docs/class_webdriver_WebDriver_Navigation.html +5 -5
- package/docs/class_webdriver_WebDriver_Options.html +9 -9
- package/docs/class_webdriver_WebDriver_TargetLocator.html +6 -6
- package/docs/class_webdriver_WebDriver_Timeouts.html +4 -4
- package/docs/class_webdriver_WebDriver_Window.html +6 -6
- package/docs/class_webdriver_WebElement.html +23 -23
- package/docs/class_webdriver_WebElementPromise.html +22 -22
- package/docs/class_webdriver_promise_CancellationError.html +3 -0
- package/docs/class_webdriver_promise_ControlFlow.html +32 -32
- package/docs/class_webdriver_promise_Deferred.html +7 -8
- package/docs/class_webdriver_promise_Frame_.html +14 -30
- package/docs/class_webdriver_promise_Promise.html +2 -2
- package/docs/class_webdriver_promise_Task_.html +12 -12
- package/docs/class_webdriver_until_Condition.html +3 -0
- package/docs/enum_webdriver_Key.html +1 -1
- package/docs/enum_webdriver_promise_ControlFlow_EventType.html +1 -1
- package/docs/enum_webdriver_promise_Deferred_State_.html +1 -1
- package/docs/index.html +8 -13
- package/docs/interface_webdriver_promise_Thenable.html +8 -10
- package/docs/license.html +1 -1
- package/docs/module_selenium-webdriver.html +2 -2
- package/docs/module_selenium-webdriver__base.html +1 -1
- package/docs/module_selenium-webdriver__base_class_Context.html +1 -1
- package/docs/module_selenium-webdriver_builder.html +1 -1
- package/docs/module_selenium-webdriver_builder_class_Builder.html +1 -1
- package/docs/module_selenium-webdriver_chrome.html +1 -1
- package/docs/module_selenium-webdriver_chrome_class_Driver.html +2 -2
- package/docs/module_selenium-webdriver_chrome_class_Options.html +2 -2
- package/docs/module_selenium-webdriver_chrome_class_ServiceBuilder.html +1 -1
- package/docs/module_selenium-webdriver_error.html +1 -1
- package/docs/module_selenium-webdriver_executors.html +1 -1
- package/docs/module_selenium-webdriver_firefox.html +1 -1
- package/docs/module_selenium-webdriver_firefox_binary.html +1 -1
- package/docs/module_selenium-webdriver_firefox_binary_class_Binary.html +1 -1
- package/docs/module_selenium-webdriver_firefox_class_Driver.html +2 -2
- package/docs/module_selenium-webdriver_firefox_class_Options.html +1 -1
- package/docs/module_selenium-webdriver_firefox_extension.html +1 -1
- package/docs/module_selenium-webdriver_firefox_profile.html +1 -1
- package/docs/module_selenium-webdriver_firefox_profile_class_Profile.html +1 -1
- package/docs/module_selenium-webdriver_http.html +1 -1
- package/docs/module_selenium-webdriver_http_class_HttpClient.html +1 -1
- package/docs/module_selenium-webdriver_http_util.html +1 -1
- package/docs/module_selenium-webdriver_io.html +1 -1
- package/docs/module_selenium-webdriver_io_exec.html +1 -1
- package/docs/module_selenium-webdriver_net.html +1 -1
- package/docs/module_selenium-webdriver_net_portprober.html +1 -1
- package/docs/module_selenium-webdriver_phantomjs.html +1 -1
- package/docs/module_selenium-webdriver_phantomjs_class_Driver.html +2 -2
- package/docs/module_selenium-webdriver_proxy.html +1 -1
- package/docs/module_selenium-webdriver_remote.html +1 -1
- package/docs/module_selenium-webdriver_remote_class_DriverService.html +2 -2
- package/docs/module_selenium-webdriver_remote_class_SeleniumServer.html +2 -2
- package/docs/module_selenium-webdriver_testing.html +16 -29
- package/docs/module_selenium-webdriver_testing_assert.html +1 -1
- package/docs/namespace_webdriver_promise.html +18 -20
- package/docs/namespace_webdriver_stacktrace.html +15 -15
- package/docs/namespace_webdriver_until.html +32 -0
- package/docs/source/_base.js.src.html +1 -1
- package/docs/source/builder.js.src.html +1 -1
- package/docs/source/chrome.js.src.html +1 -1
- package/docs/source/error.js.src.html +1 -1
- package/docs/source/executors.js.src.html +1 -1
- package/docs/source/firefox/binary.js.src.html +1 -1
- package/docs/source/firefox/extension.js.src.html +1 -1
- package/docs/source/firefox/index.js.src.html +1 -1
- package/docs/source/firefox/profile.js.src.html +1 -1
- package/docs/source/http/index.js.src.html +1 -1
- package/docs/source/http/util.js.src.html +1 -1
- package/docs/source/index.js.src.html +1 -1
- package/docs/source/io/exec.js.src.html +1 -1
- package/docs/source/io/index.js.src.html +1 -1
- package/docs/source/lib/atoms/error.js.src.html +1 -1
- package/docs/source/lib/atoms/json.js.src.html +1 -1
- package/docs/source/lib/atoms/response.js.src.html +1 -1
- package/docs/source/lib/atoms/userAgent.js.src.html +1 -1
- package/docs/source/lib/goog/array/array.js.src.html +1 -1
- package/docs/source/lib/goog/asserts/asserts.js.src.html +1 -1
- package/docs/source/lib/goog/async/nexttick.js.src.html +1 -1
- package/docs/source/lib/goog/async/run.js.src.html +1 -1
- package/docs/source/lib/goog/base.js.src.html +1 -1
- package/docs/source/lib/goog/debug/debug.js.src.html +1 -1
- package/docs/source/lib/goog/debug/entrypointregistry.js.src.html +1 -1
- package/docs/source/lib/goog/debug/error.js.src.html +1 -1
- package/docs/source/lib/goog/debug/logbuffer.js.src.html +1 -1
- package/docs/source/lib/goog/debug/logger.js.src.html +1 -1
- package/docs/source/lib/goog/debug/logrecord.js.src.html +1 -1
- package/docs/source/lib/goog/deps.js.src.html +1 -1
- package/docs/source/lib/goog/disposable/disposable.js.src.html +1 -1
- package/docs/source/lib/goog/disposable/idisposable.js.src.html +1 -1
- package/docs/source/lib/goog/dom/browserfeature.js.src.html +1 -1
- package/docs/source/lib/goog/dom/dom.js.src.html +1 -1
- package/docs/source/lib/goog/dom/nodetype.js.src.html +1 -1
- package/docs/source/lib/goog/dom/tagname.js.src.html +1 -1
- package/docs/source/lib/goog/dom/vendor.js.src.html +1 -1
- package/docs/source/lib/goog/events/browserevent.js.src.html +1 -1
- package/docs/source/lib/goog/events/browserfeature.js.src.html +1 -1
- package/docs/source/lib/goog/events/event.js.src.html +1 -1
- package/docs/source/lib/goog/events/eventid.js.src.html +1 -1
- package/docs/source/lib/goog/events/events.js.src.html +1 -1
- package/docs/source/lib/goog/events/eventtarget.js.src.html +1 -1
- package/docs/source/lib/goog/events/eventtype.js.src.html +1 -1
- package/docs/source/lib/goog/events/keycodes.js.src.html +1 -1
- package/docs/source/lib/goog/events/listenable.js.src.html +1 -1
- package/docs/source/lib/goog/events/listener.js.src.html +1 -1
- package/docs/source/lib/goog/events/listenermap.js.src.html +1 -1
- package/docs/source/lib/goog/functions/functions.js.src.html +1 -1
- package/docs/source/lib/goog/iter/iter.js.src.html +1 -1
- package/docs/source/lib/goog/json/json.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/assertthat.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/logicmatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/matcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/numbermatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/objectmatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/testing/stringmatcher.js.src.html +1 -1
- package/docs/source/lib/goog/labs/useragent/browser.js.src.html +1 -1
- package/docs/source/lib/goog/labs/useragent/engine.js.src.html +1 -1
- package/docs/source/lib/goog/labs/useragent/util.js.src.html +1 -1
- package/docs/source/lib/goog/math/box.js.src.html +1 -1
- package/docs/source/lib/goog/math/coordinate.js.src.html +1 -1
- package/docs/source/lib/goog/math/math.js.src.html +1 -1
- package/docs/source/lib/goog/math/rect.js.src.html +1 -1
- package/docs/source/lib/goog/math/size.js.src.html +1 -1
- package/docs/source/lib/goog/net/wrapperxmlhttpfactory.js.src.html +1 -1
- package/docs/source/lib/goog/net/xhrlike.js.src.html +1 -1
- package/docs/source/lib/goog/net/xmlhttp.js.src.html +1 -1
- package/docs/source/lib/goog/net/xmlhttpfactory.js.src.html +1 -1
- package/docs/source/lib/goog/object/object.js.src.html +1 -1
- package/docs/source/lib/goog/reflect/reflect.js.src.html +1 -1
- package/docs/source/lib/goog/string/string.js.src.html +1 -1
- package/docs/source/lib/goog/structs/collection.js.src.html +1 -1
- package/docs/source/lib/goog/structs/map.js.src.html +1 -1
- package/docs/source/lib/goog/structs/set.js.src.html +1 -1
- package/docs/source/lib/goog/structs/structs.js.src.html +1 -1
- package/docs/source/lib/goog/style/style.js.src.html +1 -1
- package/docs/source/lib/goog/testing/asserts.js.src.html +1 -1
- package/docs/source/lib/goog/testing/asynctestcase.js.src.html +1 -1
- package/docs/source/lib/goog/testing/events/events.js.src.html +1 -1
- package/docs/source/lib/goog/testing/functionmock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/jsunit.js.src.html +1 -1
- package/docs/source/lib/goog/testing/loosemock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockclock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockcontrol.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockinterface.js.src.html +1 -1
- package/docs/source/lib/goog/testing/mockmatchers.js.src.html +1 -1
- package/docs/source/lib/goog/testing/objectpropertystring.js.src.html +1 -1
- package/docs/source/lib/goog/testing/propertyreplacer.js.src.html +1 -1
- package/docs/source/lib/goog/testing/recordfunction.js.src.html +1 -1
- package/docs/source/lib/goog/testing/stacktrace.js.src.html +1 -1
- package/docs/source/lib/goog/testing/strictmock.js.src.html +1 -1
- package/docs/source/lib/goog/testing/testcase.js.src.html +1 -1
- package/docs/source/lib/goog/testing/testrunner.js.src.html +1 -1
- package/docs/source/lib/goog/testing/watchers.js.src.html +1 -1
- package/docs/source/lib/goog/uri/uri.js.src.html +1 -1
- package/docs/source/lib/goog/uri/utils.js.src.html +1 -1
- package/docs/source/lib/goog/useragent/product.js.src.html +1 -1
- package/docs/source/lib/goog/useragent/product_isversion.js.src.html +1 -1
- package/docs/source/lib/goog/useragent/useragent.js.src.html +1 -1
- package/docs/source/lib/webdriver/abstractbuilder.js.src.html +1 -1
- package/docs/source/lib/webdriver/actionsequence.js.src.html +1 -1
- package/docs/source/lib/webdriver/builder.js.src.html +1 -1
- package/docs/source/lib/webdriver/button.js.src.html +1 -1
- package/docs/source/lib/webdriver/capabilities.js.src.html +1 -1
- package/docs/source/lib/webdriver/command.js.src.html +1 -1
- package/docs/source/lib/webdriver/events.js.src.html +1 -1
- package/docs/source/lib/webdriver/firefoxdomexecutor.js.src.html +1 -1
- package/docs/source/lib/webdriver/http/corsclient.js.src.html +1 -1
- package/docs/source/lib/webdriver/http/http.js.src.html +1 -1
- package/docs/source/lib/webdriver/http/xhrclient.js.src.html +1 -1
- package/docs/source/lib/webdriver/key.js.src.html +1 -1
- package/docs/source/lib/webdriver/locators.js.src.html +1 -1
- package/docs/source/lib/webdriver/logging.js.src.html +1 -1
- package/docs/source/lib/webdriver/process.js.src.html +1 -1
- package/docs/source/lib/webdriver/promise.js.src.html +1 -1
- package/docs/source/lib/webdriver/session.js.src.html +1 -1
- package/docs/source/lib/webdriver/stacktrace.js.src.html +1 -1
- package/docs/source/lib/webdriver/testing/asserts.js.src.html +1 -1
- package/docs/source/lib/webdriver/testing/testcase.js.src.html +1 -1
- package/docs/source/lib/webdriver/until.js.src.html +1 -0
- package/docs/source/lib/webdriver/webdriver.js.src.html +1 -1
- package/docs/source/net/index.js.src.html +1 -1
- package/docs/source/net/portprober.js.src.html +1 -1
- package/docs/source/phantomjs.js.src.html +1 -1
- package/docs/source/proxy.js.src.html +1 -1
- package/docs/source/remote/index.js.src.html +1 -1
- package/docs/source/testing/assert.js.src.html +1 -1
- package/docs/source/testing/index.js.src.html +1 -1
- package/docs/types.js +1 -1
- package/example/google_search.js +9 -17
- package/example/google_search_generator.js +6 -7
- package/example/google_search_test.js +10 -18
- package/example/parallel_flows.js +4 -7
- package/index.js +6 -0
- package/lib/firefox/webdriver.xpi +0 -0
- package/lib/goog/deps.js +7 -5
- package/lib/test/index.js +0 -8
- package/lib/webdriver/promise.js +263 -251
- package/lib/webdriver/stacktrace.js +15 -1
- package/lib/webdriver/test/promise_flow_test.js +82 -76
- package/lib/webdriver/test/promise_test.js +22 -62
- package/lib/webdriver/test/stacktrace_test.js +18 -0
- package/lib/webdriver/test/until_test.js +388 -0
- package/lib/webdriver/test/webdriver_test.js +41 -0
- package/lib/webdriver/until.js +408 -0
- package/lib/webdriver/webdriver.js +91 -29
- package/package.json +2 -2
- package/test/element_finding_test.js +6 -6
- package/test/http/util_test.js +4 -5
- package/test/page_loading_test.js +7 -7
- package/test/stale_element_test.js +2 -10
- package/testing/index.js +9 -22
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
var By = require('..').By,
|
|
19
19
|
ErrorCode = require('..').error.ErrorCode,
|
|
20
|
+
until = require('..').until,
|
|
20
21
|
assert = require('../testing/assert'),
|
|
21
22
|
test = require('../lib/test'),
|
|
22
23
|
Browser = test.Browser,
|
|
@@ -24,8 +25,7 @@ var By = require('..').By,
|
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
test.suite(function(env) {
|
|
27
|
-
var browsers = env.browsers
|
|
28
|
-
waitForTitleToBe = env.waitForTitleToBe;
|
|
28
|
+
var browsers = env.browsers;
|
|
29
29
|
|
|
30
30
|
var driver;
|
|
31
31
|
beforeEach(function() { driver = env.driver; });
|
|
@@ -74,7 +74,7 @@ test.suite(function(env) {
|
|
|
74
74
|
driver.get(Pages.formPage);
|
|
75
75
|
|
|
76
76
|
driver.findElement(By.id('imageButton')).click();
|
|
77
|
-
|
|
77
|
+
driver.wait(until.titleIs('We Arrive Here'), 5000);
|
|
78
78
|
|
|
79
79
|
driver.navigate().back();
|
|
80
80
|
assert(driver.getTitle()).equalTo('We Leave From Here');
|
|
@@ -85,7 +85,7 @@ test.suite(function(env) {
|
|
|
85
85
|
driver.get(Pages.xhtmlTestPage);
|
|
86
86
|
|
|
87
87
|
driver.findElement(By.name('sameWindow')).click();
|
|
88
|
-
|
|
88
|
+
driver.wait(until.titleIs('This page has iframes'), 5000);
|
|
89
89
|
|
|
90
90
|
driver.navigate().back();
|
|
91
91
|
assert(driver.getTitle()).equalTo('XHTML Test Page');
|
|
@@ -96,13 +96,13 @@ test.suite(function(env) {
|
|
|
96
96
|
driver.get(Pages.formPage);
|
|
97
97
|
|
|
98
98
|
driver.findElement(By.id('imageButton')).click();
|
|
99
|
-
|
|
99
|
+
driver.wait(until.titleIs('We Arrive Here'), 5000);
|
|
100
100
|
|
|
101
101
|
driver.navigate().back();
|
|
102
|
-
|
|
102
|
+
driver.wait(until.titleIs('We Leave From Here'), 5000);
|
|
103
103
|
|
|
104
104
|
driver.navigate().forward();
|
|
105
|
-
|
|
105
|
+
driver.wait(until.titleIs('We Arrive Here'), 5000);
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
test.it('should be able to refresh a page', function() {
|
|
@@ -19,6 +19,7 @@ var fail = require('assert').fail;
|
|
|
19
19
|
|
|
20
20
|
var By = require('..').By,
|
|
21
21
|
error = require('..').error,
|
|
22
|
+
until = require('..').until,
|
|
22
23
|
assert = require('../testing/assert'),
|
|
23
24
|
test = require('../lib/test'),
|
|
24
25
|
Browser = test.Browser,
|
|
@@ -39,16 +40,7 @@ test.suite(function(env) {
|
|
|
39
40
|
assert(toBeDeleted.isDisplayed()).isTrue();
|
|
40
41
|
|
|
41
42
|
driver.findElement(By.id('delete')).click();
|
|
42
|
-
driver.wait(
|
|
43
|
-
return toBeDeleted.isDisplayed().
|
|
44
|
-
then(function() { return false; }).
|
|
45
|
-
then(null, function(e) {
|
|
46
|
-
if (e.code === error.ErrorCode.STALE_ELEMENT_REFERENCE) {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
throw e;
|
|
50
|
-
});
|
|
51
|
-
}, 5000, 'Element should be stale at this point');
|
|
43
|
+
driver.wait(until.stalenessOf(toBeDeleted), 5000);
|
|
52
44
|
});
|
|
53
45
|
|
|
54
46
|
test.it('an element found in a different frame is stale', function() {
|
package/testing/index.js
CHANGED
|
@@ -30,40 +30,27 @@
|
|
|
30
30
|
* <p>The provided wrappers leverage the {@link webdriver.promise.ControlFlow}
|
|
31
31
|
* to simplify writing asynchronous tests:
|
|
32
32
|
* <pre><code>
|
|
33
|
-
* var
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* var By = require('selenium-webdriver').By,
|
|
34
|
+
* until = require('selenium-webdriver').until,
|
|
35
|
+
* firefox = require('selenium-webdriver/firefox'),
|
|
36
36
|
* test = require('selenium-webdriver/testing');
|
|
37
37
|
*
|
|
38
38
|
* test.describe('Google Search', function() {
|
|
39
|
-
* var driver
|
|
39
|
+
* var driver;
|
|
40
40
|
*
|
|
41
41
|
* test.before(function() {
|
|
42
|
-
*
|
|
43
|
-
* 'path/to/selenium-server-standalone.jar',
|
|
44
|
-
* {port: portprober.findFreePort()});
|
|
45
|
-
* server.start();
|
|
46
|
-
*
|
|
47
|
-
* driver = new webdriver.Builder().
|
|
48
|
-
* withCapabilities({'browserName': 'firefox'}).
|
|
49
|
-
* usingServer(server.address()).
|
|
50
|
-
* build();
|
|
42
|
+
* driver = new firefox.Driver();
|
|
51
43
|
* });
|
|
52
44
|
*
|
|
53
45
|
* test.after(function() {
|
|
54
46
|
* driver.quit();
|
|
55
|
-
* server.stop();
|
|
56
47
|
* });
|
|
57
48
|
*
|
|
58
49
|
* test.it('should append query to title', function() {
|
|
59
|
-
* driver.get('http://www.google.com');
|
|
60
|
-
* driver.findElement(
|
|
61
|
-
* driver.findElement(
|
|
62
|
-
* driver.wait(
|
|
63
|
-
* return driver.getTitle().then(function(title) {
|
|
64
|
-
* return 'webdriver - Google Search' === title;
|
|
65
|
-
* });
|
|
66
|
-
* }, 1000, 'Waiting for title to update');
|
|
50
|
+
* driver.get('http://www.google.com/ncr');
|
|
51
|
+
* driver.findElement(By.name('q')).sendKeys('webdriver');
|
|
52
|
+
* driver.findElement(By.name('btnG')).click();
|
|
53
|
+
* driver.wait(until.titleIs('webdriver - Google Search'), 1000);
|
|
67
54
|
* });
|
|
68
55
|
* });
|
|
69
56
|
* </code></pre>
|