The purpose of this framework is to minimize the amount of bolierplate code required to test Demandware Site Genesis 2.0 implementations. The goal of the framework is to establish a base level of testing flows for Site Genesis 2.0, provide re-usable and extensible Page/Module objects and the mechanisms to extend the framework for deviations from Site Genesis 2.0
Back To TopThis documentation will cover what and why specific technology has been implemented and how to use the framework to add automated testing to a Demandware project
In order to use and extend this framework, the following must be installed and working correctly:
The following are optional but useful tools when working with Git:
After all of the prerequisites have been met, tests may be initiated from an IDE (Eclipse or IntelliJ) or via Maven command-line prompt.
Run the Maven "test" phase from the command line:
mvn clean test
user@computer ~/projects/demandware-testing-framework (master) $ mvn clean test [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building demandware-testing-framework 0.01-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ demandware-testing-framework --- [INFO] Deleting c:\Users\user\projects\demandware-testing-framework\target [INFO] [INFO] --- maven-enforcer-plugin:1.2:enforce (enforce-property) @ demandware-testing-framework --- [INFO] [INFO] --- gmaven-plugin:1.5:generateStubs (default) @ demandware-testing-framework --- [INFO] Generated 40 Java stubs [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ demandware-testing-framework --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 42 resources [INFO] Copying 1 resource [INFO] [INFO] --- jrebel-maven-plugin:1.1.3:generate (generate-rebel-xml) @ demandware-testing-framework --- [INFO] Processing com.acquitygroup.demandware:demandware-testing-framework with packaging jar [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ demandware-testing-framework --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 43 source files to c:\Users\user\projects\demandware-testing-framework\target\classes [INFO] [INFO] --- gmaven-plugin:1.5:compile (default) @ demandware-testing-framework --- [INFO] Compiled 240 Groovy classes [INFO] [INFO] --- gmaven-plugin:1.5:generateTestStubs (default) @ demandware-testing-framework --- [INFO] Generated 15 Java stubs [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ demandware-testing-framework --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 15 resources [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ demandware-testing-framework --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 15 source files to c:\Users\user\projects\demandware-testing-framework\target\test-classes [INFO] [INFO] --- gmaven-plugin:1.5:testCompile (default) @ demandware-testing-framework --- [INFO] Compiled 30 Groovy classes [INFO] [INFO] --- maven-surefire-plugin:2.13:test (default-test) @ demandware-testing-framework --- [INFO] Surefire report directory: c:\Users\user\projects\demandware-testing-framework\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.acquitygroup.webtest.flow.GuestCheckoutWebFlow Started ChromeDriver port=25195 version=26.0.1383.0 log=c:\Users\user\projects\demandware-testing-framework\chromedriver.log Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 50.753 sec Results : Tests run: 9, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1:07.979s [INFO] Finished at: Sat Feb 23 17:28:55 PST 2013 [INFO] Final Memory: 37M/341M [INFO] ------------------------------------------------------------------------ user@computer ~/projects/demandware-testing-framework (master) $
This project requires Java 1.7 and Maven 3.0.3+ in order to build and run the test cases. Both are expected to be available on the PATH and have their appropriate environment variables defined. Follow the directions below if the target machine does not meet these requirements
cd <where you want to put the repository> git clone git@bitbucket.org:mikeensor/demandware-testing-framework.git
Configuration variables are used to expose specific configuration points within the testing framework allowing for flexibility when using the testing framework. Configuration variables are implemented by first checking for an Environment Variable, then an Environment Property. If neither exist, the build will fail for required environment properties
When running tests on SauceLabs a set of special environment properties are expected to configure the RemoteDriver object. There are two required environment proeprties comprising the credentials and one optional property to name the job for debugging.
Variable | Description | Requred Scope/Use | Type |
---|---|---|---|
saucelabs.username | Username for SauceLabs account | Remote Sessions | String |
saucelabs.password | API Key/Passphrase for SauceLabs account. Passphrase located on the account page for Sauce Labs user | Remote Sessions | String |
DW_CLIENT_PASSWORD | Client ID matching OCAPI configuration | OCAPI Enabled Services | String |
WEBDRIVER_HOME | File path location to Chrome Driver on local system | Local sessions | String |
webdriver.chrome.driver | Alias for WEBDRIVER_HOME | Local sessions | String |
Variable | Description | Requred Scope/Use | Type |
---|---|---|---|
saucelabs.jobname | Provide a name for SauceLabs to name the running instance (eg: BUILD_12345) | Remote Sessions | String |
logging.webtest.level | Enables command-line level changes to the logging levels of web tests. Values can be: debug, info, warn, error | Anytime | String |