Extending System Tests
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:
mvn clean install -DskipAllTests
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:
- Add tests and step definitions
- Run against a remote Cortex instance
Adding Tests and Step Definition
-
In the
extensions/cortex/ext-system-tests/cucumber/src/test/resources/features/directory, create a new directory. -
In the new directory, create a
.featurefile to add the test definitions. -
Add the test step definitions in the
.featurefile.Scenario: Search productGiven I am logged in as a public shopperWhen I search for an item name AlienThen the item code is alien_sku
Running Against a Remote Cortex Instance
-
Navigate to the
extensions/cortex/ext-system-tests/directory and run the following command:mvn clean install -Dep.rest.baseurl="http://<REMOTE_SERVER_URL>/cortexThe
<REMOTE_SERVER_URL>specifies the URL of your remote Cortex instance. For example,9080. -
To run a specific test, add the following argument:
-Dcucumber.options="--tags @example"