fix: 24 - CucumberFrameWorkDone
Some checks failed
jenkins/ZenProject/pipeline/head There was a failure building this commit
Some checks failed
jenkins/ZenProject/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d13a89e735
commit
c03ae30e24
57
pom.xml
57
pom.xml
@ -14,6 +14,46 @@
|
|||||||
<maven.compiler.target>8</maven.compiler.target>
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>Regression</id>
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>3.5.0</version>
|
||||||
|
<configuration>
|
||||||
|
<suiteXmlFiles>
|
||||||
|
<suiteXmlFile>testng.xml</suiteXmlFile>
|
||||||
|
</suiteXmlFiles>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>Smoke</id>
|
||||||
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>3.5.0</version>
|
||||||
|
<configuration>
|
||||||
|
<suiteXmlFiles>
|
||||||
|
<suiteXmlFile>testCucumber.xml</suiteXmlFile>
|
||||||
|
</suiteXmlFiles>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -94,22 +134,5 @@
|
|||||||
<artifactId>cucumber-java</artifactId>
|
<artifactId>cucumber-java</artifactId>
|
||||||
<version>7.14.1</version>
|
<version>7.14.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.22.2</version>
|
|
||||||
<configuration>
|
|
||||||
<suiteXmlFiles>
|
|
||||||
<suiteXmlFile>testng.xml</suiteXmlFile> <!-- Path to your TestNG suite -->
|
|
||||||
</suiteXmlFiles>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -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">Oct 3, 2024 04:15:01 AM</span></a>
|
<a href="#"><span class="badge badge-primary">Oct 4, 2024 03:08:58 AM</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -74,14 +74,14 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div> <div class="test-list-wrapper scrollable">
|
</div> <div class="test-list-wrapper scrollable">
|
||||||
<ul class="test-list-item">
|
<ul class="test-list-item">
|
||||||
<li class="test-item" status="pass" test-id="2"
|
<li class="test-item" status="pass" test-id="1"
|
||||||
author=""
|
author=""
|
||||||
tag=""
|
tag=""
|
||||||
device="">
|
device="">
|
||||||
<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>4:15:04 AM</span> / <span>00:00:00:000</span>
|
<span>3:09:05 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,10 +90,10 @@
|
|||||||
<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'>10.03.2024 4:15:04 AM</span>
|
<span class='badge badge-success'>10.04.2024 3:09:05 AM</span>
|
||||||
<span class='badge badge-danger'>10.03.2024 4:15:04 AM</span>
|
<span class='badge badge-danger'>10.04.2024 3:09:05 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=2</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>
|
||||||
<span title='Collapse all nodes' class='badge badge-default pointer float-right ct ml-1'><i class="fa fa-compress"></i></span>
|
<span title='Collapse all nodes' class='badge badge-default pointer float-right ct ml-1'><i class="fa fa-compress"></i></span>
|
||||||
<span title='Expand all nodes' class='badge badge-default pointer float-right et'><i class="fa fa-expand"></i></span>
|
<span title='Expand all nodes' class='badge badge-default pointer float-right et'><i class="fa fa-expand"></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>Oct 3, 2024 04:15:01 AM</h3>
|
<h3>Oct 4, 2024 03:08:58 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>Oct 3, 2024 04:15:04 AM</h3>
|
<h3>Oct 4, 2024 03:09:05 AM</h3>
|
||||||
</div></div>
|
</div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
Feature: Home page of the application
|
Feature: Home page of the application
|
||||||
Scenario: HomePage is landing Page
|
Scenario: Leave a comment into Zenful.cloud
|
||||||
Given User is on landing page ( homePage )
|
Given Initialize the remote webdriver
|
||||||
When User type text into the text box and hit click
|
And navigate to "https://zenful.cloud"
|
||||||
Then Text should be published
|
When User type text into the text box and hit click
|
||||||
|
Then Text is displayed "True"
|
||||||
|
|||||||
@ -3,21 +3,34 @@ package stepDefinition;
|
|||||||
import io.cucumber.java.en.Given;
|
import io.cucumber.java.en.Given;
|
||||||
import io.cucumber.java.en.Then;
|
import io.cucumber.java.en.Then;
|
||||||
import io.cucumber.java.en.When;
|
import io.cucumber.java.en.When;
|
||||||
|
import zacksolutions.base.Initialization;
|
||||||
|
import zacksolutions.pages.HomePage;
|
||||||
|
|
||||||
public class StepDefinition {
|
import java.io.IOException;
|
||||||
|
|
||||||
@Given("User is on landing page \\( homePage )")
|
public class StepDefinition extends Initialization {
|
||||||
public void userIsOnLandingPageHomePage() {
|
|
||||||
System.out.println("land on the home page");
|
|
||||||
|
@Given("Initialize the remote webdriver")
|
||||||
|
public void initializeTheRemoteWebdriver() {
|
||||||
|
BrowserInit("firefox");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Given("navigate to {string}")
|
||||||
|
public void navigate_to(String url) {
|
||||||
|
// Write code here that turns the phrase above into concrete actions
|
||||||
|
driver.get(url);
|
||||||
|
}
|
||||||
@When("User type text into the text box and hit click")
|
@When("User type text into the text box and hit click")
|
||||||
public void userTypeTextIntoTheTextBoxAndHitClick() {
|
public void user_type_text_into_the_text_box_and_hit_click() throws IOException, InterruptedException {
|
||||||
System.out.println("Navigate to the text bar, type, and submit your entry");
|
// Write code here that turns the phrase above into concrete actions
|
||||||
|
HomePage hp = new HomePage();
|
||||||
|
hp.insertText();
|
||||||
}
|
}
|
||||||
|
@Then("Text is displayed {string}")
|
||||||
@Then("Text should be published")
|
public void text_is_displayed(String string) {
|
||||||
public void textShouldBePublished() {
|
// Write code here that turns the phrase above into concrete actions
|
||||||
System.out.println("Assure your text is displayed");
|
HomePage hp = new HomePage();
|
||||||
|
hp.textConfirmation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,10 +3,13 @@ package zacksolutions.pages;
|
|||||||
import org.openqa.selenium.WebElement;
|
import org.openqa.selenium.WebElement;
|
||||||
import org.openqa.selenium.support.FindBy;
|
import org.openqa.selenium.support.FindBy;
|
||||||
import org.openqa.selenium.support.PageFactory;
|
import org.openqa.selenium.support.PageFactory;
|
||||||
|
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||||
|
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||||
import zacksolutions.base.Initialization;
|
import zacksolutions.base.Initialization;
|
||||||
import zacksolutions.base.JokesAPI;
|
import zacksolutions.base.JokesAPI;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.Duration;
|
||||||
|
|
||||||
public class HomePage extends Initialization {
|
public class HomePage extends Initialization {
|
||||||
// Using PageFactory Object Model we get our elemets
|
// Using PageFactory Object Model we get our elemets
|
||||||
@ -36,7 +39,10 @@ public class HomePage extends Initialization {
|
|||||||
extent.flush();
|
extent.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String textConfirmation() {
|
public void textConfirmation() {
|
||||||
return ConfirmText.getText();
|
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(15)); // Adjust the timeout as needed
|
||||||
|
wait.until(ExpectedConditions.visibilityOf(ConfirmText));
|
||||||
|
String joke = ConfirmText.getText();
|
||||||
|
System.out.println(joke);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,9 @@ public class HomePageTest extends Initialization {
|
|||||||
public void TextTest() throws InterruptedException, IOException {
|
public void TextTest() throws InterruptedException, IOException {
|
||||||
HomePage hp = new HomePage();
|
HomePage hp = new HomePage();
|
||||||
hp.insertText();
|
hp.insertText();
|
||||||
|
/*
|
||||||
|
hp.textConfirmation();
|
||||||
|
*/
|
||||||
System.out.println("Job is done, please check this link: " + prop.getProperty("url"));
|
System.out.println("Job is done, please check this link: " + prop.getProperty("url"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
testCucumber.xml
Normal file
11
testCucumber.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
|
||||||
|
<suite name="All Test Suite" thread-count="1" parallel="tests">
|
||||||
|
<test name="CucumberTest">
|
||||||
|
<classes>
|
||||||
|
<class name="testNGRunner.TestRunner">
|
||||||
|
</class>
|
||||||
|
</classes>
|
||||||
|
</test>
|
||||||
|
</suite>
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user