Running tests in an Eclipse-based environment

You can run tests in Eclipse-based software to run a test case, a test scenario, or a test bucket as a JUnit test suite.

Before you begin

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 host name of the store web server.
    STOREURL
    The URL to the root of the store you are testing.
    BROWSER
    The web browser that you are using for your testing, such as Firefox, Chrome, or Internet Explorer.
    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).
    PRODUCT_TYPE
    Valid values are TOOLKIT and RUNTIME, with RUNTIME as the default. Identifies if the test is being run against a WebSphere Commerce Toolkit or Runtime server.
    SET_LOGGER
    Valid values are TRUE or FALSE. If set to TRUE, the frame uses the logging.properties file in the root of the project. If set to FALSE, which is the default value, the framework logs INFO, WARNING, and SEVERE to the standard output. It is recommended to set this value to TRUE.
  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 go 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 go 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 that is created by the FSTOREB2C_00.java test case, it is recommended that you run this test case first to populate the test data.
    1. In your Eclipse-based environment, open the Package Explorer view and go 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 1 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 passed or failed. If the test case fails, a corresponding error message also shows.