drone.io
我正在尝试使用以下示例为我的 node.js 应用程序设置 Selenium 测试:http: //docs.drone.io/selenium-example/。
我的.drone.yml
样子是这样的:
pipeline:
test:
image: node:latest
commands:
- yarn install
- yarn build
- yarn start
- yarn test
services:
selenium:
image: selenium/standalone-chrome
我正在像这样使用selenium-webdriver:
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());
});
现在,问题是 Selenium 不知道应用程序运行的 URI(显然,http://127.0.0.1:8080
因为它是不同的容器,所以不起作用)。有没有办法指定在无人机中运行管道的容器的主机名?或者以其他方式使服务可以访问主容器?
谢谢。