Verify the Behavior Testing Framework installation

About this task

Check that you installed the framework correctly. You can do this by: (1) verifying that the appropriate directories and files have been added, (2) running a base configuration feature file, and (3) running a base configuration suite.

The scenarios provided in Behavior Testing Framework will pass when executed against a stand-alone base configuration instance of PolicyCenter. If the instance has been integrated with other Guidewire applications or configured, some tests may not pass.

Procedure

  1. Open Guidewire Studio.
  2. Optionally verify that the following directories and files exist:
    • In configuration/gsrc/gw/api/test, a pcSmokeTestClassBase file.
    • A configuration/gsrc/gw/smoketest.pl directory.
    • A configuration/gtest/gw/cucumber directory.
    • A configuration/gtest/gw/enhancement directory.
    • In configuration/gtest/gw/suites, a pcExampleSmokeSuite file.
    • A configuration/gtest/gw/smoketest directory.
    • In configuration/res/cucumber, multiple subfolders that contain Cucumber feature files.
  3. If you are installing Behavior Testing Framework on a configured instance of PolicyCenter, you may see compile errors in Studio. These errors are caused by impl methods in Behavior Testing Framework that reference PCF elements in the base configuration that have been either modified or removed in the configured instance. Resolve these compile issues before proceeding to the next step. You can resolve each issue by doing the following:
    1. Identify the impl method that is causing the compile error.
    2. Comment out the code in the method.
    3. Add a line of code that throws an UnsupportedOperationException. For example: throw new UnsupportedOperationException("Not yet implemented")
    If you resolve the issues in this way, then all code will compile. When you run a scenario that references one of these impl methods, the scenario will fail due to the UnsupportedOperationException.
  4. Test a base configuration feature file.
    The feature file assumes that PolicyCenter has been installed in stand-alone mode and has not been configured. When run on a stand-alone base configuration of PolicyCenter, all scenarios in the feature file will pass. If PolicyCenter has been integrated with other Guidewire applications or configured, one or more scenarios may fail.
    1. Navigate to configuration/res/cucumber/account.
    2. Right-click the AccountManagement_Agent.feature file, and then click Run 'Feature: AccountManagement_Agent'.
    Studio opens a Run Feature <FeatureName> tab. The left pane contains icons that identify the tests that pass or fail. The right pane contains a console with the server output during testing.
  5. Test a base configuration suite.
    A suite is a collection of feature files that are executed together. The suite assumes that PolicyCenter has not been configured. When run on a base configuration of PolicyCenter, all scenarios in the suite will pass. If PolicyCenter has been configured, one or more scenarios may fail.
    There is a known issue with Behavior Testing Framework that prevents a test suite from running if there is a running test server. As a workaround, if there is a running test server, stop it before executing the following steps.
    1. Navigate to configuration/gtest/gw/suites.
    2. Right-click the PCBehaviorCucumberSuite file, and then click Run 'PCBehaviorCucumberSuite'.
    Studio opens a Run <SuiteName> tab. The left pane contains icons that identify the tests that pass or fail. The right pane contains a console with the server output during testing.