-Тест-раннер, как использовать и чего не хватает в моем тест-раннере.
- Я использование огурца junit --> почему перехваты не срабатывают.
----- -------это мой класс DI --------
import org.openqa.selenium.WebDriver;
контекст страницы общедоступного класса {
Код: Выделить всё
public WebDriver getDriver() {
return driver;
}
public void setDriver(WebDriver driver) {
this.driver = driver;
}
private WebDriver driver;
хуки пакетов;
import io.cucumber.java.Before;
public класс myhooks {
Код: Выделить всё
private pagecontext context;
public myhooks(pagecontext context) {
this.context=context;
}
@BeforeClass
public void setup() {
System.setProperty("webdriver.edge.driver","C:/Users/DINESH.PALANIYANDI/eclipse-workspace/Shopify/src/test/resources/Drivers/msedgedriver.exe");
WebDriver driver=new EdgeDriver();
context.setDriver(driver);
context.getDriver().manage().window().maximize();
context.getDriver().manage().timeouts().implicitlyWait(Duration.ofSeconds(20));
}
@AfterClass
public void teardown() {
context.getDriver().close();
context.getDriver().quit();
}
----- это мой первый класс запуска тестов ts01 -------
package Testrunner;
импортировать org.junit.runner.RunWith;
импортировать io.cucumber.junit.Cucumber;
импортировать io.cucumber.junit .CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(
Код: Выделить всё
features = {"src/test/resources/Features/F01_RegisterwithShopify.feature"},
plugin = {"pretty","html:C:/Users/DINESH.PALANIYANDI/eclipse-workspace/Shopify/target/Reports/F01_RegisterwithShopify.html"},
glue = {"StepDefinations_TS"},
monochrome = true,
dryRun = false )
}
---------- это мой второй класс бегуна --- ---------
пакет Testrunner;
импорт org.junit.runner.RunWith;
импорт io. огурец.junit.Cucumber;
import io.cucumber.junit.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(
Код: Выделить всё
features = {"src/test/resources/Features/F02_Configureyourstore.feature"},
glue = {"StepDefinations_TS"},
plugin = {"pretty","html:C:/Users/DINESH.PALANIYANDI/eclipse-workspace/Shopify/target/Reports/F02_Configureyourstore.html"},
monochrome = true,
dryRun = false )
}
`
Подробнее здесь: https://stackoverflow.com/questions/786 ... eturn-valu