Search code examples
javaeclipseseleniumcucumbercucumber-junit

Can I create an automation script with Java + Eclipse + Cucumber without creation a marven project?


I want to generate automation test report in eclipse project. I didn't create a marven project and I used Eclipse, Cucumber and Selenium web driver for automation scripting. But I cannot find how to generate an automation report.

Please tell me if there is a way to generate an automation report for a Java eclipse project. I have created the main class. It is as belows.

package mCollector;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        format = {"pretty","html:target"},
        features = {"src"}
        )

public class mCollectorRunner {

}

But only from this, I could not generate automation script. What are the additional parts that I have been missed.


Solution

  • Run your class as JUnit, then you should have report.html in target folder after test, you can change directory of report output by changing line

    ...
        format = {"pretty","html:target"},
    ...
    

    to

    ...
        format = {"pretty","html:test-reports"},
    ...
    

    It will create folder called 'test-reports' in your project directory.