From: Kai Moritz Date: Wed, 22 Jan 2020 12:34:49 +0000 (+0100) Subject: WIP X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c72b9574e90d82965d425e76c624ca6333cd26de;p=demos%2Fspring-boot WIP --- diff --git a/src/test/java/de/juplo/demo/WebDriverExtension.java b/src/test/java/de/juplo/demo/WebDriverExtension.java index f53bcd4..9de61bb 100644 --- a/src/test/java/de/juplo/demo/WebDriverExtension.java +++ b/src/test/java/de/juplo/demo/WebDriverExtension.java @@ -2,7 +2,8 @@ package de.juplo.demo; 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; @@ -18,18 +19,23 @@ import org.testcontainers.containers.BrowserWebDriverContainer; * {@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