Remove dependency on Runner Class used in Maven project

While executing the automated test scripts using TeamCity, I need to mention required feature file names in RunnerClass.java file and check-in that file. Once that file is checked-in TeamCity pickup the file and starts execution.

For example:

@RunWith(Cucumber.class)
@CucumberOptions(

plugin = { "pretty", "json:target/cucumber-reports/Cucumber.json",
"junit:target/cucumber-reports/Cucumber.xml",
"html:target/cucumber-reports","com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html" },monochrome = true ,
features = { "classpath:root/release1/Demo.feature" },
glue = {"com.demo.stepDefinitions" }
tags={"@Sanity"}
)

Above is my current execution method.

 

Now I want to configure TeamCity in such way that it will pickup the required test cases from TeamCity Build Configurations, and remove the dependency on RunnerClass.java file.

 

Points to note:

1. I need to run same test script on multiple environments.

2. I cannot control TeamCity Agent configurations.

 

Any way I can resolve this problem?

0
1 comment

Hi Shailendra,

 

I'm afraid that I do not really understand what your scenario is. This is what I'm understanding and it doesn't sound right, so please feel free to correct me:

-Pull this one file only, RunnerClass.java

-Check for the "features" to parse the file that you need to test

-Pull that file only, nothing else, remove RunnerClass.java

-Run some tests

 

Is this correct? Could you please also clarify what you mean with "I need to run same test script on multiple environments"? how does this affect the process? The usual approach would be to create a build configuration or multiple, that perform the task, which then you can adapt to your needs elsewhere.

0

Please sign in to leave a comment.