Class BrowserPerTestStrategyExtension

java.lang.Object
com.codeborne.selenide.junit5.BrowserPerTestStrategyExtension
All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.Extension

public class BrowserPerTestStrategyExtension extends Object implements org.junit.jupiter.api.extension.AfterEachCallback
By using this extension browser will be automatically closed after each test.
To use this extension, extend your test class with it:
@ExtendWith({BrowserPerTestStrategyExtension.class}
Or register extension in test class:
@RegisterExtension static BrowserPerTestStrategyExtension browserPerTestStrategy = new BrowserPerTestStrategyExtension();
  • Constructor Details

    • BrowserPerTestStrategyExtension

      public BrowserPerTestStrategyExtension()
  • Method Details

    • afterEach

      public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback