I'm trying to set up Selenium testing for my node.js app with drone.io
following this example: http://docs.drone.io/selenium-example/.
My .drone.yml
looks like this:
pipeline:
test:
image: node:latest
commands:
- yarn install
- yarn build
- yarn start
- yarn test
services:
selenium:
image: selenium/standalone-chrome
And I'm using selenium-webdriver like this:
const driver = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
.usingServer(`http://selenium:4444/wd/hub`)
.build();
describe('Home page', () => {
before(async () => await driver.get(`http://127.0.0.1:8080`)); // FIXME
it('should render greeting', async () => {
const src = await driver.getPageSource();
chai.expect(src).contains('Hey there!');
});
after(async () => await driver.quit());
});
Now, the problem is that Selenium doesn't know URI the app running at (obviously, http://127.0.0.1:8080
doesn't work since it's the different container). Is there a way to specify the hostname of the container running the pipeline in drone? Or to make the main container accessible from services in some other way?
Thanks.