diff --git a/pom.xml b/pom.xml index a788b26..19e3a84 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,24 @@ log4j-core 2.24.0 + + + io.cucumber + cucumber-java + 7.19.0 + + + + io.cucumber + cucumber-testng + 7.19.0 + + + io.cucumber + cucumber-java + 7.14.1 + + diff --git a/reports/index.html b/reports/index.html index 9ab4b00..0579d2b 100644 --- a/reports/index.html +++ b/reports/index.html @@ -35,7 +35,7 @@ Zenful
  • -Oct 2, 2024 08:57:57 PM +Oct 3, 2024 04:15:01 AM
  • @@ -81,7 +81,7 @@

    Test msg

    - 8:57:59 PM / 00:00:00:000 + 4:15:04 AM / 00:00:00:000 Pass

    @@ -90,8 +90,8 @@
    Test msg
    -10.02.2024 8:57:59 PM -10.02.2024 8:57:59 PM +10.03.2024 4:15:04 AM +10.03.2024 4:15:04 AM 00:00:00:000 · #test-id=2 @@ -115,13 +115,13 @@

    Started

    -

    Oct 2, 2024 08:57:57 PM

    +

    Oct 3, 2024 04:15:01 AM

    Ended

    -

    Oct 2, 2024 08:58:00 PM

    +

    Oct 3, 2024 04:15:04 AM

    diff --git a/src/main/java/features/HomePage.feature b/src/main/java/features/HomePage.feature new file mode 100644 index 0000000..9e3136e --- /dev/null +++ b/src/main/java/features/HomePage.feature @@ -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 diff --git a/src/main/java/stepDefinition/StepDefinition.java b/src/main/java/stepDefinition/StepDefinition.java new file mode 100644 index 0000000..735f301 --- /dev/null +++ b/src/main/java/stepDefinition/StepDefinition.java @@ -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"); + } +} diff --git a/src/main/java/testNGRunner/TestRunner.java b/src/main/java/testNGRunner/TestRunner.java new file mode 100644 index 0000000..c55ecca --- /dev/null +++ b/src/main/java/testNGRunner/TestRunner.java @@ -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 { + +} diff --git a/src/main/java/zacksolutions/base/Initialization.java b/src/main/java/zacksolutions/base/Initialization.java index 0633e4e..a46dc35 100644 --- a/src/main/java/zacksolutions/base/Initialization.java +++ b/src/main/java/zacksolutions/base/Initialization.java @@ -18,6 +18,7 @@ import org.testng.annotations.Parameters; public class Initialization { // let's set up our variables + // private static ThreadLocal driver = new ThreadLocal<>(); public static WebDriver driver; public static Properties prop; public static ExtentReports extent; diff --git a/src/main/java/zacksolutions/pages/HomePage.java b/src/main/java/zacksolutions/pages/HomePage.java index ec8595e..4b58c32 100644 --- a/src/main/java/zacksolutions/pages/HomePage.java +++ b/src/main/java/zacksolutions/pages/HomePage.java @@ -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); diff --git a/src/test/java/zacksolutions/HomePageTest.java b/src/test/java/zacksolutions/HomePageTest.java index ea9037e..72e5b28 100644 --- a/src/test/java/zacksolutions/HomePageTest.java +++ b/src/test/java/zacksolutions/HomePageTest.java @@ -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 diff --git a/testng.xml b/testng.xml index 4cf6e0b..a79baa3 100644 --- a/testng.xml +++ b/testng.xml @@ -1,6 +1,6 @@ - +