com.codeborne.selenide.junit5.BrowserPerTestStrategyExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenide Show documentation
Show all versions of selenide Show documentation
Selenide = concise API for Selenium WebDriver
The newest version!
package com.codeborne.selenide.junit5;
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import static com.codeborne.selenide.Selenide.closeWebDriver;
/**
* By using this extension browser will be automatically closed after each test.
*
* To use this extension, extend your test class with it:
*
* {@code @ExtendWith({BrowserPerTestStrategyExtension.class}}
*
* Or register extension in test class:
*
* {@code @RegisterExtension static BrowserPerTestStrategyExtension browserPerTestStrategy = new BrowserPerTestStrategyExtension();}
*
*
* @author simple-elf
*/
public class BrowserPerTestStrategyExtension implements AfterEachCallback {
@Override
public void afterEach(final ExtensionContext context) {
closeWebDriver();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy