ExtentReportsAdded
This commit is contained in:
@@ -1,16 +1,21 @@
|
||||
package zacksolutions.base;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
|
||||
import com.aventstack.extentreports.ExtentTest;
|
||||
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
|
||||
import com.aventstack.extentreports.ExtentReports;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||
|
||||
public class Initialization {
|
||||
public static WebDriver driver;
|
||||
public static Properties prop;
|
||||
public static ExtentReports extent;
|
||||
public static ExtentTest test;
|
||||
|
||||
|
||||
public Initialization() {
|
||||
|
||||
@@ -20,16 +25,21 @@ public class Initialization {
|
||||
FileInputStream fis = new FileInputStream("/home/ilyes/SeleniumPractice/Zenful/src/main/java/zacksolutions/config/config.properties");
|
||||
prop.load(fis);
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO: handle exception
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void BrowserInit() {
|
||||
String path = System.getProperty("user.dir") + "/reports/index.html";
|
||||
ExtentSparkReporter spark = new ExtentSparkReporter(path);
|
||||
spark.config().setDocumentTitle("Zen Test Case");
|
||||
spark.config().setReportName("Zenful");
|
||||
extent = new ExtentReports();
|
||||
extent.attachReporter(spark);
|
||||
extent.setSystemInfo("Test Done By: ", "Sami");
|
||||
String browsername = prop.getProperty("browserF");
|
||||
if (browsername.equalsIgnoreCase("firefox")) {
|
||||
System.setProperty("web-driver.gecko.driver","/home/ilyes/SeleniumPractice/Zenful/drivers/geckodriver");
|
||||
|
||||
Reference in New Issue
Block a user