Skip to content

Introduction

This wiki contains the documentation of CrossTest, a free to use library for testing data solutions using gherkin. With CrossTest frequently used test scenarios for data solutions are supported. These test scenarios can be defined using natural language using the Gherkin grammar rules. This could include filling a table with a few records, performing an ETL process and then comparing the result with what is expected in another table.

The framework is open source, released under GPLv3 and can be used without license costs.

Features of CrossTest are:

  • Specifying test scenarios in natural language (Gherkin)
  • No dataset required and therefore a lower test effort
  • Supports various database and ETL platforms
  • Expandable to support new test types or platforms
  • Can be integrated into CI / CD pipelines such as Jenkins or Azure DevOps

CrossTest illustration

CrossTest variants

Currently there are two versions of CrossTest. One using .NET and Specflow, aimed at projects using the Microsoft stack. One using Java and Cucumber, aimed at projects using non-Microsoft stacks. Our aim is to have the two versions fully compatible. This so test scenarios implemented using the Specflow version can be run using the Cucumber version and vice versa. At this moment, this is not the case and the sentences implemented in both versions have different variations.

Therefore, when working with CrossTest, be sure to refer to the instructions that correspond to the version you are using. Documentation for the .NET/specflow version can be found here. The Java/Cucumber version of CrossTest is documented here.

Example test scenario

Below is a simple example of a test scenario, using the Java/Cucumber flavor of CrossTest, where data is inserted into a table, then a ETL proces is run and finally the contents of a table is compared with an expected result.

Feature: A simple demo of CrossTest
  I want to create a simple test scenario using CrossTest

  Scenario: Simple scenario
   Given the source table Customer is empty
   And the target table Customer is empty

   When I insert the following data in source table Customer:
      | Customer_ID | Customer_Name | Country |
      |        1234 | Mr Smith      | NL      |
      |         431 | Mrs Jones     | USA     |

   And I run the demo process load_Customer  

   And I retrieve the contents of the target Customer table
   Then I expect the following result:
      | Customer_ID | Customer_Name | Country |
      |        1234 | Mr Smith      | NL      |
      |         431 | Mrs Jones     | USA     |