|
| 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 | + * @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