Environment Setup

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.

Setup Java 1.7

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.

  1. Download JDK 1.7 for machine (64-bit) - Download JDK 7u15+
  2. Install into a location - Remember the installation location
  3. Create an environment variable "JAVA_HOME" to point to the JDK install location - More Documentation
  4. Place the %JAVA_HOME%\bin at the beginning of your PATH variable
    • MacOSX/Linux - Modify your .bashrc or .profile and add this towards the bottom:
       export PATH=\${JAVA_HOME}/bin:\${PATH} 
    • Windows - Open system environment variables, modify the "Path" variable and append "%JAVA_HOME%\bin;" to the beginning of the PATH string
    • NOTE: If you are combining Java and Maven install, the PATH variable should look similar to this:
      • Windows: %JAVA_HOME%\bin;%MAVEN_HOME%\bin;....
      • Mac/Linux: \${JAVA_HOME}/bin;\${MAVEN_HOME}/bin;\${PATH}
  5. Test the install from a command prompt:
     java -version 
    Should produce something similar to:
    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)
    
Back To Top

Maven 3.x Install

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.

  1. Download from Apache Maven 3 Download
  2. Install into a location - Remember the installation location
  3. Create a "MAVEN_HOME" environment variable pointing to the installation location
  4. Add MAVEN_HOME to the PATH variable
  5. Place the %MAVEN_HOME%\bin at the beginning of your PATH variable
    • MacOSX/Linux - Modify your .bashrc/.profile: export PATH=\${MAVEN_HOME}/bin:\${PATH}
    • Windows - Open system environment variables, modify the "Path" variable and append "%MAVEN_HOME%\bin;" to the beginning of the PATH string
    • NOTE: If you are combining Java and Maven install, the PATH variable should look similar to this:
      • Windows: %JAVA_HOME%\bin;%MAVEN_HOME%\bin;....
      • Mac/Linux: \${JAVA_HOME}/bin;\${MAVEN_HOME}/bin;\${PATH}
  6. Test the install from a command prompt:
     mvn --version 
    Should produce something similar to (paths and OS might be different):
    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"
    
Back To Top

Maven Setup

Once Maven and Java have been installed, Maven will need to be setup and configured for the development environment/laptop.

  1. Create/Modify your "settings.xml" file:
    1. If you are new to Maven, open/create a file named "settings.xml" in your HOME/.m2 directory (example for windows: c:\Users\me\.m2\settings.xml and for Mac/Linux: ~/.m2/settings.xml))
    2. Set the contents to be:
      <?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>
      
  2. Establish the maven property that points to the Chrome Driver location: NOTE: If you have an environment variable named "WEBDRIVER_HOME", skip this step
    • Based on the above settings.xml file, set the "path.to.webdriver" property to the location of the Chrome Driver executable
Back To Top

Chrome

This framework is best run using Chrome via Chrome Browser since the browser can be run in incognito mode for maximum load time

  1. Download and install Chrome Browser - Download Here
Back To Top

ChromeDriver Setup

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.

  1. Download ChromeDriver - Download Here
  2. Unpack the compressed artifact into aknown location. NOTE: Remember this location
  3. Create an environment variable named WEBDRIVER_HOME
  4. Set the value to the location of the executable from step #1
  5. Save and close
Back To Top