fix: adding Jenkinsfile
Some checks failed
Zenful/ZenProject/pipeline/head There was a failure building this commit
Some checks failed
Zenful/ZenProject/pipeline/head There was a failure building this commit
This commit is contained in:
parent
72f873c8d8
commit
df67108c10
@ -8,7 +8,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</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" />
|
||||
</component>
|
||||
</project>
|
||||
13
Jenkinsfile
vendored
Normal file
13
Jenkinsfile
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
// This runs the Maven test phase
|
||||
sh 'mvn test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<a href="#"><span class="badge badge-primary">Zenful</span></a>
|
||||
</li>
|
||||
<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 28, 2024 04:50:12 PM</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -81,7 +81,7 @@
|
||||
<div class="test-detail">
|
||||
<p class="name">Test msg</p>
|
||||
<p class="text-sm">
|
||||
<span>10:13:26 AM</span> / <span>00:00:00:000</span>
|
||||
<span>4:50:15 PM</span> / <span>00:00:00:000</span>
|
||||
<span class="badge pass-bg log float-right">Pass</span>
|
||||
</p>
|
||||
</div>
|
||||
@ -90,8 +90,8 @@
|
||||
<div class="p-v-10">
|
||||
<div class="info">
|
||||
<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-danger'>09.27.2024 10:13:26 AM</span>
|
||||
<span class='badge badge-success'>09.28.2024 4:50:15 PM</span>
|
||||
<span class='badge badge-danger'>09.28.2024 4:50:15 PM</span>
|
||||
<span class='badge badge-default'>00:00:00:000</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>
|
||||
@ -115,13 +115,13 @@
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body">
|
||||
<p class="m-b-0">Started</p>
|
||||
<h3>Sep 27, 2024 10:13:21 AM</h3>
|
||||
<h3>Sep 28, 2024 04:50:12 PM</h3>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body">
|
||||
<p class="m-b-0">Ended</p>
|
||||
<h3>Sep 27, 2024 10:13:26 AM</h3>
|
||||
<h3>Sep 28, 2024 04:50:15 PM</h3>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@ -182,7 +182,7 @@ var timeline = {
|
||||
<thead><tr class="bg-gray"><th>Name</th><th>Value</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Test Done By: </td>
|
||||
<td>Tester ID: </td>
|
||||
<td>Sami</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
package zacksolutions.base;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
@ -7,23 +8,24 @@ import com.aventstack.extentreports.reporter.ExtentSparkReporter;
|
||||
import com.aventstack.extentreports.ExtentReports;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||
|
||||
public class Initialization {
|
||||
//let's set up our variables
|
||||
// let's set up our variables
|
||||
|
||||
public static WebDriver driver;
|
||||
public static Properties prop;
|
||||
public static ExtentReports extent;
|
||||
public static ExtentTest test;
|
||||
|
||||
|
||||
public Initialization() {
|
||||
// let's use the config.properties file to set up our global variables...
|
||||
try {
|
||||
|
||||
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);
|
||||
|
||||
} catch (IOException e) {
|
||||
@ -34,7 +36,7 @@ public class Initialization {
|
||||
}
|
||||
|
||||
public void BrowserInit() {
|
||||
//our EXTENTREPORTS SETUP!
|
||||
// our EXTENTREPORTS SETUP!
|
||||
|
||||
String path = System.getProperty("user.dir") + "/reports/index.html";
|
||||
ExtentSparkReporter spark = new ExtentSparkReporter(path);
|
||||
@ -44,20 +46,25 @@ public class Initialization {
|
||||
extent.attachReporter(spark);
|
||||
extent.setSystemInfo("Tester ID: ", "Sami");
|
||||
|
||||
//conditioning our WebDriver with an if statement
|
||||
// conditioning our WebDriver with an if statement
|
||||
String browsername = prop.getProperty("browserC");
|
||||
|
||||
//launching FireFox
|
||||
// launching FireFox
|
||||
if (browsername.equalsIgnoreCase("firefox")) {
|
||||
System.setProperty("web-driver.gecko.driver","user.dir" + "/drivers/geckodriver");
|
||||
driver = new FirefoxDriver();
|
||||
// System.setProperty("web-driver.gecko.driver","user.dir" +
|
||||
// "/drivers/geckodriver");
|
||||
// driver = new FirefoxDriver();
|
||||
driver.get(prop.getProperty("url"));
|
||||
}
|
||||
|
||||
//launching Chrome
|
||||
// launching Chrome
|
||||
if (browsername.equalsIgnoreCase("chrome")) {
|
||||
System.setProperty("web-driver.gecko.driver", "user.dir" + "/drivers/chromedriver");
|
||||
driver = new ChromeDriver();
|
||||
// System.setProperty("web-driver.gecko.driver", "user.dir" +
|
||||
// "/drivers/chromedriver");
|
||||
// driver = new ChromeDriver();
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.addArguments("--headless");
|
||||
driver = new ChromeDriver(options);
|
||||
driver.get(prop.getProperty("url"));
|
||||
}
|
||||
driver.manage().window().maximize();
|
||||
|
||||
@ -7,27 +7,30 @@ import org.testng.annotations.Test;
|
||||
import zacksolutions.base.Initialization;
|
||||
import zacksolutions.pages.HomePage;
|
||||
|
||||
|
||||
public class HomePageTest extends Initialization {
|
||||
|
||||
HomePage homePage;
|
||||
public HomePageTest(){
|
||||
super();
|
||||
}
|
||||
@BeforeTest
|
||||
public void setUp(){
|
||||
BrowserInit();
|
||||
homePage = new HomePage();
|
||||
}
|
||||
@Test
|
||||
public void TextTest() throws InterruptedException {
|
||||
HomePage hp = new HomePage();
|
||||
hp.insertText();
|
||||
hp.textConfirmation();
|
||||
Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
|
||||
}
|
||||
@AfterTest
|
||||
public void tearDown(){
|
||||
driver.close();
|
||||
}
|
||||
HomePage homePage;
|
||||
|
||||
public HomePageTest() {
|
||||
super();
|
||||
}
|
||||
|
||||
@BeforeTest
|
||||
public void setUp() {
|
||||
BrowserInit();
|
||||
homePage = new HomePage();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void TextTest() throws InterruptedException {
|
||||
HomePage hp = new HomePage();
|
||||
hp.insertText();
|
||||
hp.textConfirmation();
|
||||
Assert.assertEquals(hp.textConfirmation(), "4 8 15 16 23 42");
|
||||
}
|
||||
|
||||
@AfterTest
|
||||
public void tearDown() {
|
||||
driver.close();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user