Running tests from the command line
You can run test scenarios individually or all
at once by using an Ant script. The script generates a report that
contains the results of the tests.
Before you begin
- The store that you want to test is set up
- Install Java JDK 1.5 or higher, and ensured that the system environment variable JAVA_HOME points to the JDK installation directory.
- Extract the StorefrontTestAssets.zip package to a directory of your choice, if you do not intend to use the same files as your Eclipse-based environment installation.
- ; if you have an Eclipse-based environment that is installed, you can follow these instructions. If you do not have an Eclipse-based environment that is installed, you must manually extract the StorefrontTestAssets.zip projects into a directory of your choice and then copy the third-party libraries that are described in that topic by using basic operating system copy commands instead of through Eclipse.
- .
- Changed the following properties in the config.properties file
to reflect your environment. This file stores the configuration properties
for running tests and is in the root of the test bucket project for
the store.
- HOSTNAME
- The host name of the store web server.
- STOREURL
- The URL to the root of the store you are testing.
- BROWSER
- ADMIN_USER_NAME
- The site administrator user name.
- ALLOW_MODIFY_CHANGE_FLOWS
- Determines whether the change flow options can be changed in a test (true) or not (false).
About this task
- Batch test execution
- Since the results of each test execution are archived, you can easily run the same script multiple times with different test cases specified in the build.properties file.
- Custom test bucket execution
Procedure
Results
The results of a set of tests are stored in the test archive folder. By default, this folder is in the target/doc/archive subdirectory of the project. This folder contains one or more timestamped directories that represent the different test runs.
The test report includes
a Packages section that displays the name of
the test bucket and a Classes section that
lists the test scenarios that make up the test bucket. Four test characteristics
are also summarized in the report.
- Failures and Errors
- Cause the test to fail. Clicking the number links to a page that displays the test scenario and the corresponding test bucket that caused the failure or error. Details are also provided to help correct the issue.
- Success rate
- The percentage of automation scripts that passed.
- Total run time
- The total amount of time (in seconds) for all the automation scripts to run.
The detailed report that is generated in batch mode simplifies the process of locating and correcting failures in your automation scripts. For each test scenario, the report lists the four main characteristics, a timestamp of when it completed, and the host name of the virtual machine that ran it.