2

I know this is the most common question but sorry I am posting this again as I tried all the solutions but couldn't solve the issue,

Problem: I am unable to run my cucumber tests through maven and Jenkins

Command i am using:

mvn clean -Dcucumber.options="--@tags @tags" -Dbrowser=REMOTE_CHROME -Denv={env}
  1. feature files in src/test/resources
  2. steps and Runner in src/test/java

not sure what to include in pom - I have info.cukes, can some one please help if hooks is really needed to run the tests through maven or Jenkins

or is it problem with the project structure

Runner:

 @RunWith(Cucumber.class)
 @CucumberOptions(
    plugin = {"pretty"},
    features = {"src/test/resources"},
    tags = {"@regression,@add-documents,@add-payment"})
  public class RunRegressionTest {

   }

maven Result:

   Running com.loveholidays.travelthing.RunRegressionTest

Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@2a098129 Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.657 sec

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS

  • Please add the error message that you're getting. Would help in debugging. – demouser123 Feb 9 '18 at 7:04
  • I dont see any error message it says build success – LaxmiMaddali Feb 12 '18 at 14:41
1

mvn clean means you're executing the clean phase of maven which would not run any tests. You should probably try test or verify, e.g. mvn clean verify. More to read: https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

| improve this answer | |
  • I tried with mvn clean verify and mvn clean test it didnt help, it says build success with tests run: 0 – LaxmiMaddali Feb 9 '18 at 10:16
  • What other errors/warnings you are getting after 'mvn clean verify'. – Vishal Aggarwal Feb 9 '18 at 10:33
  • i dont get any warning or error, i see build is success and tests run are 0 – LaxmiMaddali Feb 9 '18 at 14:25
  • 1
    @LaxmiMaddali have you added the dependency of Maven and Maven surefire plugin in your pom.xml. Check that if those are not included add in pom.xml and save then retry it. You can also refer this link for the configuration example: guru99.com/maven-jenkins-with-selenium-complete-tutorial.html – Bhavani Feb 12 '18 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.