import java.io.File;
-import org.junit.jupiter.api.extension.BeforeEachCallback;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.ParameterContext;
import org.junit.jupiter.api.extension.ParameterResolver;
* {@link https://www.testcontainers.org/modules/webdriver_containers/ Testcontainers}.
* @author Kai Moritz
*/
-public class WebDriverExtension implements BeforeEachCallback, ParameterResolver
+@Slf4j
+public class WebDriverExtension implements BeforeAllCallback, ParameterResolver
{
BrowserWebDriverContainer chrome;
@Override
- public void beforeEach(ExtensionContext context) throws Exception
+ public void beforeAll(ExtensionContext context) throws Exception
{
chrome =
new BrowserWebDriverContainer()
.withCapabilities(DesiredCapabilities.chrome())
.withRecordingMode(BrowserWebDriverContainer.VncRecordingMode.RECORD_ALL, new File("./target/"));
+ log.info("Starting {}", chrome.getDockerImageName());
+ chrome.start();
+ log.info("Selenium-Address: {}", chrome.getSeleniumAddress());
+ log.info("VNC-Address: {}", chrome.getVncAddress());
}
@Override