Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This site contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Extending System Tests

Extending System Tests

  1. Ensure that the system-tests module is built:
    • To build system-tests module, navigate to the /ep-commerce/extensions/cortex/system-tests module and run the following command:
      1. mvn clean install -DskipAllTests

      Copy

About this task

Elastic Path provides automated tests to ensure the smooth implementation of Cortex when you extend or alter the functionality. These tests ensure that the exiting functionality do not fail when you add new functionality by changing or extending code. Elastic Path recommends configuring tests for extended functionality in a separate module at /ep-commerce/extensions/cortex/ext-system-tests.

Use the following procedures to set up a test extension module in your local development environment:

  1. Add tests and step definitions.
  2. Run against a remote Cortex instance.

Adding Tests and Step Definition

  1. In the extensions/cortex/ext-system-tests/cucumber/src/test/resources/features/ directory, create a new directory.
  2. In the new directory, create a .feature file to add the test definitions.
  3. Add the test step definitions in the .feature file.
    1. Scenario: Search product
    2. Given I am logged in as a public shopper
    3. When I search for an item name Alien
    4. Then the item code is alien_sku

    Copy

Running Against a Remote Cortex Instance

  1. Navigate to the extensions/cortex/ext-system-tests/ directory and run the following command:
    1. mvn clean install -Dep.rest.baseurl="http://<REMOTE_SERVER_URL>/cortex

    Copy

    The <REMOTE_SERVER_URL> specifies the URL of your remote Cortex instance. For example, 9080.
  2. To run a specific test, add the following argument:
    1. -Dcucumber.options="--tags @example"

    Copy