fix: 24 - CucumberFrameWorkDone
jenkins/ZenProject/pipeline/head There was a failure building this commit
jenkins/ZenProject/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
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
|
||||
Scenario: Leave a comment into Zenful.cloud
|
||||
Given Initialize the remote webdriver
|
||||
And navigate to "https://zenful.cloud"
|
||||
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.Then;
|
||||
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 void userIsOnLandingPageHomePage() {
|
||||
System.out.println("land on the home page");
|
||||
public class StepDefinition extends Initialization {
|
||||
|
||||
|
||||
@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")
|
||||
public void userTypeTextIntoTheTextBoxAndHitClick() {
|
||||
System.out.println("Navigate to the text bar, type, and submit your entry");
|
||||
public void user_type_text_into_the_text_box_and_hit_click() throws IOException, InterruptedException {
|
||||
// Write code here that turns the phrase above into concrete actions
|
||||
HomePage hp = new HomePage();
|
||||
hp.insertText();
|
||||
}
|
||||
|
||||
@Then("Text should be published")
|
||||
public void textShouldBePublished() {
|
||||
System.out.println("Assure your text is displayed");
|
||||
@Then("Text is displayed {string}")
|
||||
public void text_is_displayed(String string) {
|
||||
// Write code here that turns the phrase above into concrete actions
|
||||
HomePage hp = new HomePage();
|
||||
hp.textConfirmation();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,13 @@ package zacksolutions.pages;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.support.FindBy;
|
||||
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.JokesAPI;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
|
||||
public class HomePage extends Initialization {
|
||||
// Using PageFactory Object Model we get our elemets
|
||||
@@ -36,7 +39,10 @@ public class HomePage extends Initialization {
|
||||
extent.flush();
|
||||
}
|
||||
|
||||
public String textConfirmation() {
|
||||
return ConfirmText.getText();
|
||||
public void textConfirmation() {
|
||||
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 {
|
||||
HomePage hp = new HomePage();
|
||||
hp.insertText();
|
||||
/*
|
||||
hp.textConfirmation();
|
||||
*/
|
||||
System.out.println("Job is done, please check this link: " + prop.getProperty("url"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user