Я изо всех сил @ AfterStep / @ Beforestep в проекте Java Селен огурца.
, когда я использовал ловушку огурца @AfterStep, он не выполняет этот метод (он пропускает этот метод)
Я пытался смного версий, но все еще не повезло.
Может кто-нибудь помочь мне с последними версиями POM-файла, который не имеет проблемы совместимости
Я поместил этот файл в stepDefinition и используя cucumber.api.java.AfterStep
@AfterStep
public void tearDown(Scenario scenario) throws IOException, JiraException
{
System.out.println("in step method");
if (scenario.isFailed()) {
System.out.println("in failes screen");
File scrFile = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);
String path=null;
path=System.getProperty("user.dir")+"\\target\\Screenshot\\"+System.currentTimeMillis()+".png";
FileUtils.copyFile(scrFile, new File(path));
Reporter.addScreenCaptureFromPath(path);
Reporter.addStepLog(scenario.getId());
}
}
TestRunner:
@RunWith(Cucumber.class)
@CucumberOptions(
features = {"src/extentPackage/LoginToABSi.feature"},
glue = {"stepDefinitions"},
plugin = {"com.cucumber.listener.ExtentCucumberFormatter:target/report.html"}
)
public class RunCukesTest {
public static WebDriver driver;
public static WebDriverWait wait;
public static ExtentProperties extentProperties;
@AfterClass
public static void teardown() {
Reporter.loadXMLConfig(new File("Report-Config/extent-config.xml"));
Reporter.setSystemInfo("user", System.getProperty("user.name"));
Reporter.setSystemInfo("os", "Mac OSX");
Reporter.setTestRunnerOutput("Sample test runner output message");
}