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-39542] Tests show correctly when error message is missing. (#86
)

* [JENKINS-39542] Ath test for test results

* Ath coverage

* Style fix
  • Loading branch information
imeredith committed Dec 14, 2016
1 parent 7c10546 commit 5403482
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/js/page_objects/blueocean/bluePipelineActivity.js
Expand Up @@ -82,6 +82,16 @@ module.exports.commands = [{
this.waitForElementVisible('.activity-table tr#' + runName + ' svg.svgResultStatus');
this.waitForElementPresent('.activity-table tr#' + runName + ' svg circle.failure');
},

/**
* Wait for a specific run to appear in the activity table as unstable
* @param runName name of the job
*/
waitForRunUnstableVisible: function(runName) {
this.waitForElementVisible('.activity-table tr#' + runName);
this.waitForElementVisible('.activity-table tr#' + runName + ' svg.svgResultStatus');
this.waitForElementPresent('.activity-table tr#' + runName + ' svg circle.unstable');
},
/**
* Wait for a specific run to appear in the activity table as running
* @param runName name of the job
Expand Down
47 changes: 47 additions & 0 deletions src/test/js/multibranch/testResults.js
@@ -0,0 +1,47 @@
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().click('//div[@class="result-item-head"]');

browser.useXpath().waitForElementVisible('//div[@class="test-console"]/h4')
},
}
10 changes: 10 additions & 0 deletions src/test/resources/multibranch/test_results/Jenkinsfile
@@ -0,0 +1,10 @@
node {
stage 'Stage 1 - scm'
echo 'Stage 1 - scm'
checkout scm
stage 'Stage test'
echo 'stuff'
sh 'touch TEST-*.xml'
step([$class: 'JUnitResultArchiver', testResults: 'TEST-*.xml'])

}
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="io.blueocean.TestResults" time="0.004" errors="1" skipped="0">
<properties>
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
<property name="sun.boot.library.path" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib"/>
<property name="java.vm.version" value="25.101-b13"/>
<property name="user.country.format" value="NZ"/>
<property name="gopherProxySet" value="false"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="maven.multiModuleProjectDirectory" value="/Users/ivan/w/b/blue-ath/src/test/resources/multibranch/test_results"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=":"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
<property name="file.encoding.pkg" value="sun.io"/>
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/Users/ivan/w/b/blue-ath/src/test/resources/multibranch/test_results"/>
<property name="java.runtime.version" value="1.8.0_101-b13"/>
<property name="java.awt.graphicsenv" value="sun.awt.CGraphicsEnvironment"/>
<property name="java.endorsed.dirs" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/endorsed"/>
<property name="os.arch" value="x86_64"/>
<property name="java.io.tmpdir" value="/var/folders/74/xxmdr51s12d0c3l4yp9gh_fr0000gn/T/"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Mac OS X"/>
<property name="classworlds.conf" value="/usr/local/Cellar/maven/3.3.9/libexec/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/Users/ivan/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:."/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="java.class.version" value="52.0"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="10.12"/>
<property name="http.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="user.home" value="/Users/ivan"/>
<property name="user.timezone" value="Pacific/Auckland"/>
<property name="java.awt.printerjob" value="sun.lwawt.macosx.CPrinterJob"/>
<property name="java.specification.version" value="1.8"/>
<property name="file.encoding" value="UTF-8"/>
<property name="user.name" value="ivan"/>
<property name="java.class.path" value="/usr/local/Cellar/maven/3.3.9/libexec/boot/plexus-classworlds-2.5.2.jar"/>
<property name="java.vm.specification.version" value="1.8"/>
<property name="sun.arch.data.model" value="64"/>
<property name="java.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher test"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="user.language" value="en"/>
<property name="awt.toolkit" value="sun.lwawt.macosx.LWCToolkit"/>
<property name="java.vm.info" value="mixed mode"/>
<property name="java.version" value="1.8.0_101"/>
<property name="java.ext.dirs" value="/Users/ivan/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java"/>
<property name="sun.boot.class.path" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/classes"/>
<property name="java.vendor" value="Oracle Corporation"/>
<property name="java.awt.headless" value="true"/>
<property name="maven.home" value="/usr/local/Cellar/maven/3.3.9/libexec"/>
<property name="file.separator" value="/"/>
<property name="java.vendor.url.bug" value="http://bugreport.sun.com/bugreport/"/>
<property name="sun.cpu.endian" value="little"/>
<property name="sun.io.unicode.encoding" value="UnicodeBig"/>
<property name="socksNonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="ftp.nonProxyHosts" value="local|*.local|169.254/16|*.169.254/16"/>
<property name="sun.cpu.isalist" value=""/>
</properties>
<testcase classname="io.blueocean.TestResults" name="testCase" time="0.004">
<error type="java.lang.InterruptedException">java.lang.InterruptedException
at io.blueocean.TestResults.testCase(TestResults.java:36)
</error>
</testcase>
</testsuite>

0 comments on commit 5403482

Please sign in to comment.