Файл функции:
Feature: Claims Regression suit scenarios using BDD
@Test
Scenario: Log in to AUT as ClaimAssistant with valid credential.
Given Browser is launched successfully
Файл определения шага:
@Given("^Browser is launched successfully$")
public void Browser_is_launched_successfully() throws InterruptedException, IOException
{
System.setProperty("webdriver.chrome.driver", "U:\\Claims Jar\\ChromeDriver\\chromedriver_win32\\chromedriver.exe");
driver=new ChromeDriver();
driver.get("https://www.google.com");
driver.manage().window().maximize();
}
Файл класса тестового исполнителя:
package Runner;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
@RunWith(Cucumber.class)
@CucumberOptions(
features="Feature",
glue={"stepDefn"},
plugin = { "pretty", "html:target/cucumber-reports"},
tags="@CO_Login_Test_ClaimAssistant" ,
dryRun= true ,
monochrome = true
)public class TestRunner {}