Tuesday, 12 December 2017

Adding Runner

Now add a java file under test.java.runner 

package test.java.runner;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import main.java.listener.ExtentProperties;
import main.java.listener.LogDisplay;
import main.java.listener.Reporter;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import com.aventstack.extentreports.reporter.ExtentXReporter;
import java.io.File;
import java.io.IOException;

/**
 * A sample test to demonstrate
 */
@RunWith(Cucumber.class)
@CucumberOptions(features = { "src/test/resources/features/" }, plugin = {
  "main.java.listener.ExtentCucumberFormatter:output/report.html" }, format = {
    "json:target/Destination/cucumber.json" }, glue = { "test.java.steps" }

)
public class RunCukesTest {

 @AfterClass
 public static void teardown() throws IOException {
  Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml"));
  Reporter.setSystemInfo("user", System.getProperty("user.name"));
  Reporter.setSystemInfo("OS", "Windows 7");
  Reporter.setSystemInfo("JAVA", "1.8");
  Reporter.setSystemInfo("Selenium", "2.53");
  Reporter.setSystemInfo("Host", "IAPAC83");
  // Reporter.addScreenCaptureFromPath("D:\\eclipse\\WorkSpace\\Yaskawa\\Screenshots\\dockBar.png");
  Reporter.addScreenCast("D:/eclipse/WorkSpace/Yaskawa/Videos/MyVideo.avi");
  LogDisplay log = new LogDisplay();
  log.getLog();
 }

}

No comments:

Post a Comment

Set up testlink with Selenium Framework

To Integrate Testlink with selenium add following jars in your setup testlink-api-client-2.0.jar xmlrpc-common-3.1.jar xmlrpc-client-...