Search code examples
citrus-framework

How to run test methods individually with Citrus Framework?


I have the next code

@Test
public class ApiTestIT extends TestNGCitrusTestDesigner {
    @CitrusTest(name = "testApi2IT")
    public void testApi1IT() {
        //TO-DO here
    }

    @CitrusTest(name = "testApi2IT")
    public void testApi2IT() {
        echo("Hello Citrus!");
    }
}

How can i run test methods individually?

I trying using -Dtest and -Dit.test bad no work; always run the test at same time.

Thanks


Solution

  • To execute single test methods, you have to specify them in the -Dit.test specification like -Dit.test=ApiTestIT#testApi2IT.

    Nevertheless, this functionality is not provided by citrus but by the maven failsafe plugin. For more information, have a look at the documentation for Running a Single Test

    Some examples with citrus can be found in the Citrus samples repository.