2626import org .openqa .selenium .OutputType ;
2727import org .openqa .selenium .chrome .ChromeOptions ;
2828import org .slf4j .bridge .SLF4JBridgeHandler ;
29- import org .testcontainers .containers .BrowserWebDriverContainer ;
3029import org .testcontainers .utility .MountableFile ;
3130
3231import software .xdev .chartjs .model .charts .Chart ;
33- import software .xdev .chartjs .model .container .SimpleBrowserWebDriverContainer ;
32+ import software .xdev .chartjs .model .container .SeleniumBrowserWebDriverContainer ;
33+ import software .xdev .testcontainers .selenium .containers .browser .BrowserWebDriverContainer ;
3434
3535
3636public abstract class AbstractChartTest
@@ -43,36 +43,34 @@ public abstract class AbstractChartTest
4343 protected static final String CONTAINER_TEST_TEMPLATE_HTML_FILE = "/home/user/" + TEST_TEMPLATE_HTML_FILE ;
4444
4545 // One Container is started once and only the rendered HTML is changed. Improves performance.
46- protected static final SimpleBrowserWebDriverContainer WEB_CONTAINER = createBrowserWithTempDirectoryMounted ();
46+ protected static final SeleniumBrowserWebDriverContainer WEB_CONTAINER = createBrowserWithTempDirectoryMounted ();
4747
48- private static SimpleBrowserWebDriverContainer createBrowserWithTempDirectoryMounted ()
48+ private static SeleniumBrowserWebDriverContainer createBrowserWithTempDirectoryMounted ()
4949 {
5050 if (!SLF4JBridgeHandler .isInstalled ())
5151 {
5252 SLF4JBridgeHandler .removeHandlersForRootLogger ();
5353 SLF4JBridgeHandler .install ();
5454 }
5555
56- final SimpleBrowserWebDriverContainer browserContainer = new SimpleBrowserWebDriverContainer ()
57- .withRecordingMode (
58- BrowserWebDriverContainer .VncRecordingMode .SKIP ,
59- null )
60- .withCapabilities (new ChromeOptions ())
61- .withCopyFileToContainer (
62- MountableFile .forClasspathResource ("/" + TEST_TEMPLATE_HTML_FILE ),
63- CONTAINER_TEST_TEMPLATE_HTML_FILE );
56+ final SeleniumBrowserWebDriverContainer browserContainer =
57+ new SeleniumBrowserWebDriverContainer (new ChromeOptions ())
58+ .withRecordingMode (BrowserWebDriverContainer .RecordingMode .SKIP )
59+ .withCopyFileToContainer (
60+ MountableFile .forClasspathResource ("/" + TEST_TEMPLATE_HTML_FILE ),
61+ CONTAINER_TEST_TEMPLATE_HTML_FILE );
6462 browserContainer .start ();
6563 return browserContainer ;
6664 }
6765
68- protected SimpleBrowserWebDriverContainer getWebContainer ()
66+ protected SeleniumBrowserWebDriverContainer getWebContainer ()
6967 {
7068 return WEB_CONTAINER ;
7169 }
7270
7371 protected void createScreenshotAndCompare (
7472 final Chart <?, ?, ?> chart ,
75- final SimpleBrowserWebDriverContainer browserContainer ,
73+ final SeleniumBrowserWebDriverContainer browserContainer ,
7674 final String screenshotReference )
7775 {
7876 try
@@ -93,7 +91,7 @@ protected void createScreenshotAndCompare(
9391 }
9492
9593 protected void assertCurrentBrowserViewEqualsScreenshot (
96- final SimpleBrowserWebDriverContainer browserContainer ,
94+ final SeleniumBrowserWebDriverContainer browserContainer ,
9795 final String screenshotReference ) throws IOException
9896 {
9997 final byte [] actual = browserContainer .webDriver ().getScreenshotAs (OutputType .BYTES );
0 commit comments