Automating Selendroid and Selenium Tests through maven - maven

Is it possible to automate Selendroid Tests for Android as well as Selenium for Web Browsers(together) through maven? Do i need to create seperate pom files for both or is it possible to use a single pom file to run both type of Tests?
Can i use any other framework to test Android and WebApps together through maven?

You can use a single pom file. Just configure plugins for each test type you want to use.

Related

Is it possible to create html Cucumber Report without Maven

I'm working on Cucumber automation using selenium webdriver. I'm fairly new and have not used Maven just yet. I have not been able to generate an html report. Currently, my target remains blank.
Is it because I'm not using Maven or is it possible to create/generate without it
If YES, then how?
If NO, then whats the reason?
You can use cucumber without maven, you just need to add cucumber .jar file manually. (here you have exemple)
However I recommend you to use maven or ant or gradle. It does the same thing but automatically.

Is there a Maven plugin listing all JUnit tests in a multi module project

Is there any maven plugin - or non-maven tool - out there which would browse a multi-modules project and return me a list of all existing JUnit testcases (ideally presented per module) in a usable form?
I want to be able to work on that list and distribute my tests across multiple hosts.
I checked surefire documentation and I'm surprised that it doesn't seem to be able to do that.
There's a .../target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst in a Maven project.
You can use the GMavenPlus Plugin and Walking the File Tree to gather these files and put their content where you want.
Another option is to develop an own Maven plugin that does the same.

Spring Test Without Maven

I want to do unit test on Spring Web Application using Spring Test. When I tried to learn in web got all the tutorials with maven. We are not using maven in our project. Is there any way to do this test without maven.
maven is a tool for build processes. You really don't have to use it.
What you need is to write tests with a testing framework, for exapmle junit
The dependencies you need (spring, junit) must be in your classpath. If you're not using maven then any other way you prefer.
You can use this question to run tests from command line if that's what you need.
To make it clear in other words - maven provides you with a build cycle that downloads your dependencies and put them in your classpath. This is something that you can do manually (configure your classpath and put needed jars in the classpath). The second thing maven gives you is the test life-cycle. But you don't have to use it and you can run unit-tests from command line according to the link I put in bullet 3 or running through the IDE. Most of eclipse and Intellij versions come with built-in support for running tests.

possible to parameterise junit tests and run with maven?

I have a bunch of selenium webdriver tests split in different classes. I run these tests across a number of sites but I don't want to run them all on every site.
In the past I used msBuild and c# and wrote testng tests for software automation and I could add something like #Version1.5 after #Test then when I run my tests if the version in my properties file wasn't 5.1 it would skip that test.
Is something like this possible using maven and junit in Java?
Would JUnit Categories to the trick? Maven Surefire supports them but I am not sure how you would dynamically turn them on or off. You could definitely set up maven profiles to turn them on or off and then pass the appropriate profile as part of the maven command.

Maven: Dealing with a truly circular dependency

I have a somewhat complex situation and I'm not sure what the best way to set up my Maven environment is.
I'm writing a framework to allow the creation of tests for a particular system. The system can host a variety of applications, and I have a set of tests for each application, which I'd like to keep separate from the framework (which handles the general concept of a "test", and message sending/receiving etc). Also, the framework provides a generic UI, so it can be built as a war and deployed allowing you to run and configure tests.
What I'm currently doing is building the framework both as a jar and war, listing the framework as a dependency in each application test suite, and pulling in all the framework code using an overlay so each suite can build its own war to deploy. This is gross.
What I'd like is to be able to specify (probably via profiles) which test suites to build in the framework, and end up with a single framework.war file with the specified suites included. Trying to build the poms for this I keep running into a circular dependency because:
To build the tests, the test projects must depend on the framework
To pull in the specified test jars, the framework must depend on those test projects
Things I've tried:
Make the test suites sub-projects of the framework:
This doesn't work as (I think) I can't package the final result as war (only pom packaging for aggregator projects)
List the test .jars as system dependencies:
This works, but it's gross to have to manually specify a path to the jar
Put the tests as java packages inside the framework and compile only what you want via filters:
technically possible, but I would really prefer the logical separation into separate maven projects as each test suite can be configured too, and I'd like to keep all that config out of the framework pom
What would be ideal would be a parent project pom that would:
compile the framework with no tests
compile the specified test suites
rebuild the framework .war, including the specified test suite jars
I'm not sure if this is possible and/or even advisable, but it seems the best solution to me. Thanks in advance for any suggestions for organizing this project.

Resources