WIP
authorKai Moritz <kai@juplo.de>
Wed, 22 Jan 2020 12:34:49 +0000 (13:34 +0100)
committerKai Moritz <kai@juplo.de>
Fri, 7 Apr 2023 11:15:40 +0000 (13:15 +0200)
src/test/java/de/juplo/demo/WebDriverExtension.java

index f53bcd4..9de61bb 100644 (file)
@@ -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