All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codeborne.selenide.junit5.BrowserPerTestStrategyExtension Maven / Gradle / Ivy

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