我有测试用例
/home/name/Develop/myproject/gateway
路径。我使用gulp protractor qa
命令运行测试而没有任何错误此路径。
我安装jenkins并安排了一份工作。只是名称,描述和shell命令。这是用于构建的shell命令:
cd /home/name/Develop/myproject/gateway && gulp protractor qa
当我尝试运行此jenkins作业时,我在jenkins作业控制台输出上收到此错误:
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/deneme2
[deneme2] $ /bin/sh -xe /tmp/hudson4619805372336742976.sh
+ cd /home/name/Develop/myproject/gateway
+ gulp protractor qa
[14:02:54] Using gulpfile /home/name/Develop/myproject/gateway/gulpfile.js
[14:02:54] Starting 'protractor'...
[14:02:54] Starting 'qa'...
[14:02:54] Finished 'qa' after 93 μs
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/atoms/error.js:108
var template = new Error(this.message);
^
UnknownError: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e),platform=Linux 4.4.0-47- generic x86_64)
at new bot.Error (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/atoms/error.js:108:18)
at Object.bot.response.checkResponse (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/atoms/response.js:109:9)
at /home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:160:24
at [object Object].promise.Promise.goog.defineClass.invokeCallback_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:1337:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_.execute_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2776:14)
at [object Object].promise.ControlFlow.goog.defineClass.goog.defineClass.abort_.error.executeNext_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/../webdriver/promise.js:2758:21)
at goog.async.run.processWorkQueue (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/goog/async/run.js:124:15)
at process._tickCallback (node.js:368:9)
From: Task: WebDriver.createSession()
at Function.webdriver.WebDriver.acquireSession_ (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)
at Function.webdriver.WebDriver.createSession (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)
at new Driver (/home/name/Develop/myproject/gateway/node_modules/selenium-webdriver/chrome.js:810:36)
at [object Object].DirectDriverProvider.getNewDriver (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/driverProviders/direct.js:68:16)
at [object Object].Runner.createBrowser (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:186:37)
at /home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/protractor/lib/runner.js:276:21
at _fulfilled (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:797:54)
at self.promiseDispatch.done (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:826:30)
at Promise.promise.promiseDispatch (/home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:759:13)
at /home/name/Develop/myproject/gateway/node_modules/gulp-protractor/node_modules/q/q.js:525:49
[launcher] Process exited with error code 1
[14:03:55] gulp-notify: [JHipster Gulp Build] Error: protractor exited with code 1
[14:03:55] Finished 'protractor' after 1 min
[14:03:55] E2E Tests failed
Build step 'Execute shell' marked build as failure
Finished: FAILURE
我搜索过但我无法找到任何解决方案。哪里错了?
感谢您的回答。
答案 0 :(得分:0)
我会写评论,但我不允许xD
这可能是权利问题。 Jenkins可能没有权利访问gulp或量角器的全局安装。
尝试这样的事情:./node_modules/gulp/gulp.js protractor qa