Posts

Showing posts with the label Maven

What is reactor??

Image
Image Source: Fusion Reactor from MIT:  http://www.computerworld.com/article/3028113/sustainable-it/mit-takes-a-page-from-tony-stark-edges-closer-to-an-arc-fusion-reactor.html In simple words:  Reactor is what makes multi-module builds possible Reactor is a part of Maven that allows executing a goal on a set of modules.  It determines the correct build order from the dependencies stated by each project in their respective project descriptors, and will then execute a stated set of goals.  It computes the directed graph of dependencies between modules, derives the build order from this graph and then executes goals on the modules. In other words, a "multi-modules build" is a "reactor build" and a "reactor build" is a "multi-modules build" :)  Reactor does this: Collects all the available modules to build Sorts the projects into the correct build order Builds the selected projects in order How this fits in the test automa...

Maven run tests from commandline - CheatSheet

Image
Purpose Command Run all tests mvn test Run using testng verify mvn verify Run the allure reports mvn site Run a single maven test within a class mvn -Dtest=TestObjects#ostiariusAddUserWithCancel test where "TestObjects" is the test class name and "ostiariusAddUserWithCancel" is the test method. Run all tests within a group mvn test -Dgroups=slow test Run all tests within a class mvn -Dtest=com.amedia.qa.automation.testcases.testgoogle.TestGoogle test mvn clean test -Dtest=xxxxTest Only runs all the test classes ending in PerformanceTest. mvn -Dtest=*PerformanceTest clean test To run test suite xml file mvn test -DsuiteXmlFile=src/test/resources/testsuite/test.xml Further Reading:  http://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html

parent = 'null' cardNumber = 'null' while running serenity using Maven

Image
Technology Stack: Serenity + Cucumber + Jnit Problem: If you have been using Serenity and have seen that your reports don't show up the capabilities/epics that have been run. If you dig further you would notice that in your logs there is a statement where the epics/capability isn't able to find its parent, cardNumber Solution:  What would not work: Updating pom file Using latest jars  What works: Path to the requirements directory like this: serenity.requirements.dir = src/test/resources/features

Issue while setting up TestNG and Maven from Scratch

Image
Here is what a good friend of mine was facing with TestNG and Maven:  Bro, For your Blog: Issue while setting up TestNG and Maven from Scratch: Eclipse TestNG Plugin Version which is higher than TestNG jar in your pom dependecy, will fail to either Start or Quit the driver. For example, I downloaded TestNG Eclipse plugin 6.9.10, but my pom.xml had a dependency on version 6.9.9. I kept getting the Unreachable Browser Exception for IE, Chrome and Mozilla. I downloaded TestNG plugin 6.9.4, which is more stable, but my pom.xml had a dependency on version 6.8. The webdriver struggled to open and reported a "java.net.SocketException: Software caused connection abort: socket write error", though my test completed successfully. I received this error again across all 3 drivers, i.e Firefox, IE and Chrome. So to fix the above issues, I kept the plugin version 6.9.4, but increased the pom dependency on Test NG jar to 6.9.9. Result was a smooth execution. ...

Failed while enforcing RequireUpperBoundDeps - Maven IntelliJ

Image
Problem:  If you are using Maven and you have the enforcer plugin , you might see the error "Failed while enforcing RequireUpperBoundDeps" Solution:  Since we almost always make changes in a backward-compatible manner, it looks like the best solution for us is to ensure that the latest versions of dependencies are used . The Maven Enforcer plugin with the "Require Upper Bound Dependencies" feature accomplishes this. From  http://maven.apache.org/enforcer/enforcer-rules/requireUpperBoundDeps.html : This rule requires that the version for each dependency resolved during a build, is equal to or higher than all transitive dependency declarations. The version of each dependency resolved during the build will normally be the version specified in the POM or the version with the least transitive steps (the "nearest" definition). For more information about Maven dependency resolution, see the Maven site.

POM.xml explained

Image
POM stands for project object model.  The  pom.xml  file is the core of a project's configuration in Maven.  It is a single configuration file that contains the majority of information required to build a project in just the way you want.  It contains default values for most projects. When executing a task or goal, Maven looks for the POM in the current directory. It reads the POM, gets the needed configuration information, then executes the goal. Super POM -  The Super POM is Maven's default POM. All POMs extend the Super POM unless explicitly set, meaning the configuration specified in the Super POM is inherited by the POMs you created for your projects The minimum requirement for a POM are the following: project root modelVersion - should be set to 4.0.0 groupId - the id of the project's group. artifactId - the id of the artifact (project) version - the version of the artifact under the specified group packaging - Every Maven project h...