fix: 24 - adding CucumberFramework
All checks were successful
jenkins/ZenProject/pipeline/head This commit looks good
All checks were successful
jenkins/ZenProject/pipeline/head This commit looks good
This commit is contained in:
parent
9cb8ca125e
commit
d13a89e735
18
pom.xml
18
pom.xml
@ -77,6 +77,24 @@
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.24.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-java</artifactId>
|
||||
<version>7.19.0</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-testng</artifactId>
|
||||
<version>7.19.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.cucumber</groupId>
|
||||
<artifactId>cucumber-java</artifactId>
|
||||
<version>7.14.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
|
||||
@ -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">Oct 2, 2024 08:57:57 PM</span></a>
|
||||
<a href="#"><span class="badge badge-primary">Oct 3, 2024 04:15:01 AM</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -81,7 +81,7 @@
|
||||
<div class="test-detail">
|
||||
<p class="name">Test msg</p>
|
||||
<p class="text-sm">
|
||||
<span>8:57:59 PM</span> / <span>00:00:00:000</span>
|
||||
<span>4:15:04 AM</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'>10.02.2024 8:57:59 PM</span>
|
||||
<span class='badge badge-danger'>10.02.2024 8:57:59 PM</span>
|
||||
<span class='badge badge-success'>10.03.2024 4:15:04 AM</span>
|
||||
<span class='badge badge-danger'>10.03.2024 4:15:04 AM</span>
|
||||
<span class='badge badge-default'>00:00:00:000</span>
|
||||
· <span class='uri-anchor badge badge-default'>#test-id=2</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>Oct 2, 2024 08:57:57 PM</h3>
|
||||
<h3>Oct 3, 2024 04:15:01 AM</h3>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="card"><div class="card-body">
|
||||
<p class="m-b-0">Ended</p>
|
||||
<h3>Oct 2, 2024 08:58:00 PM</h3>
|
||||
<h3>Oct 3, 2024 04:15:04 AM</h3>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
|
||||
5
src/main/java/features/HomePage.feature
Normal file
5
src/main/java/features/HomePage.feature
Normal file
@ -0,0 +1,5 @@
|
||||
Feature: Home page of the application
|
||||
Scenario: HomePage is landing Page
|
||||
Given User is on landing page ( homePage )
|
||||
When User type text into the text box and hit click
|
||||
Then Text should be published
|
||||
23
src/main/java/stepDefinition/StepDefinition.java
Normal file
23
src/main/java/stepDefinition/StepDefinition.java
Normal file
@ -0,0 +1,23 @@
|
||||
package stepDefinition;
|
||||
|
||||
import io.cucumber.java.en.Given;
|
||||
import io.cucumber.java.en.Then;
|
||||
import io.cucumber.java.en.When;
|
||||
|
||||
public class StepDefinition {
|
||||
|
||||
@Given("User is on landing page \\( homePage )")
|
||||
public void userIsOnLandingPageHomePage() {
|
||||
System.out.println("land on the home page");
|
||||
}
|
||||
|
||||
@When("User type text into the text box and hit click")
|
||||
public void userTypeTextIntoTheTextBoxAndHitClick() {
|
||||
System.out.println("Navigate to the text bar, type, and submit your entry");
|
||||
}
|
||||
|
||||
@Then("Text should be published")
|
||||
public void textShouldBePublished() {
|
||||
System.out.println("Assure your text is displayed");
|
||||
}
|
||||
}
|
||||
12
src/main/java/testNGRunner/TestRunner.java
Normal file
12
src/main/java/testNGRunner/TestRunner.java
Normal file
@ -0,0 +1,12 @@
|
||||
package testNGRunner;
|
||||
|
||||
import io.cucumber.testng.AbstractTestNGCucumberTests;
|
||||
import io.cucumber.testng.CucumberOptions;
|
||||
|
||||
@CucumberOptions(
|
||||
features = "src/main/java/features",
|
||||
glue = "stepDefinition"
|
||||
)
|
||||
public class TestRunner extends AbstractTestNGCucumberTests {
|
||||
|
||||
}
|
||||
@ -18,6 +18,7 @@ import org.testng.annotations.Parameters;
|
||||
public class Initialization {
|
||||
// let's set up our variables
|
||||
|
||||
// private static ThreadLocal<WebDriver> driver = new ThreadLocal<>();
|
||||
public static WebDriver driver;
|
||||
public static Properties prop;
|
||||
public static ExtentReports extent;
|
||||
|
||||
@ -19,7 +19,6 @@ public class HomePage extends Initialization {
|
||||
@FindBy(xpath = "//tbody/tr[1]/td[1]")
|
||||
WebElement ConfirmText;
|
||||
|
||||
|
||||
// Initialization
|
||||
public HomePage() {
|
||||
PageFactory.initElements(driver, this);
|
||||
|
||||
@ -23,6 +23,7 @@ public class HomePageTest extends Initialization {
|
||||
public void setUp(String browser) {
|
||||
BrowserInit(browser);
|
||||
homePage = new HomePage();
|
||||
System.out.println("Starting " + browser);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||
<suite name="All Test Suite" thread-count="3" >
|
||||
<suite name="All Test Suite" thread-count="1" parallel="tests">
|
||||
<test name="FireFoxTest">
|
||||
<parameter name="browser" value="firefox"/>
|
||||
<classes>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user