Hi all,
I have following setup which works fine for my Django app local testing; however it failed when running through the pipeline.
docker-compose.yml (selenium-hub and chrome services)
selenium-hub: image: selenium/hub environment: GRID_TIMEOUT: 60 GRID_BROWSER_TIMEOUT: 60 ports: - 4444:4444 chrome: image: selenium/node-chrome-debug environment: HUB_HOST: selenium-hub HUB_PORT: 4444 SE_OPTS: -timeout 60 -browserTimeout 60 ports: - 5900:5900 depends_on: - selenium-hub
the test (the base class)
class BaseTestCase(StaticLiveServerTestCase): """ Provides base test class which connects to the Docker container running selenium. """ host = '0.0.0.0' # bind to allow external access
@classmethod def setUpClass(cls):
super().setUpClass() # Set host to externally accessible web server address cls.host = socket.gethostbyname(socket.gethostname()) cls.selenium = webdriver.Remote( command_executor='http://selenium-hub:4444/wd/hub', desired_capabilities=desired_capabilities.DesiredCapabilities.CHROME, ) cls.selenium.implicitly_wait(5)
@classmethod def tearDownClass(cls): cls.selenium.quit() super().tearDownClass()
bitbucket-pipelines.yml
image: quay.io/base-image:bionic
pipelines: default: - step: caches: - pip services: - postgres - selenium-hub - chrome script: - pip3 install -r requirements/test.txt - export DATABASE_URL="postgres://express:express@127.0.0.1:5432/express" - pytest expresswaysdefinitions: services: postgres: image: postgres:10.5 environment: POSTGRES_PASSWORD: express POSTGRES_USER: express POSTGRES_DB: express selenium-hub: image: selenium/hub environment: GRID_TIMEOUT: 60 GRID_BROWSER_TIMEOUT: 60 SE_OPTS: -host 127.0.0.1 chrome: image: selenium/node-chrome environment: HUB_PORT_4444_TCP_ADDR: localhost HUB_PORT_4444_TCP_PORT: 4444 SE_OPTS: -timeout 60 -browserTimeout 60
I don't know what else to do now as I have tried all possible solutions out there, but none working so far. Appreciate any help!