0

I use Serenity framework in my project for selenium integration testing. I use Screenplay pattern.

I have two features in one folder and each feature contains two scenarios. I would like to ignore whole feature, but when I add @Ignore annotation on feature level both features are ignored. When I add @Ignore to each scenario runner ignores some steps, but runs step with RestTemplate get request and fail because of skipped previous step.

How can I force serenity do not run all scenarios in feature but show it in reports?

Istiaque Hossain
  • 2,157
  • 1
  • 17
  • 28

1 Answers1

0

1) Ignored tests are marked as suspended and runs but with mocked web driver usage. I had to add StepEventBus.getEventBus().currentTestIsSuspended() check before my REST requests.

2) @Ignored annotation works unexpected for me. I've added @Unimplemented annotation and process it in defifnitions before hook.

@Before
public void setTheStage(final Scenario scenario) {
    final StepEventBus eventBus = StepEventBus.getEventBus();
    if (scenario.getSourceTagNames().contains("@Unimplemented") && !eventBus.currentTestIsSuspended()) {
        eventBus.suspendTest(TestResult.IGNORED);
    }