Code Monkey home page Code Monkey logo

cucumber-jvm-scala's Introduction

Cucumber Scala

Maven Central Build Status

Cucumber Scala is the Scala implementation of Cucumber.

Help & Support

See: https://cucumber.io/support

Compatibility matrix

Cucumber Scala has a different release cycle than other Cucumber projects that you might use (like cucumber-junit).

As a rule of thumb, you can assume that latest version of Cucumber Scala targets the latest version of Cucumber Core projects.

The table below shows the compatible versions:

Cucumber Scala version Cucumber Core version Scala versions
8.18+ 7.x 2.12, 2.13, 3.3+
8.13-8.17 7.x 2.12, 2.13, 3.2+
8.0-8.12 7.x 2.12, 2.13, 3.0+
7.x 6.x 2.11, 2.12, 2.13, 3.0+
6.x 6.x 2.11, 2.12, 2.13
5.x 5.x 2.11, 2.12, 2.13
4.x 4.x 2.11, 2.12, 2.13

Getting started

Contributing

See here for internal documentation and information about contributing.

Backers & Sponsors

Support us with a monthly donation and help us continue our activities. Become a backer or a sponsor!

They are using it

You are using Cucumber Scala? We would love to know about you! Please open a PR to add your project or company to the list below.

KelkooGroup Teads theGardener
Lectra Kapoeira

cucumber-jvm-scala's People

Contributors

aslakhellesoy avatar brasmusson avatar chriswhelan avatar cukebot avatar dfurmans avatar dkowis avatar dwskoog avatar gaeljw avatar glibas avatar jakzal avatar jonas avatar kopa avatar lewismj avatar manuelbernhardt avatar mattwynne avatar mlvandijk avatar mpkorstanje avatar mrebiai avatar nhajratw avatar nightscape avatar nilswloka avatar notmattlucas avatar oc avatar pawel-s avatar poetix avatar renovate-bot avatar renovate[bot] avatar skipoleschris avatar teigen avatar tychobrailleur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber-jvm-scala's Issues

Provide a way to have Options in DataTableType

Is your feature request related to a problem? Please describe.

When definiting a DataTableType we might have to handle null values (empty values from the Gherkin table).

It should be possible to say that you want Options instead and let the lib deal with the nulls.

Describe the solution you'd like

Instead of doing something like that:

DataTableType { map: Map[String, String] =>
  val val1 = Option(map("key1")) // <- Option to wrap the null
}

It should be possible to define the transformer like this:

DataTableType { map: Map[String, Option[String]] =>
  val val1 = map("key1") // No need to wrap!
}

Additional context

Obviously the current transformers should be kept for compatibility and users who know they don't have null values.

State management for cucumber-scala + cucumber-piococcontainer

Describe the bug
State management required for cucumber-Scala. like how cucumber-java+ cucumber-picocontainer handling state management

To Reproduce
This world class in the state need within scenario to record the state after each step and global background setup
class world{
var globalFlag: String = _
var scenarioFlag : String = _
var result : String = _
}

below is the stepDefinition class contains all glue code and step definition

class stepDefinition(implicit world : World) extends scalaDsl with En{
Given("do this"){
(input : String) => { world.scenarioFlag = input }
}
}
getting exception trying to inject world instance to step definition. where its works fine in cucumber-java and cucumber-piococontainer

Expected behavior
should get world instance available in the step definition class

Versions:

  • Cucumber Scala: [6.9.1]
  • Scala: [2.12]

@Transform does not work in Scala DSL

From cucumber/cucumber-jvm#922

@Transform in Scala DSL does not work and I have to define my own class using XStreamConverter to make it work.

class MyClassConverter extends Transformer[MyClass] {
 //implementation of Transform function
}

def given(@Transform(classOf[MyClassConverter]) c: MyClass) {
    //Some Code
}

Given("""^I have my (.*) as part of my given $""".stripMargin) { given _ }

This does not pick MyClassConverter as a converter for MyClass

GPG updates

I'm not sure if the gpg.sh script is used anymore after #269 was merged.

If it isn't - maybe delete it?
If it is used, please beware that I've renamed GPG_SIGNING_KEY_PASSPHRASE to GPG_PASSPHRASE in the secrets repo on keybase.

Provide a cucumber-scalatest integration

Describe the solution you'd like
A integration library "cucumber-scalatest" that would remove the need for "cucumber-junit" and runs the Cucumber scenarios as Scalatest instances.

Step definition erroring when regex contains an optional capture group

From cucumber/cucumber-jvm#948

I have a step definition as

Given( """^I am logged in(?: as (.+))?$""") { (user: String) =>
   // do something
}

And my feature file step is

Given I am logged in

Then I am getting an error


scala.MatchError: List(null) (of class scala.collection.immutable.$colon$colon)
at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:253)
  at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:251)
  at cucumber.api.scala.ScalaDsl$StepBody$$anonfun$apply$2.applyOrElse(ScalaDsl.scala:95)
  at cucumber.api.scala.ScalaDsl$StepBody$$anonfun$apply$2.applyOrElse(ScalaDsl.scala:95)
  at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)
  at cucumber.runtime.scala.ScalaStepDefinition.execute(ScalaStepDefinition.scala:71)
  at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
  at cucumber.runtime.Runtime.runStep(Runtime.java:298)
  at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
  at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
  at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:48)
  at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:154)
  at cucumber.runtime.Runtime.run(Runtime.java:120)
  at cucumber.runtime.Runtime.run(Runtime.java:108)
  at cucumber.api.cli.Main.run(Main.java:36)
  at cucumber.api.cli.Main.main(Main.java:18)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
  at ✽.Given I am logged in(/Users/anshulbajpai/projects/payments-frontend/features/spike.feature:319)

Ideally, I'd expect the control to go into the step definition with null value for user parameter.

Provide out-of-the-box support for mapping Datatables to Scala case classes

I believe the Cucumber Scala should provide an easy way to map Datatables to case classes.

case class MyCaseClass(a: Int, b: String)

Given("expression") { (data:Datatable) =>
   val myData = data.asLists(classOf[MyCaseClass])
}

I'm not sure if this should be part of Cucumber Scala by default (if it's possible) or this has to be an optional feature that users can enable by inheriting a trait for instance. I guess it depends on how it's implemented πŸ€”

This was possible in with version 2.x and as far as I know, for now, it has to be implemented with custom transformers and/or type registry.

Example of implementation in Cucumber Scala 4.7:

trait TypeRegistry extends TypeRegistryConfigurer {

  override def locale(): Locale = Locale.ENGLISH

  override def configureTypeRegistry(typeRegistry: api.TypeRegistry): Unit = {
    val transformer = new DefaultTransformer()
    typeRegistry.setDefaultDataTableEntryTransformer(transformer)
    typeRegistry.setDefaultDataTableCellTransformer(transformer)
    typeRegistry.setDefaultParameterTransformer(transformer)
  }

}

class DefaultTransformer
  extends ParameterByTypeTransformer
    with TableEntryByTypeTransformer
    with TableCellByTypeTransformer {

  var objectMapper: ObjectMapper = new ObjectMapper()
  objectMapper.registerModule(DefaultScalaModule)

  override def transform(s: String, `type`: Type): AnyRef = {
    objectMapper.convertValue(s, objectMapper.constructType(`type`))
  }

  override def transform[T](entry: JMap[String, String], `type`: Class[T], cellTransformer: TableCellByTypeTransformer): T = {
    objectMapper.convertValue(entry, objectMapper.constructType(`type`))
  }

  override def transform[T](value: String, cellType: Class[T]): T = {
    objectMapper.convertValue(value, objectMapper.constructType(cellType))
  }

}

Provide conversion methods from DataTable to scala types

Related to #50

I would like to have convenience methods for converting a DataTable to Scala types:

Given("My expression") { (table: DataTable) =>
  table.asScalaMaps
  // Instead of something like:
  table.asMaps().asScala.map(_.asScala)
}

Also considering that DataTable can contain null values but null is not expected in Scala, we should probably filter out the null values.

Automate releases

What's the problem you've observed? πŸ€”

Releases are not automated, this means we have to run the build scripts on maintainers' local machines, and also means that credentials for releases have to be copied onto those machines.

Do you have a proposal for making it better? πŸ¦„

Implement a GitHub action, based on a protected release/vX.Y.Z branch as we have done in other repos (see cucumber/common#1688)

Support Scala collection types in datatable step definitions

Describe the solution you'd like
I would like to be be able to write such steps definitions:

Given("the following authors as entries") { (authors: Seq[Author]) =>
  // Some code
}

Rather than having to use Java types:

Given("the following authors as entries") { (authors: java.util.List[Author]) =>
  // Some code
}

Same goes for List[List[]] or List[Map[]].

Describe alternatives you've considered
Depending on the faisability, an alternative would be to provide in Cucumer Scala, some implicit methods to convert from DataTable to Scala types. And promote this usage in the documentation.

Additional note
This must not be a breaking change, if people rely on Java Types, their code should obvisouly still continue to work.

Support hooks without parameter

If possible we should support hooks without parameters.

For instance instead of writing that:

Before { _ =>
  // Some code
}

We should be able to write this:

Before {
  // Some code
}

cucumber-scala instantiates step definition classes per test JVM instead of per scenario

From: cucumber/cucumber-jvm#755

From https://groups.google.com/forum/#!topic/cukes/eOhisAzEvQo, written by @tristanmccarthy:

"The problem I am hitting is that step def classes appear to be instantiated only once, at the start of the test run. Based on reading around (and previous experience with Java) I'd expect the glue code classes to be instantiated once per scenario instead, and the way I am trying to set everything up requires this."

"...I've stuck a quick and dirty example up on github for some context:
https://github.com/tristanmccarthy/cucumber-scala-webtest"

Cucumber 6.2.2 not listing all the failed scenarios at the end of tests run

Describe the bug
When one or more scenarios failed, we don't get a list of failed scenarios:
like

Failed scenarios:
classpath:features/myfile.feature:12# <my_scenario_description 1>
classpath:features/myfile.feature:15# <my_scenario_description 2>

To Reproduce
Run feature file with a failing test.

Expected behavior
Failed scenarios should be listed in the end, as it helps developers to identify quickly especially when there is a huge number of tests.
** cucumber Version being used**

"io.cucumber" % "cucumber-core" % "6.2.2"
"io.cucumber" % "cucumber-junit" % "6.2.2"
"io.cucumber" %% "cucumber-scala" % "6.2.2"

The same thing was working when the cucumber version was 5.7.0.

I am not sure if this change was introduced on purpose in version 6 or above. Please suggest if this can be achieved by any configuration change (such as CucumberOptions).

Thanks in advance.

Target Scala 2.13 and provide backward compatibiliy code

The Scala source code used for the three Scala versions (2.11, 2.12, 2.13) is the same.

While this works fine, this brings some warnings in the Scala 2.13 build as well as boilerplate code.

We should consider targeting Scala 2.13 as the main Scala version and provide some backward compatibility code for earlier versions.

The first step will be to identify the extent of this change.

Optionally but it would preferable to avoid it, we could also have 3 whole different codebase but it would be a pain to maintain.

Use a code formatter

We should consider using a code formatter at some point.

Scalafmt looks like a good choice but open to any suggestion.

Obvisouly, as long as number of contributors is quite low, this is not a priority.

Use mdoc to provide safe documentation

πŸ€” What's the problem you've observed?

It's important to give accurate documentation to our users and sometimes documentation is not updated, leading to pieces of code copy/pasted by users from the documentation that don't work.

✨ Do you have a proposal for making it better?

Use mdoc which is quite standard in Scala ecosystem.

πŸ“š Any additional context?

N/A

Alternatives to JacksonDefaultDataTableEntryTransformer

Is your feature request related to a problem? Please describe.
Jackson Scala module has some flaws and using it with the JacksonDefaultDataTableEntryTransformer to automatically map datatables does not always work.

For instance issues with Options: FasterXML/jackson-module-scala#459

Describe the solution you'd like
It could be nice to propose other alternatives to Jackson, more Scala friendly.

A first alternative with support for basic case classes would be enough for a start IMHO.

This means we "just" need to build a case class instance given a Map[String, String] of values and a Java Type reference.

Describe alternatives you've considered
N/A

Additional context
N/A

Hooks can silently be ignored if body returns an Int

Describe the bug
The following hook definition:

Before {
  someMethodThatReturnInt()
}

will NOT define a hook because it will be interpreted as Before(someMethodThatReturnInt()) and a missing body.

This it not exactly a bug but this can be quite confusing for users.

To Reproduce

object MySteps extends ScalaDsl with EN {
  Before {
    println("Before hook")
    1 // Silly but for the reproduction purpose
  }
}

Create a feature file with 2 scenarios and a dumb step definition. Check that the before hook is printed only once.

Expected behavior
I would expect that a warning/error is raised at compile time, or that the body is actually interpreted as the hook body rather than something providing the order of the hook.

Depending on how we can fix that, we will consider other options.

Versions:

  • Cucumber Scala: 5.7.0
  • Scala: 2.12

Additional context

  • To be more confusing, I think it will work as a side effect when hooks are defined in class but not in objects because glue classes are reinstantiated at each scenario while glue objects are not.

  • Other definitions (like ParameterType) should be checked as well..

Set up CI

At the moment we can’t tell whether the build is passing ir failing, which makes it impossible to merge othet PRs.

UndefinedDataTableTypeException with Boolean

πŸ‘“ What did you see?

From comment from @ckorakidis at #50 (comment)

Can't use DataTable: io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to Map<java.lang.String, boolean>
I use it like: dataTable.asScalaMap[String, Boolean] in StepDefinitions which extends EN and have imported io.cucumber.scala.Implicits._

βœ… What did you expect to see?

Cucumber should be able to convert to a map with Boolean (Scala or Java) values.

πŸ“¦ Which tool/library version are you using?

Cucumber Scala 8.9.0
Cucumber core 7.7.0

πŸ”¬ How could we reproduce it?

With Scala Booleans

Scenario: As Map of boolean
    Given the following table as Scala Map with boolean
      | row1 | true  |
      | row2 |       |
      | row3 | false |
  Given("the following table as Scala Map with boolean") { (table: DataTable) =>
    val data: Map[String, Option[Boolean]] =
      table.asScalaMap[String, Boolean]
    val expected = Map(
      "row1" -> Some(true),
      "row2" -> None,
      "row3" -> Some(false)
    )
    assert(data == expected)
  }

The error:

io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to Map<java.lang.String, boolean>.
[error] Please review these problems:
[error] 
[error]  - There was no table entry transformer registered for boolean.
[error]    Please consider registering a table entry transformer.
[error] 
[error]  - There was no table cell transformer registered for boolean.
[error]    Please consider registering a table cell transformer.
[error] 
[error]  - There was no default table cell transformer registered to transform boolean.
[error]    Please consider registering a default table cell transformer.
[error] 

With Java Boolean

Replacing Boolean with java.lang.Boolean does not help, the same error is still present:

io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to Map<java.lang.String, java.lang.Boolean>.
[error] Please review these problems:
[error] 
[error]  - There was no table entry transformer registered for java.lang.Boolean.
[error]    Please consider registering a table entry transformer.
[error] 
[error]  - There was no table cell transformer registered for java.lang.Boolean.
[error]    Please consider registering a table cell transformer.
[error] 
[error]  - There was no default table cell transformer registered to transform java.lang.Boolean.
[error]    Please consider registering a default table cell transformer.
[error] 

πŸ“š Any additional context?

N/A

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Scala steps should use dependency injection, like Java

From cucumber/cucumber-jvm#1075

Summary

I have found that the Scala step classes are required to have a no-args constructor, but I'd like to be able to have my glue classes depend on one another like the Java glue can.

From the Java docs:

we strongly recommend you include one of the Dependency Injection modules as well. This allows you to share state between Step Definitions without resorting to static variables (a common source of flickering scenarios).

The relevant code is here:

val dslClasses = packages flatMap { classFinder.getDescendants(classOf[ScalaDsl], _) } filter { cls =>
  try {
    cls.getDeclaredConstructor()
    true
  } catch {
    case e : Throwable => false
  }
}

This filter will silently ignore any Step classes which do not have a no-args constructor.

See also #755 for another difference between Scala and Java here.

Expected Behavior

  1. I'd expect to be able to add a Glue class as a constructor param to a Step class, and have the DI framework create and inject an instance, like the Java API allows:
class MySteps(connector: MyConnector) {
    Given("""^some setup$"""){ () =>
      connector.something()
    }
}
  1. Also, I think that the filter above ought to print a warning when a Glue class that inherits from ScalaDsl is rejected for having the wrong constructor, as it took me a while to figure out what was going on here.

Current Behavior

  1. Any ScalaDsl classes with constructors like that shown above are not loaded into the backend
  2. No warning is currently given.

Possible Solution

I should think that most of the JavaBackend.loadGlue code could be used directly by the ScalaBackend, instead of its own less fully-featured version (some allowances are currently made in the ScalaBackend for "MODULE$" fields, but I don't immediately see why that's necessary).

Steps to Reproduce (for bugs)

Hopefully the above is clear enough; please let me know if not.

Context & Motivation

I'm starting a new Scala proejct and I'd like to use cucumber-jvm. I have experience using cucumber-jvm on Java projects and Scala experience.

Your Environment

n/a

Provide a method on Datatable to map to list of custom type

Is your feature request related to a problem? Please describe.

Since version 6.x, we can benefit of extension methods to the Datatable class to map them to Scala collection types easily. But it assumes that we are converting only to basic types and always wrap the values in an Option.

This is not necessary for custom types registered with a DataTableType as we can assume that a scala DataTableType never returns null.

Describe the solution you'd like

We should be able to do map a Datatable to a list of custom types not wrapped in Option.

DataTableType { map: Map[String,String] =>
  // map to CustomType
}

Given("the following table as Scala List of custom type") { (table: DataTable) =>
  // We want this:
  val data: Seq[CustomType] = table.asScalaRawList[CustomType]
  // Instead of:
  val data: Seq[Option[CustomType]] = table.asScalaList[CustomType]
  // ...
}

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

This repository currently has no open or pending branches.


  • Check this box to trigger a request for Renovate to run again on this repository

Step containing regex capture group not found

πŸ‘“ What did you see?

step: And a message is sent with a mobile
glue: Then("a message is sent (with|without) a mobile") { withOrWithout: String =>
error message: io.cucumber.junit.UndefinedStepException: The step 'a message is sent with a mobile' is undefined.

βœ… What did you expect to see?

Step should be picked and "with" or "without" should be the captured value

πŸ“¦ Which tool/library version are you using?

Cucumber Scala 8.9.0
Cucumber core 7.7.0

πŸ”¬ How could we reproduce it?

Scenario: Regex capture
    Given wte
    And a message is sent with a mobile

and

Then("a message is sent (with|without) a mobile") { withOrWithout: String =>
  assert(withOrWithout == "with"
}

the error:

2022-09-12 09:56:22.644  [error] Test SomeFeature - SomeFeature failed: io.cucumber.junit.UndefinedStepException: The step 'a message is sent with a mobile' is undefined.
2022-09-12 09:56:22.644  [error] You can implement this step using the snippet(s) below:
2022-09-12 09:56:22.644  [error] 
2022-09-12 09:56:22.644  [error] Then("""a message is sent with a mobile""") { () =>
2022-09-12 09:56:22.644  [error]   // Write code here that turns the phrase above into concrete actions
2022-09-12 09:56:22.644  [error]   throw new io.cucumber.scala.PendingException()
2022-09-12 09:56:22.644  [error] }
2022-09-12 09:56:22.644  [error] , took 8.307 sec

Support adding parameterType, dataTableType.. via ScalaDsl

The Scala DSL does not support adding types or transformers easily.

We should be able to do something like the Java8 implementation:

DataTableType("[blank]", (Map<String, String> entry) -> {
            Person person = new Person();
            person.first = entry.get("first");
            person.last = entry.get("last");
            return person;
        });

ParameterType("optional", "[a-z]*", args -> Optional.of(args));

For instance:

class MySteps extends ScalaDsl with EN {
   
   DataTableType("[blank]", entry => Person(entry("first"), entry("last")))

   ParameterType("optional", "[a-z]*", args => Option(args))

}

New maintainers wanted!

We haven't had the time, or expertise to keep to the Scala implementation up to date. So we're looking for one or more new maintainers. The tasks are roughly:

  • Code! Scratch your own itch
  • Keep dependencies uptodate
  • Respond to GitHub issues/PRs in a timely manner
  • Keep the CHANGELOG uptodate
  • Make releases (Create git tags, update CHANGELOG)
  • Keep the documentation uptodate
  • Make the code habitable for new users and contributors
  • Keep the CI running

If you are interested - comment on this issue!

Cucumber Scala final output shows 0 failures even when a scenario fails

I have a cucumber test suite which has some tests

I run the tests using command

sbt "testOnly <cucumber_class_name>"

And one of the cucumber tests fail an assertion and console shows

Failed scenarios:
classpath:features/my_cucumber_scenario.feature:31# <my test description>

19 Scenarios (1 failed, 18 passed)
88 Steps (1 failed, 87 passed)sts 214s
3m18.224s

But in the end the console shows

Total 80, Failed 0, Errors 0, Passed 80

Since one of the tests failed, in the final output it should have shown
Failed 1 (Or something like that). But it is showing all passed instead due to which my build on travis is not failing.

How to solve this problem ? Is there a solution in cucumber ?

My dependencies are

"io.cucumber" % "cucumber-core" % "5.7.0",
"io.cucumber" % "cucumber-junit" % "5.7.0"
"io.cucumber" %% "cucumber-scala" % "5.7.0"

Add javadoc on ScalaDSL methods

Even though the method and parameter names are quite explicit, we should add documentation in the Scala DSL so that users can be sure of what are the purpose of parameters.

Be ready for Scala 3

Scala 3.x is on its way (http://dotty.epfl.ch/blog/2020/09/21/naming-schema-change.html).

Even though users of Scala 3.x projects should be able to use Cucumber Scala compiled with Scala 2.x, it would be nice if Cucumber Scala was cross compiled to Scala 3.x as well.

That being said, there is for now no support of Scala 3 with the Scala Maven plugin (davidB/scala-maven-plugin#393), thus if we want to move forward we have two options:

  • contribute to the Scala Maven plugin
  • move away from Maven and use sbt instead

I would tend to vote for the 2nd option, as AFAIK the majority of Scala libraries are built with sbt which offers way more convenience especially from cross-builiding projects to multiple versions of Scala. It could also help Scala developers contribute more easily with a known project structure instead of the "home-made" Maven structure we have for now.

❓ But as of today we rely on Maven also for releasing the project and I don't know if we want to keep it like this or not.

πŸ’‘ An intermediate step could be to still use Maven for the top level commands (build, release...) but delegate to sbt the actual build. This is something I've seen working quite well using the Exec Maven plugin.

Any thought on the topic appreciated! @mpkorstanje maybe πŸ˜‰

Compile with latest Scala 3 version

πŸ€” What's the problem you're trying to solve?

As Scala 3.1.2 brings forward compatibility feature, it would be nice to compile the project with latest Scala 3 version (3.1.2 as of now) and target an output version of 3.0.2 so that users not yet on 3.1.x can still use the lib.

✨ What's your proposed solution?

N/A

⛏ Have you considered any alternatives or workarounds?

N/A

πŸ“š Any additional context?

This requires sbt 1.7+ (currently 1.7.0-M2 supports it, so we could start the work in a branch and wait for stable 1.7 or even consider releasing with 1.7.0-M2 if no issue raised during tests).

Errors not reported with duplicated scenarios names

Context

I believe the issue might not be related to cucumber-jvm-scala because I only reproduce it when using sbt as build tool rather than maven but I feel it's better to enter an issue here in case someone have the issue in the future.
We'll link to another issue in another project if the fix is not part of this project.

Issue

Given we have two scenarios with the same name (Scenario: a scenario name) in the same file
When I run sbt test
And one of them is failing but not the other
Then the result is "SUCCESS" instead of "ERROR"

image

It seems that only the result of the first test is considered, thus depending on order of tests the result is different.

Reproduction

Clone https://github.com/gaeljw/cucumber-jvm-scala-issue-duplicate-scenarios/tree/master and run sbt test

What about Maven?

As mentionned, I cannot reproduce with the same project (Scala) using Maven (https://github.com/gaeljw/cucumber-jvm-scala-issue-duplicate-scenarios/tree/maven)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.