forked from Zakaria/ZenProject
Compare commits
12 Commits
1a722f3d61
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 49ba575cfd | |||
| 6fe7a83a5a | |||
| c36e6e9336 | |||
| bc25347655 | |||
| a92c917c97 | |||
| d730a1357d | |||
| 54fbd3e326 | |||
| f0dfc063e1 | |||
| c72122fea2 | |||
| df67108c10 | |||
| 72f873c8d8 | |||
| 4592c1d74e |
Generated
+1
-1
@@ -8,7 +8,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" default="true" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" project-jdk-name="openjdk-23" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
pipeline {
|
||||||
|
agent {
|
||||||
|
label "agent_locke"
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
// This runs the Maven test phase
|
||||||
|
sh 'mvn test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
-7
@@ -35,7 +35,7 @@
|
|||||||
<a href="#"><span class="badge badge-primary">Zenful</span></a>
|
<a href="#"><span class="badge badge-primary">Zenful</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="m-r-10">
|
<li class="m-r-10">
|
||||||
<a href="#"><span class="badge badge-primary">Sep 27, 2024 10:13:21 AM</span></a>
|
<a href="#"><span class="badge badge-primary">Sep 29, 2024 01:21:35 AM</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<div class="test-detail">
|
<div class="test-detail">
|
||||||
<p class="name">Test msg</p>
|
<p class="name">Test msg</p>
|
||||||
<p class="text-sm">
|
<p class="text-sm">
|
||||||
<span>10:13:26 AM</span> / <span>00:00:00:000</span>
|
<span>1:21:37 AM</span> / <span>00:00:00:000</span>
|
||||||
<span class="badge pass-bg log float-right">Pass</span>
|
<span class="badge pass-bg log float-right">Pass</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -90,8 +90,8 @@
|
|||||||
<div class="p-v-10">
|
<div class="p-v-10">
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<h5 class="test-status text-pass">Test msg</h5>
|
<h5 class="test-status text-pass">Test msg</h5>
|
||||||
<span class='badge badge-success'>09.27.2024 10:13:26 AM</span>
|
<span class='badge badge-success'>09.29.2024 1:21:37 AM</span>
|
||||||
<span class='badge badge-danger'>09.27.2024 10:13:26 AM</span>
|
<span class='badge badge-danger'>09.29.2024 1:21:37 AM</span>
|
||||||
<span class='badge badge-default'>00:00:00:000</span>
|
<span class='badge badge-default'>00:00:00:000</span>
|
||||||
· <span class='uri-anchor badge badge-default'>#test-id=1</span>
|
· <span class='uri-anchor badge badge-default'>#test-id=1</span>
|
||||||
<span title='Skip to the next failed step' class='badge badge-danger pointer float-right ne ml-1'><i class="fa fa-fast-forward"></i></span>
|
<span title='Skip to the next failed step' class='badge badge-danger pointer float-right ne ml-1'><i class="fa fa-fast-forward"></i></span>
|
||||||
@@ -115,13 +115,13 @@
|
|||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card"><div class="card-body">
|
<div class="card"><div class="card-body">
|
||||||
<p class="m-b-0">Started</p>
|
<p class="m-b-0">Started</p>
|
||||||
<h3>Sep 27, 2024 10:13:21 AM</h3>
|
<h3>Sep 29, 2024 01:21:35 AM</h3>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<div class="card"><div class="card-body">
|
<div class="card"><div class="card-body">
|
||||||
<p class="m-b-0">Ended</p>
|
<p class="m-b-0">Ended</p>
|
||||||
<h3>Sep 27, 2024 10:13:26 AM</h3>
|
<h3>Sep 29, 2024 01:21:37 AM</h3>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
@@ -182,7 +182,7 @@ var timeline = {
|
|||||||
<thead><tr class="bg-gray"><th>Name</th><th>Value</th></tr></thead>
|
<thead><tr class="bg-gray"><th>Name</th><th>Value</th></tr></thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Test Done By: </td>
|
<td>Tester ID: </td>
|
||||||
<td>Sami</td>
|
<td>Sami</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ package zacksolutions.base;
|
|||||||
|
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.Duration;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import com.aventstack.extentreports.ExtentTest;
|
import com.aventstack.extentreports.ExtentTest;
|
||||||
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
|
import com.aventstack.extentreports.reporter.ExtentSparkReporter;
|
||||||
import com.aventstack.extentreports.ExtentReports;
|
import com.aventstack.extentreports.ExtentReports;
|
||||||
import org.openqa.selenium.WebDriver;
|
import org.openqa.selenium.WebDriver;
|
||||||
import org.openqa.selenium.chrome.ChromeDriver;
|
import org.openqa.selenium.chrome.ChromeDriver;
|
||||||
|
import org.openqa.selenium.chrome.ChromeOptions;
|
||||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||||
|
|
||||||
public class Initialization {
|
public class Initialization {
|
||||||
@@ -19,13 +20,13 @@ public class Initialization {
|
|||||||
public static ExtentReports extent;
|
public static ExtentReports extent;
|
||||||
public static ExtentTest test;
|
public static ExtentTest test;
|
||||||
|
|
||||||
|
|
||||||
public Initialization() {
|
public Initialization() {
|
||||||
// let's use the config.properties file to set up our global variables...
|
// let's use the config.properties file to set up our global variables...
|
||||||
try {
|
try {
|
||||||
|
|
||||||
prop = new Properties();
|
prop = new Properties();
|
||||||
FileInputStream fis = new FileInputStream(System.getProperty("user.dir") + "/src/main/java/zacksolutions/config/config.properties");
|
FileInputStream fis = new FileInputStream(
|
||||||
|
System.getProperty("user.dir") + "/src/main/java/zacksolutions/config/config.properties");
|
||||||
prop.load(fis);
|
prop.load(fis);
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -44,21 +45,35 @@ public class Initialization {
|
|||||||
spark.config().setReportName("Zenful");
|
spark.config().setReportName("Zenful");
|
||||||
extent = new ExtentReports();
|
extent = new ExtentReports();
|
||||||
extent.attachReporter(spark);
|
extent.attachReporter(spark);
|
||||||
extent.setSystemInfo("Test Done By: ", "Sami");
|
extent.setSystemInfo("Tester ID: ", "Sami");
|
||||||
//conditioning our WebDriver with an if statement
|
|
||||||
|
|
||||||
|
// conditioning our WebDriver with an if statement
|
||||||
String browsername = prop.getProperty("browserC");
|
String browsername = prop.getProperty("browserC");
|
||||||
|
|
||||||
|
// launching FireFox
|
||||||
if (browsername.equalsIgnoreCase("firefox")) {
|
if (browsername.equalsIgnoreCase("firefox")) {
|
||||||
System.setProperty("web-driver.gecko.driver","user.dir" + "/drivers/geckodriver");
|
// System.setProperty("web-driver.gecko.driver","user.dir" +
|
||||||
driver = new FirefoxDriver();
|
// "/drivers/geckodriver");
|
||||||
|
// driver = new FirefoxDriver();
|
||||||
driver.get(prop.getProperty("url"));
|
driver.get(prop.getProperty("url"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// launching Chrome
|
||||||
if (browsername.equalsIgnoreCase("chrome")) {
|
if (browsername.equalsIgnoreCase("chrome")) {
|
||||||
System.setProperty("web-driver.gecko.driver", "user.dir" + "/drivers/chromedriver");
|
// System.setProperty("web-driver.gecko.driver", "user.dir" +
|
||||||
driver = new ChromeDriver();
|
// "/drivers/chromedriver");
|
||||||
|
// driver = new ChromeDriver();
|
||||||
|
ChromeOptions options = new ChromeOptions();
|
||||||
|
driver = new ChromeDriver(options);
|
||||||
|
options.addArguments("--no-sandbox");
|
||||||
|
options.addArguments("--disable-dev-shm-usage");
|
||||||
|
options.addArguments("--headless");
|
||||||
|
options.addArguments("--remote-debugging-port=9222");
|
||||||
|
options.setBinary("/usr/bin/google-chrome");
|
||||||
driver.get(prop.getProperty("url"));
|
driver.get(prop.getProperty("url"));
|
||||||
}
|
}
|
||||||
driver.manage().window().maximize();
|
driver.manage().window().maximize();
|
||||||
driver.manage().deleteAllCookies();
|
driver.manage().deleteAllCookies();
|
||||||
|
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import org.openqa.selenium.support.PageFactory;
|
|||||||
import zacksolutions.base.Initialization;
|
import zacksolutions.base.Initialization;
|
||||||
|
|
||||||
public class HomePage extends Initialization {
|
public class HomePage extends Initialization {
|
||||||
|
//Using PageFactory Object Model we get our elemets
|
||||||
@FindBy(id="message")
|
@FindBy(id="message")
|
||||||
WebElement message;
|
WebElement message;
|
||||||
|
|
||||||
|
|||||||
@@ -7,18 +7,20 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeTest
|
@BeforeTest
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
BrowserInit();
|
BrowserInit();
|
||||||
homePage = new HomePage();
|
homePage = new HomePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void TextTest() throws InterruptedException {
|
public void TextTest() throws InterruptedException {
|
||||||
HomePage hp = new HomePage();
|
HomePage hp = new HomePage();
|
||||||
@@ -26,6 +28,7 @@ public class HomePageTest extends Initialization {
|
|||||||
hp.textConfirmation();
|
hp.textConfirmation();
|
||||||
Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
|
Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterTest
|
@AfterTest
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
driver.close();
|
driver.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user