Skip to content

Update to 5.x #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,44 @@ To use cucumber-jvm-scala in your project, add the following dependency to your
<scope>test</scope>
</dependency>
```

## Compatibility matrix

The Cucumber Scala version matches the Cucumber version except for the bugfix number
which can be different.

| Cucumber Scala version | Cucumber version | Scala versions |
|------------------------|------------------|------------------|
| 5.6.0 | 5.6.0 | 2.11, 2.12, 2.13 |
| 4.7.1 | 4.7.1 | 2.11, 2.12, 2.13 |

## Migrating from 4.x to 5.x

If you are using Cucumber Scala 4.7.x and want to upgrade to 5.x, please note there are some major changes in addition to the Cucumber upgrade itself.

### Packages

All Cucumber Scala classes are now under `io.cucumber.scala` package instead of `cucumber.api.scala`.

### Before/BeforeStep/After/AfterStep definitions

The `Before`, `BeforeStep`, `After` and `AfterStep` definitions have slightly changed:
- to apply only with some tags, the variable list of tags as `String*` is replaced by a single tag expression of type `String`.
- if providing both an order and a tag expression, the order is now the second parameter instead of the first.
This is more consistent with the Java implementation.

For instance, the following code:

```scala
Before(1, "@tag1", "@tag2") { _ =>
// Do Something
}
```

Is replaced by:

```scala
Before("@tag1 or @tag2", 1) { _ =>
// Do Something
}
```
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-jvm-scala</artifactId>
<version>4.7.2-SNAPSHOT</version>
<version>5.6.0-SNAPSHOT</version>
</parent>

<artifactId>scala-examples</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cucumber.examples.scalacalculator

import cucumber.api.Scenario
import cucumber.api.scala.{ScalaDsl, EN}
import io.cucumber.scala.{EN, ScalaDsl, Scenario}
import org.junit.Assert._

class RpnCalculatorStepDefinitions extends ScalaDsl with EN {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package cucumber.examples.scalacalculator

import cucumber.api.CucumberOptions
import io.cucumber.junit.{Cucumber, CucumberOptions}
import org.junit.runner.RunWith
import cucumber.api.junit.Cucumber

@RunWith(classOf[Cucumber])
@CucumberOptions()
class RunCukesTest
Loading