The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Selenium failed when running pipeline

Ashraf Anwar
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 18, 2019

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!

 

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events