Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3595512
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:51:44+00:00 2026-05-18T19:51:44+00:00

I have around 30 scenarios that all bar one require this step to be

  • 0

I have around 30 scenarios that all bar one require this step to be at the top of the Background:

Given I have an account:
  | name     | path     |
  | ticketee | ticketee |

For the one that doesn’t require this step it is not important that it exists or doesn’t exist, because it’s the feature for creating accounts. I can simply use a different account name and path for this.

Now, I was thinking rather than putting this in every single feature file 29 times that I could make use of the Before method in Cucumber which would mean placing a file in features/support/create_account.rb which would have this code:

Before do
  steps(%Q{
    Given I have an account:
      | name     | path     |
      | ticketee | ticketee |
  })
end

The only downside from this is that it extracts what some would think belongs in the feature to a very difficult-to-track-down location and is probably not standard. But on the other hand, it saves quite a lot of repetition.

What should I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T19:51:44+00:00Added an answer on May 18, 2026 at 7:51 pm

    I’d use a tagged hook such as @with_ticketee_account. It still brings a bit of repetition, but it makes the background of the scenario more obvious than having it completely hidden.

    If you wanted to make it so you only have to tag the one odd scenario, maybe create a tagged hook such as @without_ticketee_account which sets a variable which your generic before filter could check for before creating the ticketee account.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have around 100 models, from MCMCglmm, that give output similar to this: >
I have a scenario that I haven't been able to solve: I'm toying around
I have around 100 PNGs (that I created) that I want to create an
I have around 400 GB Live mysql Databases on one server and I like
I have around 100 rows of text that I want to tokenize, which are
I have around 4000 entities that I need to insert into a Java App
So here's the scenario...I have an XSD file describing all the objects that I
The scenario is that i have a bulky database of around 500,000 records having
I´m still learning my way around MVC programming and have one question for you
I have some written a number of unit tests that test a wrapper around

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.