Mark a scenario in cucumber as pending

If you're writing lots of cucumber scenarios, sometimes you need to mark one pending so that you can focus on other things. If you're refactoring, for instance, you don't need ten failing tests when one will do. So, there are a couple ways that we use to do pending cucumber scenarios:

Write a non-defined step

By default, a non-defined step will stop the execution of the scenario.
          Scenario: login with valid credentials
            Given this is pending
This will show the scenario along with a note about defining the step.

Create a pending step

In one of your step definition files, add a step:
          Given /^PENDING/ do
Then you can use it like:
          Scenario: login with valid credentials
            Given PENDING I have valid credentials

Use the @wip tag

There's also the @wip tag, which focuses you down to a specific test. Use it with rake cucumber:wip.

Established 2005 · Databasically © 2016