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 8981803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:25:34+00:00 2026-06-15T20:25:34+00:00

Here is a tricky one regarding Cucumber: Feature: Some feature Background: Given I am

  • 0

Here is a tricky one regarding Cucumber:

Feature: Some feature

Background:
    Given I am on the root page

Scenario Outline: Relevant flash messages should appear
    When I fill in some_field with: <name>
    Then I should see the text: <relevant_flash>

    Examples:
        | name          | relevant_flash    |
        | Some name     | Some message      |

Scenario Outline: Irrelevant flash messages should not appear
    When I fill in some_field with: <name>
    Then I should not see the text: <irrelevant_flash>

    Examples:
        | name          | irrelevant_flash  |
        | Some name     | Some message      |

I hate having to repeat:

 When I fill in some_field with: <name>

But for obvious reasons it can not just be moved into background. Or can it? Let me know if you have a workaround…

  • 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-06-15T20:25:35+00:00Added an answer on June 15, 2026 at 8:25 pm

    Well, I can simplify your cucumber with something like this:

    Feature: Some feature
    
     Scenario Outline: Relevant flash messages should appear
        Given I am on the root page
        When I fill in some_field with: <name>
        Then I should see <message>
      Examples:
            |        name           |        message        |
            | Some name             | Relevant message      |
            | Some other name       | Irrelevant message    |
            | Some another name     | another flash message |
    

    You notice that I take out the Background: since we got it cover on Scenario Outline:
    I think this steps will run and simple with out too much repeatation

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

Sidebar

Related Questions

A tricky one here. I have styling for two UL's on a page which
A bit of a tricky one, at least for me. Here is the scenario:
Here's a tricky one - how do I programatically create and interrogate a database
here's a tricky one. I have the following XML <test> <testElement SomeAttribute=<otherxml><otherElement>test test</otherElement></otherxml>> </testElement>
Ok, got a tricky one here... If my data looks like this: Table1 ID
Here's a tricky one. I have data as follows: User ID Name Skill Sets
Here's a tricky one... I noticed in a query for my code that when
got a tricky one here me thinks! I want to understand how if this
I'm facing kind of a tricky challenge here, maybe one of you could help
This is a tricky one, for me at least. I have a page that

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.