我是Docker的新手,但不是E2E量角器.我正在尝试用docker容器构建E2E集成.
继Angular’s protractor cookbook using Docker之后
他们有Step 2 – Starting Selenium Nodes
docker run -d –link selenium-hub:hub selenium / node-chrome:latest
我了解Selnium Grid的功能 – 它允许通过与网格通信来测试不同类型的浏览器.
当我有这个运行Proteror的docker容器不使用它作为chrome二进制文件时我得到WebDriverError:未知错误:找不到Chrome二进制文件.
如何使量角器使用此节点铬容器而不是本地chrome二进制文件?
我的量角器配置:
exports.config = {
framework: 'mocha',directConnect: true,seleniumAddress: 'http://localhost:4444/wd/hub',// I have this set to the grid docker container from Angular cookbook
specs: ['./stories/*.js'],onPrepare: function() {
expect = require("chai").use(require("chai-as-promised")).expect;
},mochaOpts: {
enableTimeouts: false,reporter: "spec",slow: 7000
},capabilities: {
browserName: 'chrome'
}
}
这就是我在无头服务器(非docker)上运行量角器的方法xvfb-run node_modules / protractor / bin / protractor e2e / protractor.conf.js
来自docs:
directConnect: true – Your test script communicates directly Chrome Driver or Firefox Driver,bypassing any Selenium Server. If this is true,settings for seleniumAddress and seleniumServerJar will be ignored. If you attempt to use a browser other than Chrome or Firefox an error will be thrown