Introduced in Feature Pack 1

Running tests in an Eclipse-based environment

Running your tests in Eclipse-based software allows you to run a test case, a test scenario, or a test bucket as a JUnit test suite.

Before you begin

  • The store you want to test is set up.
  • .
  • .

Procedure

  1. In the root of the store's test bucket project, locate the config.properties file. This file stores the configuration properties for running tests.
  2. In the config.properties file, change the following properties to reflect your environment:
    HOSTNAME
    The hostname of the store web server.
    STOREURL
    The URL to the root of the store you are testing.
    BROWSER
    The web browser you are using for your testing. For example, *firefox or *iexplore.
    ADMIN_USER_NAME
    The site administrator user name.
    ADMIN_PASSWORD
    The site administrator password.
    ALLOW_MODIFY_CHANGE_FLOWS
    Determines whether the change flow options can be changed in a test (true) or not (false).
  3. Use one of the following scenarios to run your tests:
    OptionDescription
    Run the entire test bucket
    1. In the Java perspective of your Eclipse-based environment, locate the Package Explorer view and navigate to the tests directory.
    2. Locate the AllTests.java class.
    3. Right-click the AllTests.java class; then select Run As > JUnit Test.
    Run a test scenario
    1. In your Eclipse-based environment, open the Package Explorer view and navigate to the tests scenario directory.
    2. Right-click the test script that you want to run; then select Run As > JUnit Test.
    Run a single test case
    Note: Since many test cases require data created by the FSTOREB2C_00.java test case, it is recommended that you run this test case first to populate the required test data.
    1. In your Eclipse-based environment, open the Package Explorer view and navigate to the tests scenario directory.
    2. Locate the test scenario that contains the test case you want to run; double-click the test scenario to open it.
    3. Locate the single test case that you want to run. There is one Java method for each test case.
    4. Right-click the Java method name for the test case; then select Run As > JUnit Test.

Results

The status of each test case displays in the development environment as either having passed or failed. If the test case fails, a corresponding error message also displays.