In order to use this framework the environment in which the code is running must be setup properly. Outside of the main applications, there is a very minimal set of steps to setup an environment.
Java 1.7 is required to build and run the testing framework because Groovy 2.x utilizes the JDK "invoke dynamic" instruction call introduced within Java 1.7. The new instructions allow for Groovy to be significantly more proficient over previous versions of Groovy. While Java 1.7 can be run along the side of previous Java versions this will require advanced management of environment variables. Managing multiple versions of JDK is outside the scope of this documentation.
export PATH=\${JAVA_HOME}/bin:\${PATH}
java -version
java version "1.7.0" Java(TM) SE Runtime Environment (build 1.7.0-b17) Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
The framework is built using Maven 3. Maven is a build tool that focuses on convention over configuration which produces a very simple source structure. In addition to project structure, Maven's build lifecycle is highly configurable which allows for a very simple syntax structure to build and run the tests.
mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 00:44:56-0800) Maven home: c:\dev\maven Java version: 1.7.0, vendor: Oracle Corporation Java home: c:\dev\java-7\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Once Maven and Java have been installed, Maven will need to be setup and configured for the development environment/laptop.
<?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <activeProfiles> <activeProfile>acquity-group</activeProfile> </activeProfiles> <profiles> <profile> <id>acquity-group</id> <properties> <!-- PhantomJS for Ghost Driver --> <path.to.phantomjs/> <!-- Change this for linux vs windows --> <!-- Example: C:\dev\chromedriver\chromedriver.exe or ~/dev/chomedriver/chromedriver --> <!-- Or as an environment variable --> <path.to.webdriver>\${env.WEBDRIVER_HOME}</path.to.webdriver> </properties> </profile> </profiles> </settings>
This framework is best run using Chrome via Chrome Browser since the browser can be run in incognito mode for maximum load time
This framework uses WebDriver which requires a small application called a driver to act as an interface between browsers and the code. This decoupling provides the ability to use the same code for multiple browsers, even remote browsers via RemoteWebDriver.