Jenkins plugin for xunit to generate Jbehave reports - jenkins-plugins

I am running Jbehave tests and wanted to view the Jbehave reports on Jenkins. I have installed xunit plugin on Jenkins as mentioned in http://jbehave.org/reference/stable/hudson-plugin.html . When I configure xunit test reports under the Post-build Actions of Jenkins job, I do not see the option for JBehave to add the report. xunit plugin installed is v 1.61. Can anyone tell me if I m doing something wrong or missing anything here?

Ok so to see your jbehave tests in jenkins you need install on jenkins
xUnit jenkins plugin
Then install JBehave Hudson Plugin
2.2 Read about it here
http://jbehave.org/reference/stable/hudson-plugin.html
2.3 Download hpi file (I use:
jbehave-jenkins-plugin-3.7.4.hpi Sat Nov 24 04:38:22 CST 2012 90030
) from:
https://nexus.codehaus.org/content/repositories/releases/org/jbehave/jbehave-jenkins-plugin/3.7.4/
2.4 Go to your jenkins to pluginManager/advanced and in sectionUpload Plugin ad downloaded file and upload it
2.5 It should become visible in pluginManager/available section - so just check and install it.
Now navigate to your build to xUnit Post-build Actions and enjoy jbehave options
3.1 Add directory where plugin should look for xml report like **/jbehave/*.xml
3.2 If your jbehave is configured properly you should get all reports located in your workspace
If you need more help like configuring html view of jbehave reports, setting maven etc. make new question or update this one
Cheers

You may not have to use xunit plugin to see the test reports.
There are other options available.
Make sure you have generate the required outputs (org.jbehave.core.reporters.XmlOutput). Then just publish the Junit test result.
Make sure you have generate the required outputs (HTML). Include
<dependency>
<groupId>org.jbehave.site</groupId>
<artifactId>jbehave-site-resources</artifactId>
<version>3.1.1</version>
<type>zip</type>
</dependency>
And you can publish as one of the HTML reports.

Related

Generate allure report without install in system Allure command line tools

I have a project to test UI on Java Selenide. I want to show it to one company as a portfolio. I do not want them to bother installing allure command-line tools and add its bin to the PATH variable. Is it possible to generate an allure report without it?
I am talking about the Windows environment.
Assuming you have Allure specified in your pom (and you're using Maven), after your test run you can run this:
mvn allure:report
This will generate a report in the target/site folder (click on index.html to view it)

Results for deleted / renamed tests still appear in Allure reports using Jenkins Allure plugin

I am using the Jenkins Allure plugin to generate reports for PyTest runs.
I've noticed that if I delete a failing test from my repository, or rename a failing test, the Allure reports generated by Jenkins continue to show failures for the old tests, even though they no longer exist and did not run in the most recent job.
How do I ensure that Allure reports only contain results for tests that actually ran in the latest job?
You should generate the results in allure-results directory in your root project.
Every time you run your job, those new allure results files will be generated in the Jenkins workspace. You should clean your workspace before the build starts to ensure that you are taking the last execution:
Frank Escobar's answer is correct.
I want to add that if you're using a pipeline the option in his screenshot is not available.
In that case, use the Jenkins Clear Workspace plugin https://jenkins.io/doc/pipeline/steps/ws-cleanup/ and create a pipeline step to clear your workspace before starting the test run.

Configuring Groovy on Jenkins

I'm using Jenkins ver 2.121.2. I'm trying to configure the Groovy plugin to run groovy scripts via a Jenkins job. The plugin documentation provided here
does not appear to match the UI I see in the System Configuration - Groovy section of this version of Jenkins. The various parameters don't match and so far I'm unable to get the plugin to run a simply groovy script. Not being familar with java and how the classpath works I'm not able to loosely interpret the instructions and get it working. If anyone can point me at documentation that more closely matches the Groovy plugin with the most current version of Jenkins I would appreciate it.
First, you need to configure an instance (or instances) of Groovy to run scripts in your builds. You do that on the Global Tool Configuration page.
You should have a least one JDK configured in the Global Tools Configuration (or have JAVA_HOME defined).
You can have Jenkins install the version of Groovy you want (on first use), or you can install Groovy yourself and point to it as in the example below:
Once this is in place, you can use the Execute Groovy Script build step in a build:

Does Selenium- Jenkins Integration needs TestNG or JUnit Framework

Should we need TestNG or Junit framework to integrate Selenium with Jenkins. I have project which is build without TestNG or JUnit can i integrate it with Jenkins.
You can use both JUnit and TestNG frameworks as Jenkins supports both.
Steps in details for TestNG integration with Jenkins.
Step 1: Create Free Style project in Jenkins and fill the details and Save the project.
Step 2: click on Configure
Step 3: In the Build section of Configure:
java -cp J:\taf\testng\*;J:\taf\workspace\TestNGExamples\bin;J:\automation\* org.testng.TestNG J:\taf\workspace\TestNGExamples\testng1.xml
Note: you have to change the paths as per your system.
In -cp argument, we must provide testng.jar, project location and ``selenium jarslocations/paths.
org.testng.TestNG- TestNG Main Class.
andlocation to the XML of testng configuration`
Download and install the testng-plugin for jenkins from here and restart Jenkins in order to take effect.
Step 4: In the Post-build Actions section,
Select Publish TestNG Results from Add post-build action dropdown.
provide the path where to look for TestNG results (.xml file containing results).
Click Apply and Save buttons.
Screenshot for reference:
TestNG and JUnit on simple terms can be visualised as "java code execution" mechanisms with support to do validations.
So instead of you having only one main() method that would be the single point of entry for execution of your selenium code, TestNG/JUnit takes up that role and lets you run multiple java classes via themselves.
Jenkins is an orchestrator tool that lets you build, test, deploy as per your wish.
The test phase can be skipped by not using TestNG and JUnit, and you resorting to executing your selenium based tests via a main() method which takes care of doing all validations as well (assertions in the JUnit/TestNG world)

What plugins do I need to install to get WebStorm functionality in IDEA?

My company (Java + AngularJS shop) is evaluating both IDEA and WebStorm. Based on some Googling, it looks like IntelliJ IDEA is a superset of the *Storm editors, assuming you install the proper plugins (source1, source2):
Practically, if we purchased IntelliJ IDEA 13.1 Ultimate, what plugins would we need to get these WebStorm features?
Grunt integration
AngularJS integration
Bower integration
Karma integration
JavaScript auto-complete/navigation
Grunt and Bower support, as well as javaScript completion, etc. are available out of the box. AngularJS, Node.js and Karma plugins have to be installed from the repository (Settings/Plugins, Browse Repositories..., type plugin name in the search box to quickly locate it).
Just search the repo, you can do this from within intellij with a nice gui aswell.
javascript code complete is in vanilla (not an external plugin) version btw, as I would imagine most of the others are. Just try the trial version.

Resources