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
}
На этой странице сайта вы можете посмотреть видео онлайн Practical Automation Testing Java 3. Cucumber setup. First Test Run длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Alex Hadioglo QA 12 Апрель 2025, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 33 раз и оно понравилось 2 зрителям. Приятного просмотра!