How to build RPM of a selenium test automation project with maven? - selenium

I have a test automation framework with test cases. I want to build an RPM of this whole project so that it can be installed on any machine and can execute the test. How can I do that?

One approach is to use a %check scriptlet in a spec file to run the tests during a build.

Related

TestNG options not display in Run As in eclips even I added Test NG Jar

I have added testng-7.4.0.jar in my project as external jar but I am not getting TestNG as options to run the program under run as in eclipse . I can see TestNg jar present in Referenced Libraries
I tried this in both version of eclipse oxygen and Neon
enter image description here
Install Testng plugin from eclipse market place and restart the IDE. And when you run it for the first time configure the run with run configurations.
You must have TestNG.xml file configured to run in eclipse.

Do we need to install JDK to run WebDriver's TestNG tests through command line?

I am new to Selenium/WebDriver and created a project which I can execute through Eclipse IDE successfully. Now, I plan to run the test through command prompt by creating the proper TestNG1.xml and making sure the testng-6.8.5.jar is correctly pointed in PATH. I even tried giving full path of the testng-6.8.5.jar. Unfortunately I keep getting the error,
Error: Could not find or load main class org.testng.TestNG
I don't have JDK installed (and I don't want to install) so wondering if JDK is mandatory to run TestNG tests from Command line? From above error it looks like it's not even trying to access the TestNG1.xml I have.
I plan to distribute these tests as group of files to my fellow Business Analyst who only have JRE installed on their machine.
Yes, you need JDK installed where you are going to run your Test Here is some documentation of TestNG
Having JRE is enough to run the TestNG tests, or no need to install JDK to run the TestNG tests through command line
the issue was with the testng-6.8.5.jar library as selenium-server-standalone-2.32.0.jar was allowing me to run the project with no errors.

Can I use Spock and Geb without Grails or Gradle or anything else?

I'm a QA and I want to use Spock + Geb for my testing. As I understand I have to setup grails (or gradle, or something like that) to use Spock + Geb. Or Grails is not required? In this case what is the minimal set of programs that I need to install to successfully test any application? Where I need to write test and how to run it?
Sorry for such stupid questions, but all this stuff is new for me and I don't really understand how it works.
The Grails web framework isn't required at all, unless the web app you are testing is written in Grails.
The Gradle build tool isn't necessarily required, but then you don't want to manually download Spock and Geb, manually compile the tests, manually run the tests, or manually set up an IDE. A build tool can automate all of this, and if you aren't using one already, Gradle is the easiest choice.
The Geb Manual explains how to set up a Gradle build for Spock+Geb and links to a fully working example project. Cloning this project (or downloading the zip) will get you started quickly. You don't even have to install Gradle, but can just run it via the gradlew (*nix) or gradlew.bat (Windows) script (for example gradlew test).

Bamboo recognising JBehave tests

I have setup Bamboo to run JBehave tests on a remote agent (with JBehave-web plugin launching test using webdriver), and everything runs fine. Only problem is after the execution is finished Bamboo shows no test executed. I can see the option in Bamboo to select the output of the test results, but it has to be a JUnit xml, and Jbehave reports are only generated in plain text or html.
Any idea how to solve this?
Thanks
I ran in the same situation about a year ago. JBehave "doesn't" integrate with Bamboo out of the box. Although, they have a plugin for Hudson CI.
In my case, such as yours, I resorted in running the tests through the Surefire plugin; the outputs are considered as JUnit tests results and Bamboo can recognize them.
Hope it helps.
There is a really simple way to do this. And I'm currently doing this for our build system.
Write a simple parse script that transforms your plain of html report into JUnit compatible results. And add that script as a task in your Bamboo task, then use Junit parser to parse the results. Boo! You're done! Plus, you've got the capability to quarantine!
This is way much faster than writing a plugin for Bamboo, which involves considerable more time to learn/write.
Setup JBehave with Maven.In Bamboo build plan use Maven task to run it. For getting results in Bamboo use JBehave Task for Bamboo. It will convert JBehave scenarios in tests in Bamboo. If scenario names contains JIRA issue ids, it will link them to JIRA issues.
https://marketplace.atlassian.com/plugins/com.mdb.plugins.jebehaveforbamboo/server/overview
Sample JBehave as Maven Project
https://bitbucket.org/vikasborse/jbehavesampleproject/overview
Download or clone this repository on your local machine.
To run navigate to this project in command line and use command:
"mvn integration-test"

Setting up Hudson with Selenium RC to run tests written in C#

I just deployed a Hudson server and configured it to checkout, build and deploy to a testing http server.
Now I want more =)
I have some Selenium RC tests wrtten in C#/.Net, using the MbUnit infrastructure, that runs ok on Gallio Icarus.
How to setup Hudson to run these tests? Our is in a Windows 2003 server.
I was thinking about just setting a batch script that runs the tests. But how to run them in CLI? Is there a CLI test runner that could run our tests?
Hah! Just found out.
I have to run:
Gallio\bin\Gallio.Echo.exe path\MyTestAssemlby.dll
When Google fails you, try searching your own PC =)
If you prefer NAnt, MSBuild or PowerShell you can use those too...