• Stars
    star
    1,008
  • Rank 43,809 (Top 0.9 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 14 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rails Generators for Cucumber with special support for Capybara and DatabaseCleaner

Cucumber-Rails

Gem Version build Code Climate Open Source Helpers

Cucumber-Rails brings Cucumber to Rails 5.2, 6.x and 7.x.

Installation

Before you can use the generator, add the gem to your project's Gemfile as follows:

group :test do
  gem 'cucumber-rails', require: false
  # database_cleaner is not required, but highly recommended
  gem 'database_cleaner'
end

Then install it by running:

bundle install

Learn about the various options:

rails generate cucumber:install --help

Finally, bootstrap your Rails app, for example:

rails generate cucumber:install

Running Cucumber

[bundle exec] cucumber

Configuration options

By default, cucumber-rails runs DatabaseCleaner.start and DatabaseCleaner.clean before and after your scenarios. You can disable this behaviour like so:

# features/support/env.rb
# ...
Cucumber::Rails::Database.autorun_database_cleaner = false

By default, cucumber-rails will auto mix-in the helpers from Rack::Test into your default Cucumber World instance. You can prevent this behaviour like so:

# features/support/env.rb
ENV['CR_REMOVE_RACK_TEST_HELPERS'] = 'true'

Upgrading from a previous version

When upgrading from a previous version it is recommended that you rerun:

rails generate cucumber:install

Bugs and feature requests

The only way to have a bug fixed or a new feature accepted is to describe it with a Cucumber feature. Let's say you think you have found a bug in the cucumber:install generator. Fork this project, clone it to your workstation and check out a branch with a descriptive name:

git clone [email protected]:you/cucumber-rails.git
git checkout -b bugfix/generator-fails-on-bundle-exec

Start by making sure you can run the existing features. Now, create a feature that demonstrates what's wrong. See the existing features for examples. When you have a failing feature that reproduces the bug, commit, push and send a pull request. Someone from the Cucumber-Rails team will review it and hopefully create a fix.

If you know how to fix the bug yourself, make a second commit (after committing the failing feature) before you send the pull request.

Setting up your environment

Make sure you have a supported ruby installed, cd into your cucumber-rails repository and run

gem install bundler
bundle install
bin/install_geckodriver.sh
bin/install_webpacker.sh

Running all tests

With all dependencies installed, all specs and features should pass:

[bundle exec] rake

Running Appraisal suite

In order to test against multiple versions of key dependencies, the Appraisal gem is used to generate multiple gemfiles, stored in the gemfiles/ directory. Normally these will only run on GitHub via GitHub Actions; however if you want to run the full test suite against all gemfiles, run the following commands:

[bundle exec] appraisal install
[bundle exec] appraisal rake test

To run the suite against a named gemfile, use the following:

[bundle exec] appraisal rails_6_0 rake test

Adding dependencies

To support the multiple-gemfile testing, when adding a new dependency the following rules apply:

  1. If it's a runtime dependency of the gem, add it to the gemspec
  2. If it's a primary development dependency, add it to the gemspec
  3. If it's a dependency of a generated rails app in a test, add it to the helper method that modifies the Gemfile

For example, rspec is a primary development dependency, so it lives in the gemspec.

More Repositories

1

cucumber-ruby

Cucumber for Ruby. It's amazing!
Ruby
5,157
star
2

cucumber-js

Cucumber for JavaScript
TypeScript
4,928
star
3

common

A home for issues that are common to multiple cucumber repositories
3,359
star
4

cucumber-jvm

Cucumber for the JVM
Java
2,644
star
5

godog

Cucumber for golang
Go
2,193
star
6

aruba

Test command-line applications with Cucumber-Ruby, RSpec or Minitest.
Ruby
948
star
7

cucumber-java-skeleton

This is the simplest possible setup for Cucumber-JVM using Java.
Java
448
star
8

cucumber-cpp

Support for writing Cucumber step definitions in C++
C++
295
star
9

cucumber-eclipse

Eclipse plugin for Cucumber
Java
188
star
10

docs

Cucumber user documentation
CSS
133
star
11

gherkin

A parser and compiler for the Gherkin language.
C
131
star
12

cucumber-expressions

Human friendly alternative to Regular Expressions
Java
129
star
13

cucumber-android

Android support for Cucumber-JVM
Kotlin
124
star
14

cucumber-electron

Run cucumber.js in electron
JavaScript
119
star
15

gherkin-go

[READ-ONLY] Gherkin for Go - subtree of https://github.com/cucumber/gherkin -- moved to https://github.com/cucumber/gherkin
Go
84
star
16

gherkin-javascript

[READ-ONLY] Gherkin for JavaScript - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
TypeScript
80
star
17

gherkin-python

[READ-ONLY] Gherkin for Python - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
Python
75
star
18

vscode

Official Visual Studio Code Extension for Cucumber
TypeScript
55
star
19

gherkin-java

[READ-ONLY] Gherkin for Java - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
Java
50
star
20

screenplay.js

Library to ease implementation of the Screenplay pattern with CucumberJS
TypeScript
50
star
21

gherkin-dotnet

[READ-ONLY] Gherkin for Dotnet - subtree of monorepo https://github.com/cucumber/cucumber Gherkin parser/compiler for .NET
C#
48
star
22

cucumber-jvm-scala

Cucumber Scala
Scala
46
star
23

cucumber-ruby-core

Core library for the Ruby flavour of Cucumber
Ruby
37
star
24

react-components

React components for Cucumber
TypeScript
31
star
25

cucumber-lua

A cucumber wire protocol implementation for Lua step definitions
Lua
29
star
26

language-server

Cucumber Language Server
TypeScript
28
star
27

cucumber.ml

Cucumber for OCaml
OCaml
26
star
28

blockly

Gherkin Editor based on Blockly
TypeScript
23
star
29

cucumber-jvm-groovy

Cucumber Groovy
Java
21
star
30

cucumber-js-examples

Examples of using Cucumber-JS
Makefile
20
star
31

microdata

Extract WHATWG microdata from a DOM
TypeScript
18
star
32

json-formatter

Provides a language-agnostic command-line tool to convert cucumber messages into a JSON document.
Go
18
star
33

cucumber-js-pretty-formatter

Cucumber.js pretty formatter
TypeScript
14
star
34

monaco

Configure Monaco editor to use cucumber-language-service
TypeScript
13
star
35

messages

PHP
12
star
36

html-formatter

HTML formatter for reporting Cucumber results
Java
11
star
37

language-service

Cucumber Language Service
TypeScript
11
star
38

gherkin-c

[READ-ONLY] Gherkin for C - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
C
10
star
39

ci-environment

Detect CI Environment from environment variables
Java
8
star
40

gherkin-ruby

[READ-ONLY] Gherkin for Ruby - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
Ruby
7
star
41

cucumber-eclipse-update-site-snapshot

Cucumber Eclipse Update Site Snapshots
CSS
7
star
42

gherkin-objective-c

[READ-ONLY] Gherkin for Objective C - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
Objective-C
7
star
43

cucumber-ruby-wire

Wire protocol plugin for Cucumber
Gherkin
7
star
44

screenplay.js.examples

Examples using @cucumber/screenplay
TypeScript
6
star
45

gherkin-utils

API for working with Gherkin documents
TypeScript
6
star
46

cucumber-json-converter

Parse Cucumber JSON from most Cucumber implementations and versions
TypeScript
6
star
47

tag-expressions

Cucumber tag expression parser
Python
5
star
48

polyglot-release

Make polyglot releases with a single command
Shell
5
star
49

todo-react-typescript-subsecond

Tiny Todo app in React and TypeScript demonstrating sub-second test feedback
TypeScript
4
star
50

action-retire-inactive-contributors

Retire inactive contributors from one team to another
TypeScript
4
star
51

cucumber-json-schema

JSON Schemas for Cucumber JSON output
Ruby
4
star
52

messages-go

[READ ONLY] Cucumber Messages for Go - subtree of monorepo https://github.com/cucumber/messages -- moved to https://github.com/cucumber/messages
Go
3
star
53

try-cucumber-expressions

Try Cucumber Expressions in your browser
TypeScript
3
star
54

cucumber-eclipse-update-site

Cucumber Eclipse Update Site
3
star
55

gherkin-perl

[READ-ONLY] Gherkin for Perl - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/gherkin
Perl
2
star
56

github-settings

Pulumi scripts to automatically configure our GitHub org/repo settings
TypeScript
2
star
57

gherkin-php

[READ ONLY] Cucumber Gherkin for PHP - subtree of https://github.com/cucumber/gherkin
PHP
2
star
58

cucumber-junit-xml-formatter

JUnit XML formatter for reporting Cucumber results
Java
2
star
59

oselvar-github-metrics

Oselvar GitHub Metrics for the Cucumber Organisation
Shell
2
star
60

gherkin-streams

Stream utilities to read Gherkin parser output.
TypeScript
2
star
61

build

Docker image used to build the Cucumber Project
Shell
2
star
62

fake-cucumber

Tool to generate test data for cucumber
TypeScript
2
star
63

messages-javascript

[READ ONLY] Cucumber Messages for JavaScript (Protocol Buffers) - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/messages
TypeScript
2
star
64

commitbit

Microservice that hands out commit bit to everyone who gets a pull request merged
JavaScript
2
star
65

aruba-getting-started

Getting started with aruba
Ruby
2
star
66

action-changelog

GitHub Action for changelog tool
Shell
1
star
67

release-announcement-banner

For blog posts where we announce a new version of a Cucumber tool
JavaScript
1
star
68

split-java

A Cucumber plugin to toggle Split features from Cucumber scenarios
Java
1
star
69

cucumber-js-package-upgrade

package to point users to the new @cucumber/cucumber
JavaScript
1
star
70

messages-java

[READ ONLY] Cucumber Messages for Java (Protocol Buffers) - subtree of monorepo https://github.com/cucumber/cucumber
Java
1
star
71

action-publish-subrepo-test-monorepo-a-subfolder

target for tests for https://github.com/cucumber/action-publish-subrepo
1
star
72

cucumber-parent

Parent `pom.xml` for all Cucumber Java modules
1
star
73

action-publish-rubygem

GitHub Action to publish a Ruby Gem
Ruby
1
star
74

compatibility-kit

Platform-agnostic set of acceptance tests for validating cucumber implementations
TypeScript
1
star
75

action-publish-subrepo-test-monorepo

Test repo for testing the action-publish-subrepo GitHub Action
1
star
76

messages-ruby

[READ ONLY] Cucumber Messages for Ruby (Protocol Buffers) - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/messages
Ruby
1
star
77

action-publish-mvn

GitHub Action to publish Maven artefacts
Java
1
star
78

message-streams

Stream utilities to read and write Cucumber Message objects to/from streams.
TypeScript
1
star
79

action-publish-npm

GitHub Action to publish an NPM module
1
star
80

query

A query API for https://github.com/cucumber/messages
TypeScript
1
star
81

messages-dotnet

[READ ONLY] Cucumber Messages for .NET (Protocol Buffers) - subtree of monorepo https://github.com/cucumber/cucumber -- moved to https://github.com/cucumber/messages
Makefile
1
star
82

.github

πŸ‘©β€βš•οΈ Default community health files for the Cucumber organisation on GitHub.
Shell
1
star