Karate setup


Here are described the steps to write karate integration tests.


Project Setup

If you want to create module from scratch then create you maven module within folio-integration-tests folder like acquisitions (See also pom.xml file from folio-integration-tests/acquisitions/pom.xml for example)

  • Create JUnit test file folio-integration-tests/<YourProject>/src/test/java/org/folio/<YourTestFileName>.java
  • Project should have karate configuration file (See acquisitions/src/main/resources/karate-config.js)
  • Extend your Test with TestBase
  • Create constructor with TestModuleConfiguration and specify TEST_BASE_PATH (see FinanceApiTest for example)
public FinanceApiTest() {
	super(new TestIntegrationService(
	new TestModuleConfiguration(TEST_BASE_PATH)));

  • Add an test method with runFeatureTest where parameter is your karate feature file with test logic
void deleteOpenedOrderAndOrderLines() {
  • Add two setup methods into your test file like financeApiTestBeforeAll (to setup tenant, users and setup data for module run) financeApiTestAfterAll (to destroy tenant and all related data for module run)

finance-junit.feature and destroy-data.feature should contain logic to setup and destroy data for tenant. (See examples acquisitions/src/main/resources/domain/mod-finance/finance-junit.feature and common/src/main/resources/common/destroy-data.feature)

public void financeApiTestBeforeAll() {

public void financeApiTestAfterAll() {

Run integration test

Run examples
mvn test -Dtest=FinanceApiTest -pl acquisitions

Where instead of "-pl acquisitions" argument you should use your own project name.

Result of Jenkins after CI build