@@ -45,13 +45,14 @@ class BrowserWebDriverContainer(DockerContainer):
45
45
You can easily change browser by passing :code:`DesiredCapabilities.FIREFOX` instead.
46
46
"""
47
47
48
- def __init__ (self , capabilities : str , image : Optional [str ] = None , ** kwargs ) -> None :
48
+ def __init__ (self , capabilities : str , image : Optional [str ] = None , port : int = 4444 ,
49
+ vnc_port : int = 5900 , ** kwargs ) -> None :
49
50
self .capabilities = capabilities
50
51
self .image = image or get_image_name (capabilities )
51
- self .port_to_expose = 4444
52
- self .vnc_port_to_expose = 5900
52
+ self .port = port
53
+ self .vnc_port = vnc_port
53
54
super (BrowserWebDriverContainer , self ).__init__ (image = self .image , ** kwargs )
54
- self .with_exposed_ports (self .port_to_expose , self .vnc_port_to_expose )
55
+ self .with_exposed_ports (self .port , self .vnc_port )
55
56
56
57
def _configure (self ) -> None :
57
58
self .with_env ("no_proxy" , "localhost" )
@@ -68,5 +69,5 @@ def get_driver(self) -> webdriver.Remote:
68
69
69
70
def get_connection_url (self ) -> str :
70
71
ip = self .get_container_host_ip ()
71
- port = self .get_exposed_port (self .port_to_expose )
72
+ port = self .get_exposed_port (self .port )
72
73
return f'http://{ ip } :{ port } /wd/hub'
0 commit comments