0.02
A long-lived project that still receives updates
Slices a Cucumber test suite into the smallest possible executable pieces (i.e. scenarios and individual outline example rows. These pieces can then be more easily used for running tests in parallel.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 3.0
< 5.0.0
< 4.0.0
< 13.0.0
~> 3.0
< 2.0
<= 0.50.0
< 1.0.0
< 1.0

Runtime

>= 3.2, < 4.0
 Project Readme

Basic stuff: Gem Version Project License Downloads

User stuff: Cucumber Docs Yard Docs

Developer stuff: Build Status Coverage Status Maintainability


CukeSlicer

The cuke_slicer gem provides an easy and programmatic way to divide a Cucumber test suite into granular test cases that can then be dealt with on an individual basis. Often this means handing them off to a distributed testing system in order to parallelize test execution.

Installation

Add this line to your application's Gemfile:

gem 'cuke_slicer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cuke_slicer

Usage

require 'cuke_slicer'


# Choose which part of your test suite that you want to slice up
test_directory = 'path/to/your_test_directory'

# Choose your slicing filters
filters = {excluded_tags: ['@tag1','@tag2'],
           included_tags: '@tag3',
           excluded_paths: 'foo',
           included_paths: [/test_directory/]}

# Use the slicer to find all tests matching those filters
found_tests = CukeSlicer::Slicer.new.slice(test_directory, filters, :file_line)


# Arrange the sliced pieces to suit your particular needs. In this case, we will dump them
# into a file that Cucumber can consume.

File.open('tests_to_run.txt', 'w') { |file| file.puts found_tests }

system('cucumber @tests_to_run.txt')

In addition to tag and path filters, a block can be used for filtering tests by inspecting the underlying CukeModeler models that represent test cases and filtering on whatever criteria you can think up.

CukeSlicer::Slicer.new.slice(test_directory, {}, :file_line) do |test_case|
  test_case.is_a?(CukeModeler::Scenario) &&
  test_case.get_ancestor(:feature).name =~ /first/
end

Development and Contributing

See CONTRIBUTING.md

License

The gem is available as open source under the terms of the MIT License.