cucumber 2.99.0 → 3.0.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +22 -10
- data/CONTRIBUTING.md +13 -0
- data/Gemfile +11 -4
- data/History.md +19 -1
- data/README.md +1 -1
- data/cucumber.gemspec +2 -2
- data/cucumber.yml +2 -2
- data/features/docs/api/listen_for_events.feature +7 -6
- data/features/docs/cli/help.feature +8 -0
- data/features/docs/cli/retry_failing_tests.feature +51 -16
- data/features/docs/defining_steps/nested_steps_i18n.feature +2 -0
- data/features/docs/defining_steps/printing_messages.feature +0 -1
- data/features/docs/defining_steps/skip_scenario.feature +0 -34
- data/features/docs/extending_cucumber/custom_formatter.feature +2 -30
- data/features/docs/formatters/summary_formatter.feature +34 -0
- data/features/docs/gherkin/unicode_table.feature +1 -1
- data/features/docs/post_configuration_hook.feature +0 -16
- data/features/docs/writing_support_code/world.feature +129 -0
- data/features/lib/step_definitions/aruba_steps.rb +1 -0
- data/features/lib/step_definitions/cli_steps.rb +4 -0
- data/features/lib/step_definitions/cucumber_steps.rb +1 -0
- data/features/lib/step_definitions/iso-8859-1_steps.rb +1 -0
- data/features/lib/step_definitions/json_steps.rb +1 -0
- data/features/lib/step_definitions/junit_steps.rb +1 -0
- data/features/lib/step_definitions/language_steps.rb +1 -0
- data/features/lib/step_definitions/profile_steps.rb +1 -0
- data/features/lib/step_definitions/retry_steps.rb +32 -12
- data/features/lib/step_definitions/ruby_steps.rb +1 -0
- data/features/lib/step_definitions/wire_steps.rb +1 -0
- data/features/lib/support/env.rb +2 -1
- data/features/lib/support/fake_wire_server.rb +1 -0
- data/features/lib/support/feature_factory.rb +1 -0
- data/features/lib/support/normalise_output.rb +1 -0
- data/gem_tasks/contributors.rake +1 -0
- data/gem_tasks/cov.rake +1 -0
- data/gem_tasks/cucumber.rake +1 -0
- data/gem_tasks/downloads.rb +1 -0
- data/gem_tasks/environment.rake +1 -0
- data/gem_tasks/examples.rake +2 -1
- data/gem_tasks/fix_cr_lf.rake +2 -1
- data/gem_tasks/flog.rake +2 -1
- data/gem_tasks/rspec.rake +1 -0
- data/gem_tasks/sass.rake +2 -1
- data/lib/autotest/cucumber.rb +1 -0
- data/lib/autotest/cucumber_mixin.rb +1 -0
- data/lib/autotest/cucumber_rails.rb +1 -0
- data/lib/autotest/cucumber_rails_rspec.rb +1 -0
- data/lib/autotest/cucumber_rails_rspec2.rb +1 -0
- data/lib/autotest/cucumber_rspec.rb +1 -0
- data/lib/autotest/cucumber_rspec2.rb +1 -0
- data/lib/autotest/discover.rb +1 -0
- data/lib/cucumber.rb +1 -13
- data/lib/cucumber/cli/configuration.rb +3 -6
- data/lib/cucumber/cli/main.rb +2 -1
- data/lib/cucumber/cli/options.rb +239 -173
- data/lib/cucumber/cli/profile_loader.rb +1 -0
- data/lib/cucumber/cli/rerun_file.rb +1 -0
- data/lib/cucumber/configuration.rb +40 -19
- data/lib/cucumber/constantize.rb +1 -0
- data/lib/cucumber/core_ext/instance_exec.rb +1 -0
- data/lib/cucumber/core_ext/string.rb +1 -0
- data/lib/cucumber/deprecate.rb +1 -0
- data/lib/cucumber/encoding.rb +1 -0
- data/lib/cucumber/errors.rb +3 -1
- data/lib/cucumber/events.rb +13 -3
- data/lib/cucumber/events/step_definition_registered.rb +24 -0
- data/lib/cucumber/events/step_match.rb +4 -1
- data/lib/cucumber/events/test_run_finished.rb +12 -0
- data/lib/cucumber/file_specs.rb +1 -0
- data/lib/cucumber/filters.rb +2 -0
- data/lib/cucumber/filters/activate_steps.rb +2 -1
- data/lib/cucumber/filters/apply_after_hooks.rb +1 -0
- data/lib/cucumber/filters/apply_after_step_hooks.rb +1 -0
- data/lib/cucumber/filters/apply_around_hooks.rb +1 -0
- data/lib/cucumber/filters/apply_before_hooks.rb +1 -0
- data/lib/cucumber/filters/gated_receiver.rb +1 -0
- data/lib/cucumber/filters/prepare_world.rb +1 -0
- data/lib/cucumber/filters/quit.rb +1 -0
- data/lib/cucumber/filters/randomizer.rb +1 -0
- data/lib/cucumber/filters/retry.rb +3 -3
- data/lib/cucumber/filters/tag_limits.rb +1 -0
- data/lib/cucumber/filters/tag_limits/test_case_index.rb +1 -0
- data/lib/cucumber/filters/tag_limits/verifier.rb +1 -0
- data/lib/cucumber/formatter/ansicolor.rb +1 -0
- data/lib/cucumber/formatter/backtrace_filter.rb +3 -2
- data/lib/cucumber/formatter/console.rb +61 -52
- data/lib/cucumber/formatter/console_counts.rb +57 -0
- data/lib/cucumber/formatter/console_issues.rb +37 -0
- data/lib/cucumber/formatter/debug.rb +1 -0
- data/lib/cucumber/formatter/duration.rb +1 -0
- data/lib/cucumber/formatter/duration_extractor.rb +1 -0
- data/lib/cucumber/formatter/fail_fast.rb +4 -2
- data/lib/cucumber/formatter/fanout.rb +1 -0
- data/lib/cucumber/formatter/hook_query_visitor.rb +1 -0
- data/lib/cucumber/formatter/html.rb +6 -5
- data/lib/cucumber/formatter/ignore_missing_messages.rb +1 -0
- data/lib/cucumber/formatter/interceptor.rb +1 -0
- data/lib/cucumber/formatter/io.rb +1 -0
- data/lib/cucumber/formatter/json.rb +15 -13
- data/lib/cucumber/formatter/json_pretty.rb +1 -0
- data/lib/cucumber/formatter/junit.rb +13 -11
- data/lib/cucumber/formatter/legacy_api/adapter.rb +28 -32
- data/lib/cucumber/formatter/legacy_api/ast.rb +1 -0
- data/lib/cucumber/formatter/legacy_api/results.rb +1 -0
- data/lib/cucumber/formatter/legacy_api/runtime_facade.rb +1 -0
- data/lib/cucumber/formatter/pretty.rb +7 -1
- data/lib/cucumber/formatter/progress.rb +56 -13
- data/lib/cucumber/formatter/rerun.rb +15 -18
- data/lib/cucumber/formatter/stepdefs.rb +1 -0
- data/lib/cucumber/formatter/steps.rb +1 -0
- data/lib/cucumber/formatter/summary.rb +43 -20
- data/lib/cucumber/formatter/unicode.rb +1 -0
- data/lib/cucumber/formatter/usage.rb +26 -21
- data/lib/cucumber/gherkin/data_table_parser.rb +1 -0
- data/lib/cucumber/gherkin/formatter/ansi_escapes.rb +1 -0
- data/lib/cucumber/gherkin/formatter/escaping.rb +1 -0
- data/lib/cucumber/gherkin/i18n.rb +1 -0
- data/lib/cucumber/gherkin/steps_parser.rb +1 -0
- data/lib/cucumber/hooks.rb +1 -0
- data/lib/cucumber/load_path.rb +1 -0
- data/lib/cucumber/multiline_argument.rb +1 -2
- data/lib/cucumber/multiline_argument/data_table.rb +3 -1
- data/lib/cucumber/multiline_argument/doc_string.rb +1 -0
- data/lib/cucumber/platform.rb +1 -0
- data/lib/cucumber/project_initializer.rb +2 -1
- data/lib/cucumber/rake/task.rb +1 -0
- data/lib/cucumber/rb_support/rb_dsl.rb +11 -9
- data/lib/cucumber/rb_support/rb_hook.rb +1 -0
- data/lib/cucumber/rb_support/rb_language.rb +19 -8
- data/lib/cucumber/rb_support/rb_step_definition.rb +1 -0
- data/lib/cucumber/rb_support/rb_transform.rb +1 -0
- data/lib/cucumber/rb_support/rb_world.rb +42 -20
- data/lib/cucumber/rb_support/snippet.rb +2 -1
- data/lib/cucumber/rspec/disable_option_parser.rb +1 -0
- data/lib/cucumber/rspec/doubles.rb +1 -0
- data/lib/cucumber/running_test_case.rb +1 -25
- data/lib/cucumber/runtime.rb +15 -10
- data/lib/cucumber/runtime/after_hooks.rb +1 -0
- data/lib/cucumber/runtime/before_hooks.rb +1 -0
- data/lib/cucumber/runtime/for_programming_languages.rb +1 -0
- data/lib/cucumber/runtime/step_hooks.rb +1 -0
- data/lib/cucumber/runtime/support_code.rb +1 -0
- data/lib/cucumber/runtime/user_interface.rb +1 -0
- data/lib/cucumber/step_argument.rb +1 -0
- data/lib/cucumber/step_definition_light.rb +1 -0
- data/lib/cucumber/step_definitions.rb +1 -0
- data/lib/cucumber/step_match.rb +1 -0
- data/lib/cucumber/step_match_search.rb +1 -0
- data/lib/cucumber/term/ansicolor.rb +1 -0
- data/lib/cucumber/unit.rb +1 -0
- data/lib/cucumber/version +1 -1
- data/lib/simplecov_setup.rb +1 -0
- data/spec/cucumber/cli/configuration_spec.rb +1 -0
- data/spec/cucumber/cli/main_spec.rb +1 -0
- data/spec/cucumber/cli/options_spec.rb +1 -0
- data/spec/cucumber/cli/profile_loader_spec.rb +1 -0
- data/spec/cucumber/cli/rerun_spec.rb +1 -0
- data/spec/cucumber/configuration_spec.rb +1 -0
- data/spec/cucumber/constantize_spec.rb +1 -0
- data/spec/cucumber/core_ext/instance_exec_spec.rb +1 -0
- data/spec/cucumber/file_specs_spec.rb +1 -0
- data/spec/cucumber/filters/activate_steps_spec.rb +9 -6
- data/spec/cucumber/filters/gated_receiver_spec.rb +1 -0
- data/spec/cucumber/filters/retry_spec.rb +27 -21
- data/spec/cucumber/filters/tag_limits/test_case_index_spec.rb +1 -0
- data/spec/cucumber/filters/tag_limits/verifier_spec.rb +1 -0
- data/spec/cucumber/filters/tag_limits_spec.rb +1 -0
- data/spec/cucumber/formatter/ansicolor_spec.rb +1 -0
- data/spec/cucumber/formatter/console_counts_spec.rb +14 -0
- data/spec/cucumber/formatter/debug_spec.rb +1 -0
- data/spec/cucumber/formatter/duration_spec.rb +1 -0
- data/spec/cucumber/formatter/fail_fast_spec.rb +5 -5
- data/spec/cucumber/formatter/html_spec.rb +6 -1
- data/spec/cucumber/formatter/interceptor_spec.rb +1 -0
- data/spec/cucumber/formatter/json_spec.rb +29 -28
- data/spec/cucumber/formatter/junit_spec.rb +1 -0
- data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +8 -3
- data/spec/cucumber/formatter/pretty_spec.rb +1 -0
- data/spec/cucumber/formatter/progress_spec.rb +2 -1
- data/spec/cucumber/formatter/rerun_spec.rb +70 -64
- data/spec/cucumber/formatter/spec_helper.rb +8 -7
- data/spec/cucumber/hooks_spec.rb +1 -0
- data/spec/cucumber/multiline_argument/data_table_spec.rb +1 -0
- data/spec/cucumber/project_initializer_spec.rb +2 -1
- data/spec/cucumber/rake/forked_spec.rb +1 -0
- data/spec/cucumber/rake/task_spec.rb +1 -0
- data/spec/cucumber/rb_support/rb_language_spec.rb +81 -3
- data/spec/cucumber/rb_support/rb_step_definition_spec.rb +1 -0
- data/spec/cucumber/rb_support/rb_transform_spec.rb +1 -0
- data/spec/cucumber/rb_support/rb_world_spec.rb +2 -1
- data/spec/cucumber/rb_support/snippet_spec.rb +1 -0
- data/spec/cucumber/running_test_case_spec.rb +1 -0
- data/spec/cucumber/runtime/for_programming_languages_spec.rb +1 -0
- data/spec/cucumber/runtime/support_code_spec.rb +1 -0
- data/spec/cucumber/runtime_spec.rb +1 -0
- data/spec/cucumber/step_argument_spec.rb +1 -0
- data/spec/cucumber/step_match_search_spec.rb +1 -0
- data/spec/cucumber/step_match_spec.rb +1 -0
- data/spec/cucumber/world/pending_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/standard_step_actions.rb +1 -0
- metadata +24 -23
- data/lib/cucumber/ast.rb +0 -13
- data/lib/cucumber/events/after_test_case.rb +0 -25
- data/lib/cucumber/events/after_test_step.rb +0 -30
- data/lib/cucumber/events/before_test_case.rb +0 -18
- data/lib/cucumber/events/before_test_step.rb +0 -23
- data/lib/cucumber/events/bus.rb +0 -86
- data/lib/cucumber/events/finished_testing.rb +0 -9
- data/lib/cucumber/formatter/event_bus_report.rb +0 -38
- data/spec/cucumber/events/bus_spec.rb +0 -94
- data/spec/cucumber/formatter/event_bus_report_spec.rb +0 -88
- data/spec/cucumber_spec.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f5e472b2944bf6dadc1f272709c796c93dcceb5
|
4
|
+
data.tar.gz: c1a1751dbb2b0cd1d530304ae0e30bb229350374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e6adc11f7c868ba3eff12b7774b1c2260de26bfd02df48644b577bbe0f76cd9946431376f4536b2f0ea5a1c1a1b86c61de7b5a4351f2467b55f0e43abe8cf29
|
7
|
+
data.tar.gz: 3e3be3a63d780965aa357ab93e3a34a6b95ff65c283ee6ad9af997c7c550ac4901a867d77e4cf84ff27f89e4a09f6859e95a939f75642faaf90607edf016830c
|
data/.travis.yml
CHANGED
@@ -1,23 +1,35 @@
|
|
1
1
|
sudo: false
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
matrix:
|
4
|
+
include:
|
5
|
+
- rvm: 2.3.1
|
6
|
+
- rvm: 2.2
|
7
|
+
- rvm: 2.1
|
8
|
+
- rvm: 2.0
|
9
|
+
- rvm: jruby-9.1.2.0
|
10
|
+
env:
|
11
|
+
# Travis by default also have "-Dcext.enabled=false" set in
|
12
|
+
# JRUBY_OPTS, but JRuby 9 does not support C extensions at all
|
13
|
+
# so it issues warning that will mess up the sterr checks.
|
14
|
+
- JRUBY_OPTS="--server -Xcompile.invokedynamic=false"
|
15
|
+
# Somehow a "ASCII-8BIT to UTF-8 conversion error" appears for
|
16
|
+
# JRuby 9
|
17
|
+
- LC_ALL=en_US.UTF-8
|
18
|
+
- LANG=en_US.UTF-8
|
19
|
+
- LANGUAGE=en_US.UTF-8
|
10
20
|
|
11
21
|
# whitelist
|
12
22
|
branches:
|
13
23
|
only:
|
14
24
|
- master
|
15
|
-
- resolve-issue-882
|
16
25
|
- v1.3.x-bugfix
|
17
|
-
- v2.x-bugfix
|
18
26
|
|
19
27
|
before_install:
|
20
28
|
- gem update bundler
|
21
29
|
|
22
30
|
notifications:
|
23
|
-
email:
|
31
|
+
email:
|
32
|
+
- cukes-devs@googlegroups.com
|
33
|
+
webhooks:
|
34
|
+
urls: # gitter
|
35
|
+
- https://webhooks.gitter.im/e/dc010332f9d40fcc21c4
|
data/CONTRIBUTING.md
CHANGED
@@ -19,6 +19,19 @@ The rest of this document is a guide for those maintaining Cucumber, and others
|
|
19
19
|
|
20
20
|
You can chat with the core team on https://gitter.im/cucumber/cucumber. We try to have office hours on Fridays.
|
21
21
|
|
22
|
+
## Installing your own gems
|
23
|
+
|
24
|
+
A `Gemfile.local`-file can be used to have your own gems installed to support
|
25
|
+
your normal development workflow.
|
26
|
+
|
27
|
+
Example:
|
28
|
+
|
29
|
+
~~~ruby
|
30
|
+
gem 'pry'
|
31
|
+
gem 'pry-byebug'
|
32
|
+
gem 'byebug'
|
33
|
+
~~~
|
34
|
+
|
22
35
|
## Note on Patches/Pull Requests
|
23
36
|
|
24
37
|
* Fork the project. Make a branch for your change.
|
data/Gemfile
CHANGED
@@ -1,14 +1,21 @@
|
|
1
1
|
gem "cucumber-pro", "0.0.13", :group => :test
|
2
2
|
source "https://rubygems.org"
|
3
3
|
gemspec
|
4
|
+
load File.expand_path('../Gemfile.local', __FILE__) if File.file? File.expand_path('../Gemfile.local', __FILE__)
|
5
|
+
|
4
6
|
unless ENV['CUCUMBER_USE_RELEASED_CORE']
|
5
7
|
core_path = File.expand_path("../../cucumber-ruby-core", __FILE__)
|
6
8
|
wire_path = File.expand_path("../../cucumber-ruby-wire", __FILE__)
|
7
|
-
if File.exist?(core_path) && !ENV[
|
8
|
-
gem
|
9
|
-
|
9
|
+
if File.exist?(core_path) && !ENV["cucumber_use_git_core"]
|
10
|
+
gem "cucumber-core", :path => core_path
|
11
|
+
else
|
12
|
+
gem "cucumber-core", :git => "https://github.com/cucumber/cucumber-ruby-core.git"
|
13
|
+
end
|
14
|
+
|
15
|
+
if File.exist?(wire_path) && !ENV["CUCUMBER_USE_GIT_CORE"]
|
16
|
+
gem "cucumber-wire", :path => wire_path
|
10
17
|
else
|
11
|
-
gem
|
18
|
+
gem "cucumber-wire", :git => "https://github.com/cucumber/cucumber-ruby-wire.git"
|
12
19
|
end
|
13
20
|
end
|
14
21
|
|
data/History.md
CHANGED
@@ -1,9 +1,27 @@
|
|
1
|
-
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v2.4.0...
|
1
|
+
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v2.4.0...master)
|
2
|
+
|
3
|
+
### Breaking changes
|
4
|
+
|
5
|
+
* Remove support for Ruby 1.9.3 ([#993](https://github.com/cucumber/cucumber-ruby/pull/993) @brasmusson)
|
2
6
|
|
3
7
|
### New Features
|
4
8
|
|
9
|
+
* Use the event bus in Cucumber-Ruby-Core ([#973](https://github.com/cucumber/cucumber-ruby/pull/973) @mattwynne)
|
10
|
+
* Add --retry option to retry failed tests as part of the same run ([#920](https://github.com/cucumber/cucumber-ruby/pull/920) @DanaScheider)
|
11
|
+
* Add a summary formatter ([#999](https://github.com/cucumber/cucumber-ruby/pull/999) @mattwynne)
|
12
|
+
* Namespaced World modules ([#1007](https://github.com/cucumber/cucumber-ruby/pull/1007) @nodo)
|
13
|
+
|
5
14
|
### Bugfixes
|
6
15
|
|
16
|
+
* Configure Gemfile to fetch cucumber-ruby-wire from git if the repo is not found locally ([#983](https://github.com/cucumber/cucumber-ruby/pulls/983), resolves [#961](https://github.com/cucumber/cucumber-ruby/issues/961))
|
17
|
+
* Fix regression displaying CLI help ([#991](https://github.com/cucumber/cucumber-ruby/pull/991) @mattwynne)
|
18
|
+
* with_filtered_backtrace called on Test::Result::Unknown with strange feature file ([#967](https://github.com/cucumber/cucumber-ruby/issues/967) @danascheider)
|
19
|
+
* fix HTML formatter backtrace duplicate line bug ([#965](https://gthub.com/cucumber/cucumber-ruby/pull/965) @josephks)
|
20
|
+
|
21
|
+
### Refactoring
|
22
|
+
|
23
|
+
* Add frozen string literal magic comment to files and fix issues it causes ([#996](https://github.com/cucumber/cucumber-ruby/pull/996 @twalpole)
|
24
|
+
|
7
25
|
## [v2.4.0](https://github.com/cucumber/cucumber-ruby/compare/v2.3.3...v2.4.0)
|
8
26
|
|
9
27
|
### New Features
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Join the chat at https://gitter.im/cucumber/cucumber-ruby](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cucumber/cucumber-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
2
|
-
[![Build Status](https://
|
2
|
+
[![Build Status](https://travis-ci.org/cucumber/cucumber-ruby.svg?branch=master)](https://travis-ci.org/cucumber/cucumber-ruby)
|
3
3
|
[![Code Climate](https://codeclimate.com/github/cucumber/cucumber-ruby.svg)](https://codeclimate.com/github/cucumber/cucumber-ruby)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/cucumber/cucumber-ruby/badge.svg?branch=master)](https://coveralls.io/r/cucumber/cucumber-ruby?branch=master)
|
5
5
|
[![Dependency Status](https://gemnasium.com/cucumber/cucumber-ruby.svg)](https://gemnasium.com/cucumber/cucumber-ruby)
|
data/cucumber.gemspec
CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.summary = "cucumber-#{s.version}"
|
8
8
|
s.email = 'cukes@googlegroups.com'
|
9
9
|
s.license = 'MIT'
|
10
|
-
s.homepage = "
|
10
|
+
s.homepage = "https://cucumber.io/"
|
11
11
|
s.platform = Gem::Platform::RUBY
|
12
12
|
s.required_ruby_version = ">= 1.9.3"
|
13
|
-
s.add_dependency 'cucumber-core', '~>
|
13
|
+
s.add_dependency 'cucumber-core', '~> 2.0'
|
14
14
|
s.add_dependency 'builder', '>= 2.1.2'
|
15
15
|
s.add_dependency 'diff-lcs', '>= 1.1.3'
|
16
16
|
s.add_dependency 'gherkin', '~> 4.0'
|
data/cucumber.yml
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
cucumber_pro_opts = ENV['ENABLE_CUCUMBER_PRO'] ? "--format Cucumber::Pro --out /dev/null" : ""
|
3
3
|
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
4
4
|
rerun_opts = rerun.to_s.strip.empty? ? "--format progress features" : "--format pretty #{rerun}"
|
5
|
-
std_opts = "--format progress features
|
5
|
+
std_opts = "--format progress features -r features --strict #{cucumber_pro_opts}"
|
6
6
|
std_opts << " --tags ~@wip-jruby" if defined?(JRUBY_VERSION)
|
7
7
|
|
8
|
-
wip_opts = "--color -r features --tags @wip
|
8
|
+
wip_opts = "--color -r features --tags @wip"
|
9
9
|
wip_opts << ",@wip-jruby" if defined?(JRUBY_VERSION)
|
10
10
|
%>
|
11
11
|
default: <%= std_opts %> --tags ~@jruby
|
@@ -1,5 +1,8 @@
|
|
1
1
|
Feature: Listen for events
|
2
2
|
|
3
|
+
Cucumber's `config` object has an event bus that you can use to listen for
|
4
|
+
various events that happen during your test run.
|
5
|
+
|
3
6
|
Scenario: Step Matched Event
|
4
7
|
Given a file named "features/test.feature" with:
|
5
8
|
"""
|
@@ -16,9 +19,8 @@ Feature: Listen for events
|
|
16
19
|
"""
|
17
20
|
AfterConfiguration do |config|
|
18
21
|
io = config.out_stream
|
19
|
-
config.on_event
|
22
|
+
config.on_event :step_match do |event|
|
20
23
|
io.puts "Success!"
|
21
|
-
io.puts "Event type: #{event.class}"
|
22
24
|
io.puts "Step name: #{event.test_step.name}"
|
23
25
|
io.puts "Source location: #{event.step_match.location}"
|
24
26
|
end
|
@@ -28,7 +30,6 @@ Feature: Listen for events
|
|
28
30
|
Then it should pass with:
|
29
31
|
"""
|
30
32
|
Success!
|
31
|
-
Event type: Cucumber::Events::StepMatch
|
32
33
|
Step name: matching
|
33
34
|
Source location: features/step_definitions/steps.rb:1
|
34
35
|
"""
|
@@ -45,14 +46,14 @@ Feature: Listen for events
|
|
45
46
|
"""
|
46
47
|
AfterConfiguration do |config|
|
47
48
|
io = config.out_stream
|
48
|
-
config.on_event
|
49
|
-
io.puts
|
49
|
+
config.on_event :test_step_finished do |event|
|
50
|
+
io.puts event.result.passed?
|
50
51
|
end
|
51
52
|
end
|
52
53
|
"""
|
53
54
|
When I run `cucumber`
|
54
55
|
Then it should pass with:
|
55
56
|
"""
|
56
|
-
|
57
|
+
true
|
57
58
|
"""
|
58
59
|
|
@@ -1,32 +1,67 @@
|
|
1
|
-
@wip
|
2
1
|
Feature: Retry failing tests
|
3
2
|
|
4
3
|
Retry gives you a way to get through flaky tests that usually pass after a few runs.
|
5
4
|
This gives a development team a way forward other than disabling a valuable test.
|
6
|
-
|
5
|
+
|
7
6
|
- Specify max retry count in option
|
8
7
|
- Output information to the screen
|
9
8
|
- Output retry information in test report
|
10
|
-
|
9
|
+
|
11
10
|
Questions:
|
12
11
|
use a tag for flaky tests? Global option to retry any test that fails?
|
13
|
-
|
12
|
+
|
14
13
|
Background:
|
15
|
-
Given a scenario "
|
16
|
-
And a scenario "
|
14
|
+
Given a scenario "Fails-once" that fails once, then passes
|
15
|
+
And a scenario "Fails-twice" that fails twice, then passes
|
17
16
|
And a scenario "Solid" that passes
|
18
|
-
And a scenario "
|
19
|
-
|
20
|
-
Scenario:
|
21
|
-
When I run `cucumber -q --retry 1`
|
17
|
+
And a scenario "Fails-forever" that fails
|
18
|
+
|
19
|
+
Scenario: Retry once, so Fails-once starts to pass
|
20
|
+
When I run `cucumber -q --retry 1 --format summary`
|
21
|
+
Then it should fail with:
|
22
|
+
"""
|
23
|
+
7 scenarios (5 failed, 2 passed)
|
24
|
+
"""
|
25
|
+
And it should fail with:
|
26
|
+
"""
|
27
|
+
Fails-forever
|
28
|
+
Fails-forever ✗
|
29
|
+
Fails-forever ✗
|
30
|
+
|
31
|
+
Solid
|
32
|
+
Solid ✓
|
33
|
+
|
34
|
+
Fails-once feature
|
35
|
+
Fails-once ✗
|
36
|
+
Fails-once ✓
|
37
|
+
|
38
|
+
Fails-twice feature
|
39
|
+
Fails-twice ✗
|
40
|
+
Fails-twice ✗
|
41
|
+
"""
|
42
|
+
|
43
|
+
Scenario: Retry twice, so Fails-twice starts to pass too
|
44
|
+
When I run `cucumber -q --retry 2 --format summary`
|
22
45
|
Then it should fail with:
|
23
46
|
"""
|
24
|
-
|
47
|
+
9 scenarios (6 failed, 3 passed)
|
48
|
+
"""
|
49
|
+
And it should fail with:
|
25
50
|
"""
|
51
|
+
Fails-forever
|
52
|
+
Fails-forever ✗
|
53
|
+
Fails-forever ✗
|
54
|
+
Fails-forever ✗
|
55
|
+
|
56
|
+
Solid
|
57
|
+
Solid ✓
|
58
|
+
|
59
|
+
Fails-once feature
|
60
|
+
Fails-once ✗
|
61
|
+
Fails-once ✓
|
26
62
|
|
27
|
-
|
28
|
-
|
29
|
-
|
63
|
+
Fails-twice feature
|
64
|
+
Fails-twice ✗
|
65
|
+
Fails-twice ✗
|
66
|
+
Fails-twice ✓
|
30
67
|
"""
|
31
|
-
4 scenarios (3 passed, 1 failed)
|
32
|
-
"""
|
@@ -8,6 +8,7 @@ Feature: Nested Steps in I18n
|
|
8
8
|
And a step definition that looks like this:
|
9
9
|
"""ruby
|
10
10
|
# -*- coding: utf-8 -*-
|
11
|
+
# frozen_string_literal: true
|
11
12
|
前提 /a turtle/ do
|
12
13
|
puts "turtle!"
|
13
14
|
end
|
@@ -17,6 +18,7 @@ Feature: Nested Steps in I18n
|
|
17
18
|
Given a step definition that looks like this:
|
18
19
|
"""ruby
|
19
20
|
# -*- coding: utf-8 -*-
|
21
|
+
# frozen_string_literal: true
|
20
22
|
前提 /two turtles/ do
|
21
23
|
steps %{
|
22
24
|
前提 a turtle
|
@@ -28,37 +28,3 @@ Feature: Skip Scenario
|
|
28
28
|
2 steps (2 skipped)
|
29
29
|
|
30
30
|
"""
|
31
|
-
|
32
|
-
@spawn
|
33
|
-
Scenario: Use (deprecated) legacy API
|
34
|
-
Given a file named "features/test.feature" with:
|
35
|
-
"""
|
36
|
-
Feature: test
|
37
|
-
Scenario: test
|
38
|
-
Given this step passes
|
39
|
-
And this step passes
|
40
|
-
"""
|
41
|
-
And the standard step definitions
|
42
|
-
And a file named "features/support/hook.rb" with:
|
43
|
-
"""
|
44
|
-
Before do |scenario|
|
45
|
-
scenario.skip_invoke!
|
46
|
-
end
|
47
|
-
"""
|
48
|
-
When I run `cucumber -q`
|
49
|
-
Then it should pass with:
|
50
|
-
"""
|
51
|
-
Feature: test
|
52
|
-
|
53
|
-
Scenario: test
|
54
|
-
Given this step passes
|
55
|
-
And this step passes
|
56
|
-
|
57
|
-
1 scenario (1 skipped)
|
58
|
-
2 steps (2 skipped)
|
59
|
-
|
60
|
-
"""
|
61
|
-
And the stderr should contain:
|
62
|
-
"""
|
63
|
-
deprecated
|
64
|
-
"""
|
@@ -19,7 +19,7 @@ Feature: Custom Formatter
|
|
19
19
|
class Formatter
|
20
20
|
def initialize(config)
|
21
21
|
@io = config.out_stream
|
22
|
-
config.on_event
|
22
|
+
config.on_event :test_case_starting do |event|
|
23
23
|
print_test_case_name(event.test_case)
|
24
24
|
end
|
25
25
|
end
|
@@ -41,34 +41,6 @@ Feature: Custom Formatter
|
|
41
41
|
|
42
42
|
"""
|
43
43
|
|
44
|
-
Scenario: Implement v2.0 formatter methods
|
45
|
-
Note that this method is likely to be deprecated in favour of events - see above.
|
46
|
-
|
47
|
-
Given a file named "features/support/custom_formatter.rb" with:
|
48
|
-
"""
|
49
|
-
module MyCustom
|
50
|
-
class Formatter
|
51
|
-
def initialize(config)
|
52
|
-
@io = config.out_stream
|
53
|
-
end
|
54
|
-
|
55
|
-
def before_test_case(test_case)
|
56
|
-
feature = test_case.source.first
|
57
|
-
scenario = test_case.source.last
|
58
|
-
@io.puts feature.short_name.upcase
|
59
|
-
@io.puts " #{scenario.name.upcase}"
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
"""
|
64
|
-
When I run `cucumber features/f.feature --format MyCustom::Formatter`
|
65
|
-
Then it should pass with exactly:
|
66
|
-
"""
|
67
|
-
I'LL USE MY OWN
|
68
|
-
JUST PRINT ME
|
69
|
-
|
70
|
-
"""
|
71
|
-
|
72
44
|
Scenario: Use the legacy API
|
73
45
|
This is deprecated and should no longer be used.
|
74
46
|
|
@@ -99,7 +71,7 @@ Feature: Custom Formatter
|
|
99
71
|
"""
|
100
72
|
|
101
73
|
Scenario: Use both old and new
|
102
|
-
You can
|
74
|
+
You can both APIs at once, for now
|
103
75
|
|
104
76
|
Given a file named "features/support/custom_mixed_formatter.rb" with:
|
105
77
|
"""
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Feature: Spec formatter
|
2
|
+
|
3
|
+
This formatter mimics the output from tools like RSpec or Mocha, giving an
|
4
|
+
overview of each feature and scenario but omitting the steps.
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given the standard step definitions
|
8
|
+
|
9
|
+
Scenario: A couple of scenarios
|
10
|
+
Given a file named "features/test.feature" with:
|
11
|
+
"""
|
12
|
+
Feature: Test
|
13
|
+
Scenario: Passing
|
14
|
+
Given this step passes
|
15
|
+
|
16
|
+
Scenario: Failing
|
17
|
+
Given this step fails
|
18
|
+
"""
|
19
|
+
When I run `cucumber --format summary`
|
20
|
+
Then it should fail with exactly:
|
21
|
+
"""
|
22
|
+
Test
|
23
|
+
Passing ✓
|
24
|
+
Failing ✗
|
25
|
+
|
26
|
+
Failing Scenarios:
|
27
|
+
cucumber features/test.feature:5 # Scenario: Failing
|
28
|
+
|
29
|
+
2 scenarios (1 failed, 1 passed)
|
30
|
+
2 steps (1 failed, 1 passed)
|
31
|
+
0m0.012s
|
32
|
+
|
33
|
+
"""
|
34
|
+
|