我正在尝试与Sauce Labs集成以运行我的项目的Protractor测试using CircleCI's guide as a basis。测试包含在Grunt任务中,该任务在我的机器上完美运行:
grunt.registerTask('test:protractor', [
'ngconstant:dev',
'modernizr:prod',
'sass',
'protractor'
]);
这是我的circle.yml文件:
dependencies:
pre:
- sudo apt-get update; sudo apt-get install ruby-sass
- npm install -g bower
- bower install
post:
- wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
- tar -xzf sc-latest-linux.tar.gz
test:
override:
- cd sc-*-linux && ./bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready:
background: true
# Wait for tunnel to be ready
- while [ ! -e ~/sauce_is_ready ]; do sleep 1; done
- grunt test:protractor
background: true
post:
- killall --wait sc # wait for Sauce Connect to close the tunnel
The Sauce Connect proxy clearly works according to build output:
30 May 18:18:46 - Started scproxy on port 35557.
30 May 18:18:46 - Please wait for 'you may start your tests' to start your tests.
30 May 18:19:03 - Provisioned tunnel:4b38b707d2174ebf9714f05cd8c06f79
30 May 18:19:03 - Using no proxy for connecting to tunnel VM.
30 May 18:19:03 - Starting Selenium listener...
30 May 18:19:03 - Establishing secure TLS connection to tunnel...
30 May 18:19:03 - Selenium listener started on port 4445.
30 May 18:19:04 - Sauce Connect is up, you may start your tests.
但在那时,它完全停滞不前。没有努力调用grunt测试:量角器,没有任何活动。 10分钟后,我杀死了这个版本。
通过Sauce Labs代理运行Protractor测试,我在此配置中缺少什么?
答案 0 :(得分:0)
也许你忘了安装grunt
dependencies:
pre:
- npm install -g grunt