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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:03:08+00:00 2026-05-27T02:03:08+00:00

Is there any BDD tool for Scala supporting reusable parameterized Gherkin clauses? I would

  • 0

Is there any BDD tool for Scala supporting reusable parameterized Gherkin clauses?

I would like to be able to have the ability to use specs like these:

Given number 4 is entered
When "+" is pressed
And number -1 is entered
And "*" is pressed
And number 2 is entered
And "=" is pressed
Then result is 6

And I would like to define fixtures to Gherkin clauses differing by a parameter only once, something like:

scenario("(4+(-1)) * 2 = 6") {

  given("number 4 is entered")
  when("'+' is pressed")
  and("number -1 is entered")
  and("'*' is pressed")
  and("number 2 is entered")
  and("'=' is pressed")
  then("result is 0")
}

Given definitions of clauses looking like as follows:

"number $number is entered" {
    calculator.enter(number)
}
"'$key' is pressed" {
    calculator.press(key)
}
"result is $number" {
    assert(calculator.getDisplayedNumber === number)
}

I looked through ScalaTest and Specs manuals but I didn’t find such feature. ScalaTest seems to be able to reuse the defined clause in a different scenario, but looks like it is not parameterised.

Do you know some tools that does support what I want, or e.g. some extensions to ScalaTest, or a way to extend it myself with such result?

  • 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-27T02:03:09+00:00Added an answer on May 27, 2026 at 2:03 am

    We can find the following example in specs2 to implement Given When Then specs :
    https://github.com/etorreborre/specs2/blob/1.6/src/test/scala/org/specs2/examples/GivenWhenThenSpec.scala

    Hope this will help.

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

Sidebar

Related Questions

I love the Ruby RSpec BDD development style. Are there any good tools for
I am interested in Behavior Driven Development (BDD) Are there any good frameworks and/or
there any way to define enum in c# like below? public enum MyEnum :
Is there any alternative to SELECT DISTINCT item FROM DB I have already tried:
I would like to describe tests in BDD style e.g. with FlatSpec but keep
Is there any effective way to generate JSON out of MYSQL query like this?
Is there any way to check whether a file is locked without using a
Is there any free or commercial component written in .NET (no COM interop) that
Is there any query which can return me the number of revisions made to
Is there any efficiency difference in an explicit vs implicit inner join? For example:

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.