【发布时间】:2023-03-12 15:25:01
【问题描述】:
我想在 Travis 中运行完整的 Selenium 测试,但我似乎无法启动服务器。
我的 Travis YAML 文件
language: node_js
node_js:
- "6.2"
before_script:
- npm install selenium-standalone@latest -g
- selenium-standalone install
- npm install -g gulp
- nohup selenium-standalone start > selenium.txt 2>&1 </dev/null &
script:
- npm test
- gulp
npm test 运行时,结果为:
Error retrieving a new session from the selenium server
Error: connect ECONNREFUSED 127.0.0.1:4444
at Object.exports._errnoException (util.js:1007:11)
at exports._exceptionWithHostPort (util.js:1030:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
Connection refused! Is selenium server started?
npm ERR! Test failed. See above for more details.
【问题讨论】:
-
你想在本地运行它吗?服务器在哪里启动?
-
嗨@nullpointer,
nohup selenium-standalone start在 Travis 容器中启动服务器。