Cucumber table optimizer

A nice feature [sic] of a Cucumber .feature-file is that it it provides a means to execute a specific scenario for a wide variety of environment properties in the form of tables.

The downside of this approach is that a .feature-file with a table containing a large amount of rows takes a long time to complete. There are plenty of tools to run Cucumber tests in parallel, but this parallelization only works on the .feature-file level. As such, your brilliant test with a large table will run in a single VM.

For this purpose Cucumber Table Optimizer (CTO) was created. It's a command line Java utility that can recursively look for Cucumber files in a specified input folder and split .feature-files containing tables into individual files (one for each row in the table). This allows the test runner to utilize a unique VM per table row to greatly reduce total execution time of the test suite.

To integrate CTO within your pipeline:

  • You run CTO on your test source folder prior to compiling your tests
  • Compile the test suite from the (temporary) CTO output folder...

...and that's it!

CTO gives you to the benefit that you don't have to think about writing your tests in a parallel-execution friendly format, you simply worry about writing the appropriate scenario and a table for all the different circumstances you'd like to test in.