From c72b9574e90d82965d425e76c624ca6333cd26de Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 22 Jan 2020 13:34:49 +0100 Subject: [PATCH] WIP --- src/test/java/de/juplo/demo/WebDriverExtension.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 2.20.1