forked from Zakaria/ZenProject
ExtentReportsAdded
This commit is contained in:
parent
74fd6a9f24
commit
c11ffbe238
7
.idea/codeStyles/Project.xml
Normal file
7
.idea/codeStyles/Project.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<code_scheme name="Project" version="173">
|
||||||
|
<ScalaCodeStyleSettings>
|
||||||
|
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
|
||||||
|
</ScalaCodeStyleSettings>
|
||||||
|
</code_scheme>
|
||||||
|
</component>
|
||||||
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@ -1,16 +1,21 @@
|
|||||||
package zacksolutions.base;
|
package zacksolutions.base;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Properties;
|
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.WebDriver;
|
||||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||||
|
|
||||||
public class Initialization {
|
public class Initialization {
|
||||||
public static WebDriver driver;
|
public static WebDriver driver;
|
||||||
public static Properties prop;
|
public static Properties prop;
|
||||||
|
public static ExtentReports extent;
|
||||||
|
public static ExtentTest test;
|
||||||
|
|
||||||
|
|
||||||
public Initialization() {
|
public Initialization() {
|
||||||
|
|
||||||
@ -20,16 +25,21 @@ public class Initialization {
|
|||||||
FileInputStream fis = new FileInputStream("/home/ilyes/SeleniumPractice/Zenful/src/main/java/zacksolutions/config/config.properties");
|
FileInputStream fis = new FileInputStream("/home/ilyes/SeleniumPractice/Zenful/src/main/java/zacksolutions/config/config.properties");
|
||||||
prop.load(fis);
|
prop.load(fis);
|
||||||
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
// TODO: handle exception
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
// TODO: handle exception
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BrowserInit() {
|
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");
|
String browsername = prop.getProperty("browserF");
|
||||||
if (browsername.equalsIgnoreCase("firefox")) {
|
if (browsername.equalsIgnoreCase("firefox")) {
|
||||||
System.setProperty("web-driver.gecko.driver","/home/ilyes/SeleniumPractice/Zenful/drivers/geckodriver");
|
System.setProperty("web-driver.gecko.driver","/home/ilyes/SeleniumPractice/Zenful/drivers/geckodriver");
|
||||||
|
|||||||
@ -22,8 +22,10 @@ public class HomePage extends Initialization {
|
|||||||
|
|
||||||
//Actions
|
//Actions
|
||||||
public void insertText() throws InterruptedException {
|
public void insertText() throws InterruptedException {
|
||||||
|
test = extent.createTest("Test msg");
|
||||||
message.sendKeys("4 8 15 16 23 42");
|
message.sendKeys("4 8 15 16 23 42");
|
||||||
button.click();
|
button.click();
|
||||||
|
extent.flush();
|
||||||
}
|
}
|
||||||
public String textConfirmation(){
|
public String textConfirmation(){
|
||||||
return ConfirmText.getText();
|
return ConfirmText.getText();
|
||||||
|
|||||||
@ -7,7 +7,9 @@ import org.testng.annotations.Test;
|
|||||||
import zacksolutions.base.Initialization;
|
import zacksolutions.base.Initialization;
|
||||||
import zacksolutions.pages.HomePage;
|
import zacksolutions.pages.HomePage;
|
||||||
|
|
||||||
|
|
||||||
public class HomePageTest extends Initialization {
|
public class HomePageTest extends Initialization {
|
||||||
|
|
||||||
HomePage homePage;
|
HomePage homePage;
|
||||||
public HomePageTest(){
|
public HomePageTest(){
|
||||||
super();
|
super();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user