Skip to content

[JUnit] Add JUnit Platform @Cucumber annotation #1824

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 1 commit into from
Nov 22, 2019

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Nov 22, 2019

Maven Surefire and Gradle do not yet support discovery of non-class
based tests[1][2]. As a workaround you can either use the @Cucumber
annotation or the JUnit Platform Console Launcher.

Cucumber will scan the package of a class annotated with @Cucumber
for feature files.

package com.example.app;

import io.cucumber.junit.platform.engine.Cucumber;

@Cucumber
public class RunCucumberTest {
}
  1. JUnit 5: Allow resource-based testing gradle/gradle#4773
  2. https://issues.apache.org/jira/browse/SUREFIRE-1724

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist:

  • I've added tests for my code.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Maven Surefire and Gradle do not yet support discovery of non-class
based tests[1][2]. As a workaround you can either use the `@Cucumber`
annotation or the JUnit Platform Console Launcher.

Cucumber will scan the package of a class annotated with `@Cucumber`
for feature files.

```java
package com.example.app;

import io.cucumber.junit.platform.engine.Cucumber;

@cucumber
public class RunCucumberTest {
}
```

 1. gradle/gradle#4773
 2. https://issues.apache.org/jira/browse/SUREFIRE-1724
@mpkorstanje mpkorstanje force-pushed the junit-platform-cucumber-annotation branch from 1db98b2 to b044364 Compare November 22, 2019 11:58
@coveralls
Copy link

coveralls commented Nov 22, 2019

Coverage Status

Coverage increased (+0.3%) to 87.571% when pulling b044364 on junit-platform-cucumber-annotation into 3dae98a on master.

@mpkorstanje mpkorstanje added this to the 5.0.0 milestone Nov 22, 2019
@mpkorstanje mpkorstanje merged commit a726fcc into master Nov 22, 2019
@mpkorstanje mpkorstanje deleted the junit-platform-cucumber-annotation branch November 22, 2019 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants