I have one root maven project with multiple modules, and every one of each has its own integration tests.
I've created another module under root which has to have a summary of all the tests in the different modules.
I know there is concordion run command, but I don't know how to refer to the concordion specification html files of the other projects.
<a concordion:run="concordion" href="pathToOtherProject/Calculator.html">Calculator Service Specifications</a>
Thanks.
You could make a dependancy on the test-jar for the other projects (and get the other projects to produce a test-jar). That would make the other Concordion resources accessible.
Related
I have more than four different projects going on and client need all these projects into one roof of pom.xml file. So, what should be the best practice should I opt and what should be the maven cucumber structure should for my project? All these projects are not inter-dependent.
I did not try because this is very new for me and I did not know about how should I go. How to create the hierarchy for the multiple independent project. Client will just execute all the feature files by testrunner testng.xml file.
i'm thinking about test automation structure using selenium, intelliJ ide, testng and maven. What You think about below:
I used one project and many directories beacuse i want to have just one pom file. If You could help me with testng file. How it should look like if i want to run all tests which are available in all "Tests" directories? What means click run and fire up all tests with "Test" testng annotations. Helpers, pages and tests directories exist becasue i will want to do this with POM & Page Factory.
#Sid below my pom. My testng.xml is empty currently because i do not know how to configure it to run all what i have in "Tests" directories.
Thank you for reply.
My tests are just examples with beforetests, test and aftertest annotations. Nothing to admire ;)
Too long for a comment:
I would assume your helper class is goin to have common functions. Also, depending on the size of your modules you may want to create more sub-module folders. You can also add a commons folder which contains generic steps and methods.
Now, if your modules are deployed completely independent of each other, you want to take a call on whether the code should reside with the app code or in one place like you have.
The structure would work out fine either ways. To run all the tests you need to include the folders / classes path in your testng files. IDE/Maven/testng dont care about your folder structure so long as you include all the paths correctly. Check out https://www.mkyong.com/unittest/testng-tutorial-5-suite-test/ for how to do that.
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.
I have classes in two modules. One of the modules contains some integration tests that exercise some classes from the other module. I would like my coverage reports to include classes from both modules but I can't find out how to configure the cobertura plugin so that it will instrument the other module's jar file.
I think that is not possible: the unit tests metrics for project A should be complete on their own without executing anything from project B. Unit tests should be written in a manner to cover the code completely. However you may consider re-using the testing code between A and B (see test-jar goal of maven-jar-plugin).
I have a Maven project that is a set of a Selenium 2 tests that run using JUnit. In other words the only thing in the whole project is JUnit testcases and they all reside in the normal source directory i.e. src/main/java since they are the main source files in the project.
I want to be able to run these same tests using Maven, but since these tests are not actual unit tests or integration tests within the project (they are not testing themselves, they are testing a web app somewhere else), I don't want them to run during the normal build lifecycle. However I still would like to be able to define the test phases/goals within the POM file.
At this point I sort of understand the way the surefire plugin works, I just don't know how to de-couple the executions from the build. I would like all my new executions to be stand-alone so that I can simply run them by doing something like: mvn run-webtests and have the run-webtests phase be something completely different from the compile and package goals of my project.
So I guess I have two overall questions:
1.) Am I on the right track or is there some better way to think of this problem?
2.) What is it that I need to do next to make this work? Create a custom phase? Create a custom goal?
Sorry for asking such a seemingly basic question, but I wasn't able to find any examples of someone doing anything like this.
I think you're on the right track. It's just that Maven is unfortunately lacking in flexibility in some areas. Usually stuff can be made to fit in, but sometimes it can be a real pain. I think the simplest way to make this work is to use a different naming convention for your selenium tests and make sure those are excluded from your "normal" test runs. Then define a profile where you configure the surefire plugin to include your selenium tests and exclude the others. Then to run the selenium tests, you could just
mvn test -P selenium-tests
The only ways that you can set it up so that you could run mvn run-webtests, are
Define a custom lifecycle where "run-webtests" is a phase in the lifecycle, or
Write a plugin, though executing a plugin always has a ':' in it, so it would be more like mvn myplugin:run-webtests.
Those are both more work and harder to maintain than a simple profile in the pom.