/*
 * (C) Copyright 2018 Boni Garcia (http://bonigarcia.github.io/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package io.github.bonigarcia.test.docker;

import static java.lang.invoke.MethodHandles.lookup;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.slf4j.LoggerFactory.getLogger;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.openqa.selenium.WebDriver;
import org.slf4j.Logger;

import io.github.bonigarcia.SeleniumExtension;

public class ExecCommandInContainerTest {

    final Logger log = getLogger(lookup().lookupClass());

    @RegisterExtension
    static SeleniumExtension seleniumExtension = new SeleniumExtension();

    @Test
    void templateTest(WebDriver driver) {
        String command = "ls";
        String result = seleniumExtension.executeCommandInContainer(driver,
                command);
        log.debug("Result of executing command {} in Docker container: {}",
                command, result);
        assertThat(result, notNullValue());
    }

}

@@ -896,24 +896,105 @@
 tLogger;%0D%0A%0D%0A
+import org.junit.jupiter.api.AfterAll;%0D%0Aimport org.junit.jupiter.api.BeforeAll;%0D%0A
 import org.j
@@ -1013,24 +1013,24 @@
 .api.Test;%0D%0A
-
 import org.j
@@ -1190,16 +1190,62 @@
 ension;%0D
+%0Aimport io.github.bonigarcia.SeleniumJupiter;%0D
 %0A%0D%0Apubli
@@ -1369,16 +1369,16 @@
 ension%0D%0A
-
     stat
@@ -1442,24 +1442,252 @@
 nsion();%0D%0A%0D%0A
+    @BeforeAll%0D%0A    static void setup() %7B%0D%0A        SeleniumJupiter.config().setDockerServerUrl(%22http://localhost:2375%22);%0D%0A    %7D%0D%0A%0D%0A    @AfterAll%0D%0A    static void teardown() %7B%0D%0A        SeleniumJupiter.config().reset();%0D%0A    %7D%0D%0A%0D%0A
     @Test%0D%0A 

Use Docker server URL in exec command in container test