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

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

There is a newer version: 7.5.1
Show newest version
package com.codeborne.selenide.junit5;

import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;

import javax.annotation.ParametersAreNonnullByDefault;

import static com.codeborne.selenide.WebDriverRunner.closeWebDriver;

/**
 * By using this extension browser will be automatically closed after all tests in the current container.
 * 
* To use this extension, extend your test class with it: *
* {@code @ExtendWith({BrowserStrategyExtension.class}} *
* Or register extension in test class: *
* {@code @RegisterExtension static BrowserStrategyExtension browserStrategy = new BrowserStrategyExtension();} *
* * @author Aliaksandr Rasolka * @since 4.12.2 */ @ParametersAreNonnullByDefault public class BrowserStrategyExtension implements AfterAllCallback { @Override public void afterAll(final ExtensionContext context) { closeWebDriver(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy