<!-- JUnit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency>
In order to setup Graphene's library dependencies, you need to choose between components:
test framework (JUnit, TestNG, ...)
Arquillian mode (standalone, container)
Graphene should fluently work with JUnit and TestNG, you need to include their dependencies in your POM dependencies section:
<!-- JUnit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency>
<!-- TestNG --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> </dependency>
You can choose between following Arquillian modes
Standalone
runs tests without container integration, only lifecycle of extensions is managed
allows to use Graphene independently of Arquillian containers and deployment management
Container
runs tests with container, managed lifecycle of container including deployment
you can still use Graphene without managing lifecycle - just do not provide @Deployment in your test case
and include those in dependencies section of your POM:
Note: you need to use Arquillian integration specific for your test framework - following dependencies are for JUnit - for using TestNG, you need to replace "junit" keyword with "testng"
<!-- Arquillian JUnit Standalone --> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-standalone</artifactId> <scope>test</scope> </dependency>
<!-- Arquillian JUnit Container --> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency>
Graphene uses Arquillian Containers in order to manage lifecycle of the application container and deployment.
To setup Arquillian to use your favorite container, refer to Container adapters.
Graphene 2 covers integration with WebDriver (aka Selenium 2), but it can be used in the same project together with Graphene 1 (based on Selenium 1).
For more detailed summary of differences, refer to Which Graphene to use?
When adding following dependencies, all required dependencies should be brought to your project as transitive dependencies, including:
Drone
WebDriver
<dependency> <groupId>org.jboss.arquillian.graphene</groupId> <artifactId>graphene-webdriver</artifactId> <type>pom</type> <scope>test</scope> </dependency>
http://arquillian.org/modules/graphene-extension/
Note: in order to rewrite dependencies transitively brought by Graphene (e.g. Drone), you can use BOMs (see bellow)
In order to manage or override dependency versions used in the project, it is recommended to use BOMs.
By importing BOM to your Maven POM, you manage versions of dependencies, so you don't need to define them explicitly.
In connection to Graphene, you may want to use these BOMs: