Comparing version 0.9.4 to 0.9.5
CHANGELOG | ||
========= | ||
v0.9.4 11/06/14 | ||
v0.9.5 11/19/14 | ||
* Bugfix to check the url first before determining the root-element | ||
v0.9.4 11/13/14 | ||
* Bugfix in request, making sure that the returned value is always a parsed object | ||
@@ -6,0 +9,0 @@ |
@@ -20,2 +20,4 @@ // Copyright 2014, Yahoo! Inc. | ||
* @property {object} _selectors | ||
* @property {int} _timeOut | ||
* @property {int} _waitInMs | ||
*/ | ||
@@ -38,6 +40,6 @@ var BaseObject = Base.extend( | ||
this._selectors = {}; | ||
this._timeOut = timeOut; | ||
this._waitInMs = waitInMs; | ||
this.initialize(); | ||
this.verifyIsLoaded(timeOut, waitInMs); | ||
}, | ||
@@ -52,3 +54,4 @@ | ||
initialize: function () { | ||
// Nothing by default | ||
this.__super(); | ||
this.verifyIsLoaded(this._timeOut, this._waitInMs); | ||
}, | ||
@@ -55,0 +58,0 @@ |
@@ -36,5 +36,17 @@ // Copyright 2014, Yahoo! Inc. | ||
/** | ||
* Initializes the page-object | ||
* | ||
* @method initialize | ||
*/ | ||
initialize: function () { | ||
this.verifyUrlIsLoaded(this.getNavigationUrl(), this.getExpectedNavigationUrl(), this._timeOut, this._waitInMs); | ||
this.__super(); | ||
}, | ||
/** | ||
* Verifies that the page-object and its sub-dom-elements are loaded as expected | ||
* | ||
* @method verifyIsLoaded | ||
* @method verifyUrlIsLoaded | ||
* @param {string} url | ||
* @param {string} expectedUrl | ||
* @param {int} [timeOut] | ||
@@ -45,9 +57,6 @@ * @param {int} [waitInMs] | ||
*/ | ||
verifyIsLoaded: function (timeOut, waitInMs) { | ||
verifyUrlIsLoaded: function (url, expectedUrl, timeOut, waitInMs) { | ||
var navigationUrl = this._navigationUrl, | ||
expectedUrl = this._expectedUrl; | ||
expectedUrl = expectedUrl || url; | ||
expectedUrl = expectedUrl || navigationUrl; | ||
if (expectedUrl !== "*") { | ||
@@ -64,3 +73,24 @@ this.waitUntil(function () { | ||
return this.__super(timeOut, waitInMs); | ||
return this; | ||
}, | ||
/** | ||
* Gets the expected navigation-url | ||
* | ||
* @method getExpectedNavigationUrl | ||
* @return {string} | ||
*/ | ||
getExpectedNavigationUrl: function () { | ||
return this._expectedUrl; | ||
}, | ||
/** | ||
* Gets the navigation-url for this page-object | ||
* | ||
* @method getNavigationUrl | ||
* @return {string} | ||
*/ | ||
getNavigationUrl: function () { | ||
return this._navigationUrl; | ||
} | ||
@@ -67,0 +97,0 @@ }, |
@@ -28,5 +28,19 @@ // Copyright 2014, Yahoo! Inc. | ||
/** | ||
* Verifies that the page-object and its sub-dom-elements are loaded as expected | ||
* Initializes the page-object | ||
* | ||
* @method verifyIsLoaded | ||
* @method initialize | ||
*/ | ||
initialize: function () { | ||
var expectedUrl = this.constructor.getExpectedUrl(); | ||
this.verifyUrlIsLoaded(expectedUrl, this._timeOut, this._waitInMs); | ||
this.__super(); | ||
}, | ||
/** | ||
* Verifies that the url is loaded correctly | ||
* | ||
* @method verifyUrlIsLoaded | ||
* @param {string} expectedUrl | ||
* @param {int} [timeOut] | ||
@@ -36,6 +50,4 @@ * @param {int} [waitInMs] | ||
*/ | ||
verifyIsLoaded: function (timeOut, waitInMs) { | ||
verifyUrlIsLoaded: function (expectedUrl, timeOut, waitInMs) { | ||
var expectedUrl = this.constructor.getExpectedUrl(); | ||
if (expectedUrl !== "*") { | ||
@@ -52,3 +64,3 @@ this.waitUntil(function () { | ||
return this.__super(timeOut, waitInMs); | ||
return this; | ||
} | ||
@@ -55,0 +67,0 @@ }, |
@@ -21,3 +21,3 @@ // Copyright 2014, Yahoo! Inc. | ||
function (root, timeOut, waitInMs) { | ||
this.__super(this._getPanelRootElement(root, timeOut, waitInMs), timeOut, waitInMs); | ||
this.__super(root, timeOut, waitInMs); | ||
}, | ||
@@ -27,2 +27,12 @@ | ||
/** | ||
* Initializes the panel-object | ||
* | ||
* @method initialize | ||
*/ | ||
initialize: function () { | ||
this._context = this._getPanelRootElement(this.getContext(), this._timeOut, this._waitInMs); | ||
this.__super(); | ||
}, | ||
/** | ||
* Gets the root element of the panel-object | ||
@@ -29,0 +39,0 @@ * |
{ | ||
"name": "hodman", | ||
"version": "0.9.4", | ||
"version": "0.9.5", | ||
"description": "Selenium object library including page-objects", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -467,3 +467,3 @@ Hodman | ||
// table is implemented | ||
"table": ".order-list", | ||
"table": "table.table-view", | ||
// ... | ||
@@ -488,3 +488,3 @@ }); | ||
{ | ||
SELECTOR: "table.table-view" | ||
SELECTOR: "div.page-content" | ||
} | ||
@@ -491,0 +491,0 @@ ); |
77580
2086