hudson / jenkins - Showing content when clicking a result link - html

I have job that runs an executable which yields a JUnit report.
This report is parsed by Hudson (the 'Publish JUnit test result report' option is checked),
and each testcase is shown as a link.
What I would like to do is to show an HTML page, when a user clicks a link.
For example, this is the JUnit report that Hudson parses
<?xml version="1.0" encoding="utf-8"?>
<testsuite name="Root" package="RunnerRoot" errors="0" failures="3" tests="5" time="20.2">
<testcase classname="Runner" name="Test1" time="3.2283228" />
<testcase classname="Runner" name="Test2" time="2.9512951">
<failure> Error Running the test </failure>
</testcase>
Hudson creates two links called Test1 and Test2, and I want to show
a customized content from an HTML file upon clicking a link.
Thank you

As far as I am aware there is no way to alter the Test Results page, although you might be able to achieve this by writing a plugin. However, there is a plugin that allows you to publish your own html report for a job - https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin. This will appear as a link in the left panel rather than replace the Test Result page, but it is probably the closest to what you want.

Related

Grails Project - Open dialog box

In my application, when I hit Run button which is scripted in gsp page as:
<input type="button" value="Run" onClick="submitJob()"></input>
submitJob() function is defined in a ExtJs JavaScript file which does some operations and calls the controller code which renders a different gsp output page as:
render(template: "/plugin/jobPlot_out", model:[jobName:jobName], contextPath:pluginContextPath)
In my application in web browser it displays the output in the same web page. How to display the same output in a dialog box and not in the same page?
I am new to JavaScript so I posted this question. What I did:
I had to search for the div id of the Run button and had to search for the URL where the div id gets loaded. Upon finding this, I had to write a jQUERY code to open a dialog box and the resulting output was rendered there.
I'm not pretty sure I got you right but have you tried to use a redirect instruction?
http://grails.github.io/grails-doc/3.0.x/ref/Controllers/redirect.html

Call angular function from protractor

I'm new to Angular and Protractor.
I'm using protractor to test Angular pages.
I'm trying to test log-in procedure.
part of the html is:
< li data-ng-show="isLoggedIn()" >
I want to make sure that the credentials are correct by calling the 'isLoggedIn()' function.
the 'isLoggedIn()' function is in a controller named 'navControl'.
can I do it? How?
are there other suggestions to test log-in?
You should be testing your log in page (if you are using protractor) like a user - enter some text in your login form, then click the 'Log In' button! After this, inspect the page for whatever elements you are expecting to be visible after a user has logged in. You shouldn't really be directly calling your application functions - testing those falls under unit testing, not e2e testing for which Protractor is designed for :)
Thanks for helping.
The exact phrase I was looking for is this:
expect($('[data-ng-show="isLoggedIn()"]').isDisplayed()).toBeTruthy();

jasmine.JUnitXmlReporter report visualizer

I generated this xml after running protractor tests.
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="Spring Webapp Homepage" errors="0" tests="3" failures="0" time="1.508" timestamp="2014-02-14T15:23:27">
<testcase classname="Spring Webapp Homepage" name="should get title" time="1.309"></testcase>
<testcase classname="Spring Webapp Homepage" name="Test Header" time="0.098"></testcase>
<testcase classname="Spring Webapp Homepage" name="Test Simple Button" time="0.101"></testcase>
</testsuite>
</testsuites>
There is an option to output the tests to XML output
onPrepare: function() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('jasmine-results/xmloutput', true, true));
}
Is there a way to visualize these reports in the browser that would present them more elegantly than raw XML?
Is there a way to visualize these reports in the browser that would present them more elegantly than raw XML?
Actually there is nosetest-xunit-xslt.
Note xsltproc comes installed by default on Mac OSX Mavericks.
Take a look at how the results look like
Update: I'm using a custom reporter that automates the html conversion
require('./jasmine.single_file_junit_reporter.js');
var junitPath = path.join('junitXMLReport/', '0001');
jasmine.getEnv().addReporter(new jasmine.singleFileJUnitXmlReporter(
junitPath, true, true, './nosetests.xslt')
);
You can use a xUnit html parser to convert your XML files to HTML ones : have a look here http://www.youtube.com/watch?v=hzGG32kz9nc
Then you can integrate you teansformation into your build file

understanding logic flow Struts

first off, i'm new to Struts and i have been following the tutorial here. I understand the set-up of files, and web.xml.
index.jsp:
<%# taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<logic:redirect forward="helloWorld"/>
However, when it comes to the opening of index.jsp, i am at quite a loss. From index.jsp, how does it call the class com.vaannila.action.HelloWorldAction? I know that index.jsp calls the forward=helloWorld but does it mean that it looks for a forward name="helloWorld", which is in <global-forwards>?
Let me know how I can further improve my question, since this is my first.
Correct; it redirects to whatever forward is named "helloWorld".
In this case, that's a forward that runs an action that sticks a value into a form.
You'll likely want to refer to the Struts 1 tag docs, it'll be quicker than asking here every time.
If you can avoid learning Struts 1, I would: it's pretty antiquated on almost all fronts. Frameworks like Struts 2 and Spring MVC dominate Java-framework-based web apps, while things like Grails, Play, Ruby on Rails, etc. dominate JVM-based web apps.
Line 17 of the config file in the tutorial you link to starts:
<action path="/helloWorld"
type="com.vaannila.action.HelloWorldAction"
name="helloWorldForm">
<forward name="success" path="/helloWorld.jsp" />
</action>

Showing HTML reports in CruiseControl dashboard

I have been looking into CruiseControl configuration recently (I'm a complete CC noob) and so far I understand that various XML reports generated by your build process (eg mbunit.xml, ncover.xml, fxcop.xml) can be shown in the dashboard by adding a reference to the xml to the following part of the ccnet.config:
<publishers>
<merge>
<files>
<file>logs\some-report.xml</file>
</files>
</merge>
</publish>
adding an xsl file to transform the xml into presentable html and adding a report build plugin to dashboard.config which references the xsl:
<xslReportBuildPlugin description="Some report"
actionName="SomeReportAction" xslFileName="xsl\some-report.xsl" />
My question is: if I have some reports (code documentation generated by JGregory's Docu and test specs generated by jpboodhoo's Bdddoc) which are pure HTML, is there any way I can show these in the dashboard in a similar way? I can't figure this out. I did think of adding an ExternalLink directly to the HTML page, but this is in a protected area which users normally cant access. Anyone any ideas?
Currently this is not possible in CruiseControl.NET up to version 1.4.4. However this functionality is being added as part of version 1.5.0.
We can't give you a timeframe on the release yet, but you can download and try out the latest version from http://ccnetlive.thoughtworks.com/CCNet-builds/1.5.0/.
Craig
As craig already mentioned this functionality was added in CCNet 1.5, you'll find the documentation about the HtmlPlugin here: http://cruisecontrolnet.org/projects/ccnet/wiki/HtmlReportPlugin