diff options
| author | Florian Dold <florian.dold@gmail.com> | 2016-11-16 01:59:39 +0100 |
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2016-11-16 02:00:31 +0100 |
| commit | bd65bb67e25a79b019d745b7262b2008ce2adb15 (patch) | |
| tree | 89e1b032103a63737f1a703e6a943832ef261704 /node_modules/selenium-webdriver/test/phantomjs | |
| parent | f91466595b651721690133f58ab37f977539e95b (diff) | |
incrementally verify denoms
The denominations are not stored in a separate object store.
Diffstat (limited to 'node_modules/selenium-webdriver/test/phantomjs')
| -rw-r--r-- | node_modules/selenium-webdriver/test/phantomjs/execute_phantomjs_test.js | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/node_modules/selenium-webdriver/test/phantomjs/execute_phantomjs_test.js b/node_modules/selenium-webdriver/test/phantomjs/execute_phantomjs_test.js index 82a814a31..8b7a99f8d 100644 --- a/node_modules/selenium-webdriver/test/phantomjs/execute_phantomjs_test.js +++ b/node_modules/selenium-webdriver/test/phantomjs/execute_phantomjs_test.js @@ -24,49 +24,35 @@ var test = require('../../lib/test'); test.suite(function(env) { var driver; - test.before(function() { - driver = env.builder().build(); + test.before(function*() { + driver = yield env.builder().build(); }); test.after(function() { - driver.quit(); + return driver.quit(); }); var testPageUrl = 'data:text/html,<html><h1>' + path.basename(__filename) + '</h1></html>'; test.beforeEach(function() { - driver.get(testPageUrl); + return driver.get(testPageUrl); }); describe('phantomjs.Driver', function() { describe('#executePhantomJS()', function() { - test.it('can execute scripts using PhantomJS API', function() { - return driver.executePhantomJS('return this.url;').then(function(url) { - assert.equal(testPageUrl, decodeURIComponent(url)); - }); + test.it('can execute scripts using PhantomJS API', function*() { + let url = yield driver.executePhantomJS('return this.url;'); + assert.equal(testPageUrl, decodeURIComponent(url)); }); - test.it('can execute scripts as functions', function() { - driver.executePhantomJS(function(a, b) { + test.it('can execute scripts as functions', function*() { + let result = yield driver.executePhantomJS(function(a, b) { return a + b; - }, 1, 2).then(function(result) { - assert.equal(3, result); - }); - }); + }, 1, 2); - test.it('can manipulate the current page', function() { - driver.manage().addCookie({name: 'foo', value: 'bar'}); - driver.manage().getCookie('foo').then(function(cookie) { - assert.equal('bar', cookie.value); - }); - driver.executePhantomJS(function() { - this.clearCookies(); - }); - driver.manage().getCookie('foo').then(function(cookie) { - assert.equal(null, cookie); - }); + assert.equal(3, result); }); }); }); |
