For development I want to run my tests locally and selenium using selenium hub.
hub:
image: selenium/hub
environment:
GRID_BROWSER_TIMEOUT: '300'
ports:
- "4444:4444"
firefox_node_1:
image: selenium/node-firefox-debug
depends_on:
- hub
environment:
HUB_HOST: hub
ports:
- "5900:5900"
In my test I use:
class SimpleTestCase(StaticLiveServerTestCase):
def setUp(self):
super(SimpleTestCase, self).setUp()
self.browser = webdriver.Remote(command_executor=f'http://localhost:4444/wd/hub',
desired_capabilities=DesiredCapabilities.FIREFOX)
def tearDown(self):
self.browser.quit()
super(SimpleTestCase, self).tearDown()
def test_mainpage(self):
self.browser.get(self.live_server_url)
But in this case I get network error because firefox
node do not see my localhost
pc
I tried to set host to 0.0.0.0
class SimpleTestCase(StaticLiveServerTestCase):
host = '0.0.0.0'
And of course container do not see my pc, is there a way to do this without dockerize my Django app