4

I have a particular scenario which is not ready for testing yet. So I need to skip it in order to run the tests on other scenarios.

Scenario: Login-success Scenario:

Meta:
@skip
@ignored true

//Regular Steps
TheCodingFrog
  • 3,406
  • 3
  • 21
  • 27
WarLoCk
  • 53
  • 1
  • 4
  • Why would you need to skip it? Just let it go red until you fix it. Why would it interfere with your other tests? Can you please elaborate or show us an example? – Mo H. Jan 13 '16 at 20:44
  • yes it does.. some steps repeat right? Example : User Enters Username and Password. I cannot have different implementations for each scenario. – WarLoCk Jan 13 '16 at 21:17
  • It wont pass if its red. By pass i mean. it wont go to the next scenario – WarLoCk Jan 13 '16 at 21:18

2 Answers2

4

In order to use @skip or @ignore true meta in a story to skip this story,
you need to configure a meta filter in configuration of your test.

Depending on how you configure your test, it could be for example:

@RunWith(AnnotatedEmbedderRunner.class)
@UsingEmbedder(metaFilters = {"-skip"})
public class AnnotatedTraderEmbedder extends InjectableEmbedder {
} 

or, in Java:

public MyStories() {
    configuredEmbedder().embedderControls().doGenerateViewAfterStories(true)
        .doIgnoreFailureInStories(true)
        .doIgnoreFailureInView(true).useThreads(1); 
    // Meta filters:
    configuredEmbedder().useMetaFilters(Arrays.asList("-skip"));
}

See the documentation for details: http://jbehave.org/reference/stable/meta-filtering.html

krokodilko
  • 35,300
  • 7
  • 55
  • 79
  • Looks cool, although still not obvious how to set the embedder globally and where to put the cod and how to configure JBehave to see this Embedder. – Dmitriy Popov Jun 24 '19 at 15:37
-1

You can simply skip the test using the @skip in the meta info:

Scenario:  A scenario which we cannot run every time due to some technical contraint
Meta:
@skip     
@ignored true  
Given ... // normal scenario steps

Documentation on meta tags can be found here

Mo H.
  • 1,788
  • 1
  • 18
  • 28
  • 2
    This some how doesnt work. I have seen the documentation. The scenario still runs. – WarLoCk Jan 13 '16 at 21:00
  • @AkaashVankamamidi Could you please edit your question to provide some examples of what you have tried? – Mo H. Jan 13 '16 at 21:05