@@ -0,0 +1,2127 @@
+/*%0A * (C) Copyright 2022 Boni Garcia (https://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.wdm.test.watcher;%0A%0A//tag::snippet-in-doc%5B%5D%0Aimport static java.lang.invoke.MethodHandles.lookup;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport static org.slf4j.LoggerFactory.getLogger;%0A%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.openqa.selenium.WebDriver;%0Aimport org.slf4j.Logger;%0A%0Aimport io.github.bonigarcia.wdm.WebDriverManager;%0A%0Aclass DockerGatherLogsChromeTest %7B%0A%0A    static final Logger log = getLogger(lookup().lookupClass());%0A%0A    WebDriverManager wdm = WebDriverManager.edgedriver().browserInDocker()%0A            .watch();%0A    WebDriver driver;%0A%0A    @BeforeEach%0A    void setup() %7B%0A        driver = wdm.create();%0A    %7D%0A%0A    @AfterEach%0A    void teardown() %7B%0A        driver.quit();%0A    %7D%0A%0A    @Test%0A    void test() %7B%0A        driver.get(%0A                %22https://bonigarcia.dev/selenium-webdriver-java/console-logs.html%22);%0A%0A        List%3CMap%3CString, Object%3E%3E logMessages = wdm.getLogs();%0A%0A        for (Map%3CString, Object%3E map : logMessages) %7B%0A            log.debug(%22%5B%7B%7D%5D %5B%7B%7D.%7B%7D%5D %7B%7D%22, map.get(%22datetime%22),%0A                    map.get(%22wrapper%22).toString().toUpperCase(),%0A                    String.format(%22%251$-7s%22,%0A                            map.get(%22type%22).toString().toUpperCase()),%0A                    map.get(%22message%22));%0A        %7D%0A%0A        assertThat(logMessages).hasSize(5);%0A    %7D%0A%0A%7D%0A//end::snippet-in-doc%5B%5D%0A

Include test for gathering logs using Chrome in Docker