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

Commit

Permalink
[JENKINS-38006] move method to the page object
Browse files Browse the repository at this point in the history
  • Loading branch information
scherler committed Sep 7, 2016
1 parent dac5f29 commit 9ceca9d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 14 additions & 0 deletions src/main/js/page_objects/blueocean/bluePipelineRunDetail.js
Expand Up @@ -265,6 +265,20 @@ module.exports.commands = [{
}

return self;
},
validateScrollToBottom: function () {
const browser = this.api;
browser.execute(function (selector) {
const cmElem = document.evaluate(
selector, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null
).singleNodeValue;
// return the scrollHeight to determine whether we moved to the bottom on karaoke
return cmElem.scrollHeight;
}, ['//div[@class="content"]'], function (result) {
browser.assert.equal(typeof result, "object");
browser.assert.equal(result.status, 0);
browser.assert.equal(result.value > 0, true);
});
}

}];
12 changes: 1 addition & 11 deletions src/test/js/log-karaoke/freestylePing.js
Expand Up @@ -24,17 +24,7 @@ module.exports = {
.fullLogButtonNotPresent()
.expect.element('code').text.to.contain('Finished: SUCCESS');
// make sure the windows is small
browser.execute(function (selector) {
const cmElem = document.evaluate(
selector, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null
).singleNodeValue;
// return the scrollHeight to determine whether we moved to the bottom on karaoke
return cmElem.scrollHeight;
}, ['//div[@class="content"]'], function (result) {
browser.assert.equal(typeof result, "object");
browser.assert.equal(result.status, 0);
browser.assert.equal(result.value > 0, true);
});
blueRunDetailPage.validateScrollToBottom();
// make the browser big again
browser.resizeWindow(1680, 1050);

Expand Down

0 comments on commit 9ceca9d

Please sign in to comment.