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)
Related
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.
Is the TestNG Executable JAR files alone is enough to work with TestNG framework or the TestNG plugin is essential? I have the JAR files, can i add to my library and work with TestNG?
Plugin just simplifies running things. You do not need it so to say. But, if you say want to run a single test or a suite file - a plugin would give you a simple way to right click and trigger it off. But with no plugin you will have to run with the java run command or through maven command if that's what you are running.
So the answer is yes - you can run but the plugin will always help while you are developing your tests.
I have a web project, say 'WebProj' in which I have defined all the my javascript source files with angular code. I am defining my chutzpah unit test cases for those javascript source files in another project 'WebProj.Tests' along with my other C# test cases. I am having both the web and tests project under same solution.
My problem is that when I try to integrate the web project to the TFS build process I cannot run the chutzpah test cases as the web project output folder don't have the chutzpah test case files copied to the project output folder. At the same time the test cases are executed if I have the chutzpah test cases defined in the same web project.
How can I execute the javascript chutzpah test cases on build process if those are defined in a separate Test project and include them in project output folder after build?
To have the test case files copied to the build output folder, you need to right-click the .js file and select Properties -> set the Copy to Output Directory property to be Copy always.
Additionally, you need to follow the steps below to run chutzpah tests in TFS build process.
Install jasmine.js to the test project.
Install Chutzpah Test Adapter
Install Chutzpah test runner to the solution (on solution level, not project level).
Set the test assembly to match your javascript test naming convention. e.g. ***.tests.js
Configure to use the custom test adapter during TFS build process. 1). If you are working with vNext build, go to Visual Studio Test step, set the Path to Custom Test Adapters property to be similar to $(Build.SourcesDirectory)\packages (get the path via NuGet restore); 2). If you are working with XAML build, go to Build –> Manage Build Controllers, set Version Control Path to custom Assemblies to the package path.
Completed steps can be found on the "But what if you want run Jasmine.JS test?" part in this blog: http://blogs.blackmarble.co.uk/blogs/rfennell/post/2015/09/23/Running-nUnit-and-JasmineJS-unit-tests-in-TFSVSO-vNext-build.aspx
And also this blog (do not follow the Step2 to check in these files into TFS version control, instead use NuGet to donwload these packages.) http://blogs.msdn.com/b/visualstudioalm/archive/2012/07/09/javascript-unit-tests-on-team-foundation-service-with-chutzpah.aspx
Add another Visual Studio Test step to your build definition that just runs the JavaScript tests as shown below; the redacted portion in the green box of the Test step is the path to your test files. When the build runs, the stats from the two test runs will be combined in the build output.
I am relatively new to Selenium WebDriver and a self learner. I have created a webDriver project which consists of different packages and have made use of Page Factory concepts extensively. I use TestNg framework to run the suite to generate my report. So my test cases are also following the TestNG framework concepts.
Now my team wants to use my script to be run at every build to test the sanity. The build team just wants to run my whole script by just a click. It can be shell script command or .exe or jar. Build team uses linux m/c and they dont have Ecplise , TestNg installed in their machine. Their intention is whenever build is given they want to run my script by just a click or a command in Command Prompt.( it has to be that simple for them) and a report should be generated in some location in hdfs
My script runs on FF version 32 and Selenium webDriver 2.44.0
Would really appreciate if someone could give me a solution that actually works for my requirement.
I found a similar query from someone but i am not sure if the answer still suits.
How to make Java executable Jar file of WebDriver project
Could somebody please give me a solution. Or the solution mentioned in the above link stil is the best?
Regards
There are few ways to do it:
Use CI tool (Jenkins): You can set up your project in Jenkins and it will allow you to run the project in single click. Jenkins also provides you an option to run the tests periodically so you can configure it in such a way that it will always get executed after certain time period.Jenkins is also capable to trigger the execution if there is any changes in source code of tests. I'd suggest to use this tool. https://jenkins-ci.org/
Use .bat or .sh file: I am not sure if you are using any build tool like ANT or Maven, if you are using any one of them then you can write a .bat or .sh file to run the tests. ANT
If you are not using any build tool then start using, it will help to run the tests in simplest way.For me to run entire suite, I just type below command in terminal from root directory of project
ant run -Dsuite=all
If you are more concerned about system configuration for e.g. the system which will be used by build team does not have a specific version of browser or specific required library. Then I'd suggest to keep all essentials like browser installation files, libraries in your project directory. This is not a good practice but yes it will help others to run the tests smoothly.
I would suggest just exporting a jar file for your project. All the libraries will be packaged together in the jar files(including TestNG) and you can simply double click on the jar file to start your tests.
External resources (if any), will have to be available for the jar file though. So, you can provide the jar file and the external resources together. The external resources might include your test data (if any) or Portable Firefox(if you are using the portable version).
Steps:
Right click on Project -> Export -> Runnable jar file
Give a name and file path for the jar file
Select option - Extract required libraries into generated JAR
And Finish
Troubleshooting:
Check the java version for the machines that you will be running your jar file on. Programs compiled with java 7 will mostly not run if the machine has java 6. Either compile with java 6 or update the jre on the target machines.
If the jar file does not launch, try using Jarfix.
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.