com.codeborne.selenide.testng.BrowserPerTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenide-testng Show documentation
Show all versions of selenide-testng Show documentation
Selenide = concise API for Selenium WebDriver
package com.codeborne.selenide.testng;
import org.testng.ITestResult;
import org.testng.reporters.ExitCodeListener;
import static com.codeborne.selenide.Selenide.closeWebDriver;
/**
* Annotate your test class with {@code @Listeners({ BrowserPerTest.class})}
*/
public class BrowserPerTest extends ExitCodeListener {
@Override
public void onTestFailure(ITestResult result) {
super.onTestFailure(result);
closeWebDriver();
}
@Override
public void onTestFailedButWithinSuccessPercentage(ITestResult result) {
super.onTestFailedButWithinSuccessPercentage(result);
closeWebDriver();
}
@Override
public void onTestSuccess(ITestResult result) {
super.onTestSuccess(result);
closeWebDriver();
}
@Override
public void onConfigurationFailure(ITestResult result) {
super.onConfigurationFailure(result);
closeWebDriver();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy