From f4a8fc94e0475f62d0ce78a900a8604e27b64a06 Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 10 Oct 2023 15:22:49 +0100 Subject: [PATCH 1/3] Update gherkin --- devkit/samples/skipped/skipped.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devkit/samples/skipped/skipped.feature b/devkit/samples/skipped/skipped.feature index c9982b4..f89b340 100644 --- a/devkit/samples/skipped/skipped.feature +++ b/devkit/samples/skipped/skipped.feature @@ -1,10 +1,10 @@ Feature: Skipping scenarios Hooks and step definitions are able to signal at runtime that the scenario should - be skipped by returning or throwing a particular value. + be skipped by raising a particular kind of exception status (For example PENDING or SKIPPED). - This can be useful when e.g. the current environment doesn't have the right conditions - for running the scenario. + This can be useful in certain situations e.g. the current environment doesn't have + the right conditions for running a particular scenario. @skip Scenario: Skipping from a Before hook From 072d06abc01905aaa6e2a78fea835fad394919fb Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 10 Oct 2023 15:26:08 +0100 Subject: [PATCH 2/3] Reconcile all steps --- devkit/samples/skipped/skipped.feature | 10 +++++----- devkit/samples/skipped/skipped.feature.ts | 6 +++--- ruby/features/skipped/skipped.feature.rb | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/devkit/samples/skipped/skipped.feature b/devkit/samples/skipped/skipped.feature index f89b340..c8efe7a 100644 --- a/devkit/samples/skipped/skipped.feature +++ b/devkit/samples/skipped/skipped.feature @@ -8,12 +8,12 @@ Feature: Skipping scenarios @skip Scenario: Skipping from a Before hook - Given a step that we expect to be skipped + Given a step that is skipped Scenario: Skipping from a step doesn't affect the previous steps - Given an implemented step - When a step that skips + Given a step that does not skip + And I skip a step Scenario: Skipping from a step causes the rest of the scenario to be skipped - Given a step that skips - When a step that we expect to be skipped + Given I skip a step + And a step that is skipped diff --git a/devkit/samples/skipped/skipped.feature.ts b/devkit/samples/skipped/skipped.feature.ts index 9d0bd59..4c6d44e 100644 --- a/devkit/samples/skipped/skipped.feature.ts +++ b/devkit/samples/skipped/skipped.feature.ts @@ -4,14 +4,14 @@ Before('@skip', function () { return 'skipped' }) -Given('an implemented step', function () { +Given('a step that does not skip', function () { // no-op }) -Given('a step that we expect to be skipped', function () { +Given('a step that is skipped', function () { // no-op }) -Given('a step that skips', function () { +Given('I skip a step', function () { return 'skipped' }) diff --git a/ruby/features/skipped/skipped.feature.rb b/ruby/features/skipped/skipped.feature.rb index cfc19bd..cecd23d 100644 --- a/ruby/features/skipped/skipped.feature.rb +++ b/ruby/features/skipped/skipped.feature.rb @@ -4,14 +4,14 @@ 'skipped' end -Given('an implemented step') do +Given('a step that does not skip') do # no-op end -Given('a step that we expect to be skipped') do +Given('a step that is skipped') do # no-op end -Given('a step that skips') do +Given('I skip a step') do 'skipped' end From 47b7f4541db36553c2839b0775898d583c0fedae Mon Sep 17 00:00:00 2001 From: Luke Hill Date: Tue, 10 Oct 2023 15:27:10 +0100 Subject: [PATCH 3/3] Actually throw the specific exception for skipping a scenario --- ruby/features/skipped/skipped.feature.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby/features/skipped/skipped.feature.rb b/ruby/features/skipped/skipped.feature.rb index cecd23d..8f0bcac 100644 --- a/ruby/features/skipped/skipped.feature.rb +++ b/ruby/features/skipped/skipped.feature.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true Before('@skip') do - 'skipped' + skip_this_scenario('') end Given('a step that does not skip') do @@ -13,5 +13,5 @@ end Given('I skip a step') do - 'skipped' + skip_this_scenario('') end