Skip to content
This repository has been archived by the owner on Dec 16, 2023. It is now read-only.

Commit

Permalink
ADDED window now has access to XPathResult and friends #762
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Oct 22, 2014
1 parent 9e4a3fa commit 6abc4f8
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

ADDED browser.assert.link can use regular expression to match link URL #770

ADDED window now has access to XPathResult and friends #762

FIXED images seem to load twice #780



## Version 2.0.8 2014-10-14

FIXED bump to JSDOM 1.0.3 to fix cssstyle-browserify dependency
Expand Down
6 changes: 6 additions & 0 deletions src/zombie/window.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ WebSocket = require("ws")
URL = require("url")
XMLHttpRequest = require("./xhr")
createWindow = require("#{JSDOM_PATH}/../jsdom/browser/index").createWindow
XPath = require("#{JSDOM_PATH}/../jsdom/level3/xpath")


Events = JSDOM.level(3, 'events')
Expand Down Expand Up @@ -145,6 +146,11 @@ module.exports = ({ browser, params, encoding, history, method, name, opener, pa
img.height = height
return img

window.XPathException = XPath.XPathException
window.XPathExpression = XPath.XPathExpression
window.XPathEvaluator = XPath.XPathEvaluator
window.XPathResult = XPath.XPathResult

window.resizeTo = (width, height)->
window.outerWidth = window.innerWidth = width
window.outerHeight = window.innerHeight = height
Expand Down
19 changes: 19 additions & 0 deletions test/xpath_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,25 @@ describe('XPath', function() {
});


describe('window', function() {
it('should have XPathException', function() {
assert(browser.window.XPathException);
});

it('should have XPathExpression', function() {
assert(browser.window.XPathExpression);
});

it('should have XPathEvaluation', function() {
assert(browser.window.XPathEvaluator);
});

it('should have XPathResult', function() {
assert(browser.window.XPathResult);
});
});


after(function() {
return browser.destroy();
});
Expand Down

0 comments on commit 6abc4f8

Please sign in to comment.