Skip to content

Commit c371913

Browse files
Copilotgaeljw
andcommitted
Implement working CucumberSuite trait for Scalatest integration
Co-authored-by: gaeljw <[email protected]>
1 parent 29adc48 commit c371913

File tree

11 files changed

+138
-303
lines changed

11 files changed

+138
-303
lines changed

build.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ lazy val integrationTestsScalatest =
237237
.settings(
238238
name := "integration-tests-scalatest",
239239
libraryDependencies ++= Seq(
240-
"org.scalatest" %% "scalatest" % scalatestVersion % Test
240+
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
241+
"org.junit.jupiter" % "junit-jupiter" % junitBom.key.value % Test
241242
),
242243
publishArtifact := false
243244
)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package io.cucumber.scalatest;
2+
3+
import java.lang.annotation.ElementType;
4+
import java.lang.annotation.Retention;
5+
import java.lang.annotation.RetentionPolicy;
6+
import java.lang.annotation.Target;
7+
8+
/**
9+
* Configuration annotation for Cucumber tests in ScalaTest.
10+
*
11+
* Use this annotation to configure Cucumber options for your test suite.
12+
*
13+
* Example:
14+
* <pre>
15+
* &#64;CucumberOptions(
16+
* glue = {"com.example.stepdefinitions"},
17+
* features = {"classpath:features"},
18+
* plugin = {"pretty"}
19+
* )
20+
* class RunCucumberTest extends CucumberSuite
21+
* </pre>
22+
*/
23+
@Retention(RetentionPolicy.RUNTIME)
24+
@Target({ElementType.TYPE})
25+
public @interface CucumberOptions {
26+
27+
/**
28+
* @return the package(s) containing the glue code (step definitions and hooks).
29+
*/
30+
String[] glue() default {};
31+
32+
/**
33+
* @return the paths to the feature file(s) or directory(ies) on the classpath.
34+
*/
35+
String[] features() default {};
36+
37+
/**
38+
* @return output plugins to use
39+
*/
40+
String[] plugin() default {};
41+
42+
/**
43+
* @return only run scenarios tagged with tags matching this expression
44+
*/
45+
String tags() default "";
46+
47+
/**
48+
* @return true if glue code should be executed in dry run mode
49+
*/
50+
boolean dryRun() default false;
51+
52+
/**
53+
* @return true if output should not use ANSI color escape codes
54+
*/
55+
boolean monochrome() default false;
56+
57+
/**
58+
* @return only run scenarios matching this name
59+
*/
60+
String[] name() default {};
61+
62+
/**
63+
* @return snippets should use this snippet type
64+
*/
65+
String snippets() default "UNDERSCORE";
66+
67+
/**
68+
* @return the object factory class
69+
*/
70+
Class<?> objectFactory() default Object.class;
71+
72+
/**
73+
* @return true if results should be published
74+
*/
75+
boolean publish() default false;
76+
}

0 commit comments

Comments
 (0)