
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
cucumber_characteristics
Advanced tools
Gem to profile cucumber steps and features.
Step analysis including
Feature analysis including
Other features.
Add this line to your application's Gemfile:
gem 'cucumber_characteristics'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install cucumber_characteristics
Add the following line to your cucumber environment file typically found at features\support\env.rb
require 'cucumber_characteristics/autoload'
For always-on automatic loading (recommended), add require 'cucumber_characteristics/autoload'
to features/support/yourapp_env.rb
. It is recommended by cucumber that you do not enhance features/support/env.rb so that upgrades are painless (relatively)
Add it to your cucumber.yml
by adding --format CucumberCharacteristics::Formatter
i.e.
std_opts = "-r features/. -r --quiet --format CucumberCharacteristics::Formatter --format progress"
Use it via command line with --format CucumberCharacteristics::Formatter
.
You can configure the export of step characteristics via the following (defaults are same as example)
CucumberCharacteristics.configure do |config|
config.export_json = true
config.export_html = true
config.precision = 4
config.target_filename = 'cucumber_step_characteristics'
config.relative_path = 'features/characteristics'
end
This again can be added to your cucumber environment file typically found at features\support\env.rb
Exported characteristic information is listed out at the end of the cucumber run in a message similar to
Step characteristic report written to /home/singram/projects/gems/cucumber_characteristics/features/characteristics/cucumber_step_characteristics.html
Step characteristic report written to /home/singram/projects/gems/cucumber_characteristics/features/characteristics/cucumber_step_characteristics.json
depending on the options specified.
The JSON option is provided for convenience in case there is a further use case/analysis required that is not provided by the gem.
An example can be found here
The formatting hooks on the face of it provide the necessary event points to profile any given feature file. This is true for a Scenario, but consider the following ScenaioOutline
Feature: As a user I want to understand where my tests are spending their time
Scenario Outline: Timings for scenario outline
Given I wait <given_wait> seconds
When I wait <when_wait> seconds
Then I wait <then_wait> seconds
And I wait 0.2 seconds
Examples:
| given_wait | when_wait | then_wait |
| 1 | 2 | 3 |
| 5 | 6 | 7 |
Running
cucumber --format debug features/outline.feature
A couple of problems become evident
This is why when you use the 'progress' formatter you would get 4 'skipped' for the initial step hooks triggered and then only 6 green dots representing steps when there should be 8 as it key's off table cells not steps.
Possible solutions
As it turns out it was pretty simple to enhance the runtime object to reliably return profile information.
Install development environment
bundle install
Run formatter over default cucumber version
bundle exec cucumber
Run tests across all supported cucumber versions
bundle exec rake versions:bundle:install
bundle exec rake versions:test
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that cucumber_characteristics demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.