Installing the Storefront Test Automation Engine and its dependencies

The Storefront Test Automation Engine facilitates the process of writing, maintaining, and running test scripts.

Before you begin

  • Ensure that one of the following three types of Eclipse-based environments is installed to work with the Storefront Test Automation Engine and the automation scripts:
    Note:
    • Automation scripts can be edited and run in the same environment, such as the toolkit environment.
    • Ensure that you are using Java 1.8. Java 1.8 is required for the test assets to satisfy Selenium's recommendation for their driver.
  • Ensure that one of the following web browsers is installed for test execution:
    • Latest Firefox or Firefox ESR
    • Internet Explorer 11
    • Latest Chrome
  • The Selenium driver (which is used by the test assets) maintains compatibility with the most current versions of Firefox, Firefox ESR, and Chrome. As a result, you occasionally need to move up to a new version of Selenium to test against newer browsers.
  • Internet Explorer 11 has some instability with long running tests, such as out-of-memory errors. When this occurs, you must restart the testing where the last test failed, or break up the testing into smaller test suites.
  • The Selenium driver for Microsoft Edge is not complete. Automated testing against Microsoft Edge is not available currently.
  • Notes:
    • The Storefront Test Automation Engine was tested with:
      • Firefox 38 ESR or 39
      • Internet Explorer 11
      • Chrome 46
    • If you plan to use Internet Explorer 11, follow the Required Configuration. For more information, see Internet Explorer Required Configuration.
  • The Storefront Test Automation Assets are dependent upon several third-party libraries. You can download them manually or use the Ant script that is provided in the topic, to automatically fetch all of the third-party libraries automatically from the Maven repository. A list of the key third-party libraries required:
    Files to download and extract Versions tested with Storefront Test Automation Engine Notes
    Selenium Server
    Important: You must download the latest version to support the latest web browser versions. Failure to do so might cause tests to fail.
    • Selenium Server 2.48.2
    • Selenium Server 2.46.0
    • Selenium Server 2.53.1
    For the current Selenium Server library, see: Selenium Server. For previous releases, see: Selenium previous releases.
    HttpClient.zip binary with dependencies archive (.zip) file.
    • HttpClient 4.5.2
    Some test scripts require setup steps that access WebSphere Commerce Accelerator or IBM Management Center for WebSphere Commerce. To do so, the Storefront Test Automation Engine uses HttpClient to make HTTP calls to the WebSphere Commerce back-end tooling.
    Google Guice Google Guice 3
    Google Gson Google Gson 2.6.2
    Freemarker Freemarker 2.3.25
    Apache Ant if you plan to run tests from the command-line instead of using an Eclipse-based environment Apache Ant 1.9.2 Ensure that the following conditions are met:
    • The JAVA_HOME and ANT_HOME environment variables are defined.
    • ANT_HOME/bin is in your system PATH.
  • The Storefront Test Automation Assets provide and calls to Commerce Web Services. For that to work, you must download the Commerce client library and the dependent libraries that include ICU4J and several EMF JARs. Download the following files from the WebSphere Commerce Developer machine:
    • IBMIMShared\plugins\org.eclipse.emf.ecore.xmi_version.jar
    • IBMIMShared\plugins\org.eclipse.emf.ecore.change_version.jar
    • IBMIMShared\plugins\org.eclipse.emf.common_version.jar
    • IBMIMShared\plugins\org.eclipse.emf_version.jar
    • IBMIMShared\plugins\org.eclipse.emf.codegen_version.jar
    • IBMIMShared\plugins\org.eclipse.emf.ecore_version.jar
    • IBMIMShared\plugins\org.eclipse.xsd_version.jar
    • IBMIMShared\plugins\org.eclipse.emf.ecore.sdo_version.jar
    • IBMIMShared\plugins\org.eclipse.emf.commonj.sdo_version.jar
    Note the location of the JAR files that you copied.
  • Download all the WebSphere Commerce Client Library JAR files from the WebSphere Commerce Developer machine:
    • WCDE_installdir\WC\Foundation-Core.jar
    • WCDE_installdir\WC\Performance-Profiler.jar
    • WCDE_installdir\WC\*-DataObjects.jar
    • WCDE_installdir\WC\*-Client.jar
    • WCDE_installdir\WC\lib\JSON4J.jar
    Note the location of the files that you copied. For more information about the Client Library, see Deploying the client library.
  • Review Compiling JavaServer Page files before you attempt to run any tests. Running test automation scripts without compiling JavaServer Pages on the store might cause long page load times and result in timeout errors.
  • To ensure that all the default test cases work correctly, run the following store setup tasks:
  • Copy the JSON4J.jar to your StarterStoreTestAssetsDependencies project.

Procedure

  1. Install the Storefront Test Automation Engine.
    1. In your Eclipse-based environment, ensure that the Java perspective is open. If it is not, or you are uncertain whether the Java perspective is open, follow these steps:
      1. Click Window > Open Perspective > Other.
      2. Select Java; then, click OK.
    2. Select File > Import.
    3. In the Import window, select General > Existing Projects into Workspace; then, click Next.
    4. Select Select archive file and then click Browse.
    5. Open the Storefront Test Assets compressed file:
      • Browse to the location to which StorefrontTestAssets<version>.zip was downloaded, select StorefrontTestAssets<version>.zip. Click Open.
    6. Select all of the projects and then click Finish.
      The Storefront Test Automation Engine projects are now in the Eclipse-based environment. Since the library dependencies are not installed yet, the Problems view displays multiple compilation errors. You will resolve these errors in the next steps.
  2. Add WebSphere Commerce dependencies to the Storefront Test Automation Engine.
    1. Expand the lib folder in the StarterStoreTestAssetsDependencies project.
    2. Copy the previously downloaded Eclipse EMF JAR files to the lib directory.
    3. Copy the previously downloaded WebSphere Commerce service layer JAR files to the lib directory.
  3. Add the third-party dependencies to the Storefront Test Automation Engine.
    1. If your Eclipse has the Ant plug in installed:
      1. Expand the Ant folder in the StarterStoreTestAssetsDependencies project.
      2. Open the build.xml file for editing.
      3. Update the org="com.google.guava" dependency to include force="true" rev="19.0".
        <dependency org="com.google.guava" name="guava" force="true" rev="19.0" conf="runtime" />
      4. Save and close the file.
      5. Right click build.xml.
      6. Click Run As | Ant Build.
        Note: Ensure that the Ant run is successful.
      7. Refresh the StarterStoreTestAssetsDependencies project.
      The project picks up the new class path, and recompiles all of the projects. After the compilation is finished, all projects are clean, and contain no errors.
    2. If your Eclipse does not have an Ant plug in installed:
      1. Open a command line prompt.
      2. Go to Eclipsepath/StarterStoreTestAssetsDependencies/ant.
      3. Run ant.
        Note: Ensure that the Ant run is successful.
      4. Refresh the StarterStoreTestAssetsDependencies project.
      The project picks up the new class path, and recompiles all of the projects. After the compilation is finished, all projects are clean, and contain no errors.
  4. Download the web driver for your browser.
    OptionDescription
    Firefox You do not need to download the Firefox web driver as it is included in selenium.
    Note: There is a version compatibility issue with each selenium driver. Ensure that the Firefox version is supported by the Selenium version.
    Internet Explorer
    1. Download the 32-bit IE driver.
    2. Extract the file to your system.
    3. In the Aurora-Widget-Wte project, change the config.properties file to update the following properties:
      BROWSER_TYPE=INTERNET_EXPLORER
      IE_DRIVER_SERVER_PATH=<your IEDriverServer.exe path>
    Chrome
    1. Download the latest Chrome driver from Chrome Driver.
    2. Extract the file to your system.
    3. In the Aurora-Widget-Wte project, change the config.properties file to update the following properties:
      BROWSER_TYPE=CHROME
      CHROME_DRIVER_SERVER_PATH=<your chromedriver.exe path>

Results

The Storefront Test Automation Engine and its dependencies are installed. Instructions for setting up your web browser to run automation scripts are provided.

Tips and hints:
  • Look at the Javadoc for documentation on each package and class for more information.
  • To run all the test cases: Aurora-Widget-Wte\com.ibm.commerce.qa.aurora.runners\AllTests.java
  • The config.properties file contains all the user-defined parameters. Change the HOSTNAME, STOREURL, and BROWSER_TYPE to match your environment.
  • To run tests in different viewports, update the WINDOW_WIDTH to the want pixel width.

What to do next