@@ -0,0 +1,3362 @@
+/*%0A * (C) Copyright 2018 Boni Garcia (http://bonigarcia.github.io/)%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A */%0Apackage io.github.bonigarcia.test.docker;%0A%0Aimport static io.github.bonigarcia.BrowserType.CHROME;%0Aimport static io.github.bonigarcia.BrowserType.FIREFOX;%0Aimport static java.lang.System.clearProperty;%0Aimport static java.lang.System.setProperty;%0Aimport static java.lang.invoke.MethodHandles.lookup;%0Aimport static java.util.concurrent.Executors.newFixedThreadPool;%0Aimport static java.util.concurrent.TimeUnit.SECONDS;%0Aimport static org.hamcrest.CoreMatchers.containsString;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.slf4j.LoggerFactory.getLogger;%0A%0Aimport java.util.List;%0Aimport java.util.concurrent.CountDownLatch;%0Aimport java.util.concurrent.ExecutorService;%0A%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.ExtendWith;%0Aimport org.openqa.selenium.remote.RemoteWebDriver;%0Aimport org.slf4j.Logger;%0A%0Aimport io.github.bonigarcia.DockerBrowser;%0Aimport io.github.bonigarcia.SeleniumExtension;%0A%0A@ExtendWith(SeleniumExtension.class)%0Apublic class MixedDockerChromeJupiterTest %7B%0A%0A    static final int NUM_BROWSERS = 3;%0A%0A    final Logger log = getLogger(lookup().lookupClass());%0A%0A    @BeforeEach%0A    void setup() %7B%0A        setProperty(%22sel.jup.vnc%22, %22true%22);%0A    %7D%0A%0A    @AfterEach%0A    void teardown() %7B%0A        clearProperty(%22sel.jup.vnc%22);%0A    %7D%0A%0A    @Test%0A    public void testMixed(@DockerBrowser(type = CHROME) RemoteWebDriver chrome,%0A            @DockerBrowser(type = CHROME, size = NUM_BROWSERS) List%3CRemoteWebDriver%3E driverList,%0A            @DockerBrowser(type = FIREFOX) RemoteWebDriver firefox)%0A            throws InterruptedException %7B%0A%0A        ExecutorService executorService = newFixedThreadPool(NUM_BROWSERS + 2);%0A        CountDownLatch latch = new CountDownLatch(NUM_BROWSERS + 2);%0A%0A        driverList.forEach((driver) -%3E %7B%0A            exercise(executorService, latch, driver);%0A        %7D);%0A        exercise(executorService, latch, chrome);%0A        exercise(executorService, latch, firefox);%0A%0A        latch.await(50, SECONDS);%0A%0A        // Thread.sleep(30000);%0A%0A        executorService.shutdown();%0A    %7D%0A%0A    private void exercise(ExecutorService executorService, CountDownLatch latch,%0A            RemoteWebDriver driver) %7B%0A        executorService.submit(() -%3E %7B%0A            try %7B%0A                log.info(%22Session id %7B%7D%22,%0A                        ((RemoteWebDriver) driver).getSessionId());%0A                driver.get(%22https://bonigarcia.github.io/selenium-jupiter/%22);%0A                assertThat(driver.getTitle(), containsString(%0A                        %22A JUnit 5 extension for Selenium WebDriver%22));%0A            %7D finally %7B%0A                latch.countDown();%0A            %7D%0A        %7D);%0A    %7D%0A%0A%7D%0A

Create new test with mixed Docker browsers