File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,8 +49,7 @@ class BrowserWebDriverContainer(DockerContainer):
4949 """
5050 def __init__ (self , capabilities , image = None ):
5151 self .capabilities = capabilities
52- if not image :
53- self .image = get_image_name (capabilities )
52+ self .image = image or get_image_name (capabilities )
5453 self .port_to_expose = 4444
5554 self .vnc_port_to_expose = 5900
5655 super (BrowserWebDriverContainer , self ).__init__ (image = self .image )
Original file line number Diff line number Diff line change 1+
2+ def test_selenium_custom_image ():
3+ from testcontainers .selenium import BrowserWebDriverContainer
4+ from selenium .webdriver import DesiredCapabilities
5+
6+ image = "selenium/standalone-chrome:latest"
7+ chrome = BrowserWebDriverContainer (DesiredCapabilities .CHROME , image = image )
8+ assert "image" in dir (chrome ), "`image` attribute was not instantialized."
9+ assert chrome .image == image , "`image` attribute was not set to the user provided value"
You can’t perform that action at this time.
0 commit comments