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

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-38006] first working version to test whethe we have scrolled…
… to bottom
  • Loading branch information
scherler committed Sep 7, 2016
1 parent 0c12cc0 commit dac5f29
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/test/js/log-karaoke/freestylePing.js
@@ -0,0 +1,44 @@
const jobName = 'ping';
module.exports = {
'Create freestyle Job "ping"': function (browser) {
const freestyleCreate = browser.page.freestyleCreate().navigate();
freestyleCreate.createFreestyle(jobName, 'freestylePing.sh');
},

'Build freestyle Job': function (browser) {
const freestylePage = browser.page.jobUtils().forJob(jobName);
freestylePage.buildStarted(function () {
// Reload the job page and check that there was a build done.
freestylePage
.forRun(1)
.waitForElementVisible('@executer');
})
},

'Check Job Blue Ocean run detail page - karaoke': function (browser) {
const blueRunDetailPage = browser.page.bluePipelineRunDetail().forRun(jobName, 'jenkins', 1);

browser.resizeWindow(600, 600);
blueRunDetailPage.waitForJobRunEnded(jobName)
.waitForElementVisible('code')
.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);
});
// make the browser big again
browser.resizeWindow(1680, 1050);

},


};
2 changes: 2 additions & 0 deletions src/test/resources/test_scripts/freestylePing.sh
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
ping spiegel.de -c 10

0 comments on commit dac5f29

Please sign in to comment.