我正在尝试用drone.io为我的drone.io应用程序设置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我像这样使用硒网驱动程序:
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不工作,因为它是不同的容器)。是否有一种方法可以指定在无人机中运行管道的容器的主机名?还是以其他方式使主容器可以从服务中访问?
谢谢。
发布于 2017-05-17 11:48:17
您需要下载drone/drone:latest,以确保您拥有最新的修补程序集(或将来阅读此版本的人的drone/drone:0.7或更高版本)。
在示例中使用yaml (复制如下),selenium将能够在http://test:8080上访问节点应用程序,其中test是管道步骤的名称和网络主机名。
pipeline:
test:
image: node:latest
commands:
- yarn install
- yarn build
- yarn start
- yarn test
services:
selenium:
image: selenium/standalone-chrome另一个技巧是确保yarn start是非阻塞的,并且不阻塞shell会话。有关更多细节,请参见http://veithen.github.io/2014/11/16/sigterm-propagation.html。
希望这能有所帮助!
https://stackoverflow.com/questions/43986957
复制相似问题