This repository has been archived by the owner on Jan 4, 2023. It is now read-only.
/
testResults.js
50 lines (40 loc) · 1.91 KB
/
testResults.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const tmp = require('tmp');
const repo = tmp.dirSync();
const pathToRepo = repo.name;
const jobName = 'testResults';
const path = require("path");
const sourceRep = './src/test/resources/multibranch/test_results';
const git = require("../../../main/js/api/git");
/**
* @module testResults
* @memberof multibranch
* @description Tests the tests tab
*/
module.exports = {
// ** creating a git repo */
before: (browser, done) => {
// we creating a git repo in target based on the src repo (see above)
git.createRepo(sourceRep, pathToRepo).then(done);
},
// Create the multibranch job
'Create Job': (browser) => {
var multibranchCreate = browser.page.multibranchCreate().navigate();
multibranchCreate.createBranch(jobName, pathToRepo);
},
'Open acitivty page wait for first run to finish': (browser) => {
const blueActivityPage = browser.page.bluePipelineActivity().forJob(jobName);
// validate that we have 3 activities from the previous tests
blueActivityPage.assertActivitiesToBeEqual(1);
blueActivityPage.waitForRunUnstableVisible(`${jobName}-1`)
},
'Check that the tests tab displays correctly': (browser) => {
const blueRunDetailsPage = browser.page.bluePipelineRunDetail().forRun(jobName, 'jenkins', 'master', 1);
blueRunDetailsPage.clickTab('tests');
// Expand the test.
browser.useXpath().waitForElementVisible('//span[contains(text(), "StdOut")]');
browser.useXpath().click('//span[contains(text(), "StdOut")]');
browser.useXpath().waitForElementVisible('//div[@class="test-console"]/h4[contains(text(), "Stacktrace")]')
browser.useXpath().waitForElementVisible('//div[@class="test-console"]/h4[contains(text(), "Standard Error")]')
browser.useXpath().waitForElementVisible('//div[@class="test-console"]/h4[contains(text(), "Standard Output")]')
},
}