Search code examples
junitbddjbehaveserenity-bdd

Jbehave Serenity BDD How to run specific suite?


Have a bdd project jbehave + serenity By default I run the story tests this way: **/*.story in storyPaths

But i need to run not all stories and not specific story, i need to run specific suite(specific folder with all the tests inside).

default patch


project\src\test\resources\SuiteTest1

**SuiteTest1**\MainPage\Test1.story
                        Test2.story
                        Test2.story

            PaymentPage\Test1.story
                        Test2.story
                        Test2.story

project\src\test\resources\SuiteTest2

**SuiteTest2**\LoginPage\Test1.story
                        Test2.story
                        Test2.story

            ForumPage\Test1.story
                        Test2.story
                        Test2.story

In SuiteTest**1** and SuiteTest**2** have different tests, i have to run them at different times.

Tried to run:

SuiteTest2*/*.story

SuiteTest2.*/*.story

SuiteTest2.**/*.story

SuiteTest2**/*.story

But this not work, it can't find the stories.....

Thanks in advance for any help.


Solution

  • The double-asterisk tells a path to locate the file specified in any subdirectory below the defined one, so:

    SuiteTest2/**.story
    

    would locate any file with the extension .story in any folder starting at folder SuiteTest2

    Therefore, in your example, it will find all the story files in SuiteTest2/LoginPage and in SuiteTest2/ForumPage but it will not process any of the story files under the SuiteTest1 folder.