Practical Automation Testing Java 3. Cucumber setup. First Test Run

Publié le: 12 avril 2025
sur la chaîne: Alex Hadioglo QA
33
2

In this video you will learn how to connect cucumber, junit and runner.
Here is described what is feature file, how to implement step definitions and run your first test in java.
This is hands-on practical tutorial.

Link to GitHub https://github.com/hadjioglo/untitled...

Code from the lesson:
Feature: My First Test

Scenario: Validate simple functionality
Given user has initialised the test
When user runs the test
Then user should see a successful outcome

@Given("user has initialised the test")
public void userHasInitialisedTheTest() {
System.out.println("Test initialised");
}

@When("user runs the test")
public void userRunsTheTest() {
System.out.println("Test is running");
}

@Then("user should see a successful outcome")
public void userShouldSeeASuccessfulOutcome() {
System.out.println("Test outcome verified");
assertTrue(true);
}

@RunWith(Cucumber.class)
@CucumberOptions(
features = "src/test/resources/features", // path to feature files
glue = "your.package.for.steps", // package where step definitions are located
plugin = {"pretty", "html:target/cucumber-reports.html"},
monochrome = true // makes console output more readable
)
public class TestRunner {
// This class remains empty; its purpose is to run Cucumber features
}


Sur cette page du site, vous pouvez voir la vidéo en ligne Practical Automation Testing Java 3. Cucumber setup. First Test Run durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Alex Hadioglo QA 12 avril 2025, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 33 fois et il a aimé 2 téléspectateurs. Bon visionnage!