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
}
On this page of the site you can watch the video online Practical Automation Testing Java 3. Cucumber setup. First Test Run with a duration of hours minute second in good quality, which was uploaded by the user Alex Hadioglo QA 12 April 2025, share the link with friends and acquaintances, this video has already been watched 33 times on youtube and it was liked by 2 viewers. Enjoy your viewing!