如何在 docker 容器中 运行 量角器端到端测试?
How to run protractor end to end tests in docker container?
我是 docker container.I 的初学者,刚开始在 docker 容器中进行 运行 量角器端到端测试。我的应用程序在 angular 2 打字稿中。我试图找出如何配置 docker 并从 docker 集线器 https://hub.docker.com/r/caltha/protractor/ 中找到图像并将该图像下载到我的虚拟机中。我使用了这个命令并让我的测试位置 folder.The 容器自动终止。我没有看到生成任何输出目录或没有执行任何结束测试。
docker pull caltha/protractor
docker run --rm -v /home/ubuntu/git/Test/dashboard/test:/project
caltha/protractor
//protractor.conf.js
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['test/e2e/menu.js'],
capabilities: {
'browserName': 'firefox',
},
baseUrl: 'http://localhost:8080/dashboard/#/',
jasmineNodeOpts: {
showColors: true,
},
}
您是否尝试按照网站上的说明搜索输出文件?
The output of supervisord visible on the console is not interesting in most circumstances. You should check target/supervsor.out file to see the output of Protractor. Dispalying the file in an Unix terminal using cat is recommended over opening it using an editor because the file contains ANSI escape sequences.
您也可以让 docker 打开以进行测试,而不是在执行命令时打开和关闭。这样您就可以在控制台中看到实际的错误。
尝试:
CONTAINER=$(docker run -d -v /home/ubuntu/git/Test/dashboard/test:/project --env MANUAL=yes caltha/protractor)
docker exec -ti $CONTAINER sudo -i -u node bash
编辑:
使用以下命令,您应该在终端中打开包含您的项目的 docker 容器:
docker run -it --rm -v /home/ubuntu/git/Test/dashboard/test:/project --privileged caltha/protractor bash
然后你只需要像在本地一样运行量角器
protractor protractor.conf.js
(如果量角器已经暴露在路径中,这应该可以工作。如果没有写评论)
我是 docker container.I 的初学者,刚开始在 docker 容器中进行 运行 量角器端到端测试。我的应用程序在 angular 2 打字稿中。我试图找出如何配置 docker 并从 docker 集线器 https://hub.docker.com/r/caltha/protractor/ 中找到图像并将该图像下载到我的虚拟机中。我使用了这个命令并让我的测试位置 folder.The 容器自动终止。我没有看到生成任何输出目录或没有执行任何结束测试。
docker pull caltha/protractor
docker run --rm -v /home/ubuntu/git/Test/dashboard/test:/project caltha/protractor
//protractor.conf.js
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['test/e2e/menu.js'],
capabilities: {
'browserName': 'firefox',
},
baseUrl: 'http://localhost:8080/dashboard/#/',
jasmineNodeOpts: {
showColors: true,
},
}
您是否尝试按照网站上的说明搜索输出文件?
The output of supervisord visible on the console is not interesting in most circumstances. You should check target/supervsor.out file to see the output of Protractor. Dispalying the file in an Unix terminal using cat is recommended over opening it using an editor because the file contains ANSI escape sequences.
您也可以让 docker 打开以进行测试,而不是在执行命令时打开和关闭。这样您就可以在控制台中看到实际的错误。 尝试:
CONTAINER=$(docker run -d -v /home/ubuntu/git/Test/dashboard/test:/project --env MANUAL=yes caltha/protractor)
docker exec -ti $CONTAINER sudo -i -u node bash
编辑:
使用以下命令,您应该在终端中打开包含您的项目的 docker 容器:
docker run -it --rm -v /home/ubuntu/git/Test/dashboard/test:/project --privileged caltha/protractor bash
然后你只需要像在本地一样运行量角器
protractor protractor.conf.js
(如果量角器已经暴露在路径中,这应该可以工作。如果没有写评论)