Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Can';t在Teamcity上通过Grunt运行量角器测试,而可以在本地运行_Javascript_Angularjs_Gruntjs_Protractor_Teamcity - Fatal编程技术网

Javascript Can';t在Teamcity上通过Grunt运行量角器测试,而可以在本地运行

Javascript Can';t在Teamcity上通过Grunt运行量角器测试,而可以在本地运行,javascript,angularjs,gruntjs,protractor,teamcity,Javascript,Angularjs,Gruntjs,Protractor,Teamcity,我正试图使用grunt命令在TeamCity上运行我的测试构建,但它抛出了一个错误。奇怪的是,当我在终端本地(而不是在Teamcity代理上)编写grunt命令时,一切正常。我有这样的输入: 但当我试图通过TeamCity来执行它时。。。 我有这个: Grunfile.js: conf.js: 花了一整天的时间在谷歌上搜索,但仍然不知道为什么所有的搜索都在本地有效,而在TC上却没有。也许是因为我在使用Grunt和TeamCity(仅一周?:)我不知道。任何帮助都将不胜感激。 编辑 忘记告诉TC版

我正试图使用
grunt
命令在TeamCity上运行我的
测试构建
,但它抛出了一个错误。奇怪的是,当我在终端本地(而不是在Teamcity代理上)编写
grunt
命令时,一切正常。我有这样的输入:

但当我试图通过TeamCity来执行它时。。。 我有这个:

Grunfile.js:

conf.js:

花了一整天的时间在谷歌上搜索,但仍然不知道为什么所有的搜索都在本地有效,而在TC上却没有。也许是因为我在使用Grunt和TeamCity(仅一周?:)我不知道。任何帮助都将不胜感激。
编辑
忘记告诉TC版本-TeamCity Professional 9.1.7

仍然不知道如何解决这个问题,已经陷入绝望:)试图将数据从量角器重写为Karma,但据我所知,它只用于单元测试,而我需要E2E(模拟用户点击、填写表单等).

非常类似的症状:。@alecxe是的,但是他的解决方案对我不起作用。寻找可能性…你是否可能按照另一篇文章的指示,但作为你自己而不是运行TeamCity的用户(因此可能清除了另一个缓存位置)?@dcbyers在那篇文章中的解决方案是更新nodejs。正如我在我的电脑和TC node上的帖子中提到的,最新的症状非常相似:。@alecxe是的,但他的解决方案对我不起作用。寻找可能性……是否可能是你按照另一篇帖子的指示,但作为你自己而不是运行TeamCity的用户(因此可能清除了不同的缓存位置)?该帖子中的@dcbyers解决方案是更新nodejs。正如我在我的电脑和TC节点上的帖子中提到的,它是最新的
impregnable@linux-dev-ort:~/dev/captcha-dev$ grunt
Running "jshint:files" (jshint) task
>> 3 files lint free.

Running "protractor:singlerun" (protractor) task
[19:08:51] I/local - Starting selenium standalone server...
[19:08:51] I/launcher - Running 1 instances of WebDriver
[19:08:52] I/local - Selenium standalone server started at http://192.168.1.117:55627/wd/hub
Started
........

8 specs, 0 failures
Finished in 19.148 seconds
[19:09:12] I/local - Shutting down selenium standalone server.
[19:09:12] I/launcher - 0 instance(s) of WebDriver still running
[19:09:12] I/launcher - chrome #01 passed

Done.
Step 1/1: Run captcha tests via Protractor (Command Line)
[18:25:21][Step 1/1] Starting: /var/buildAgent/temp/agentTmp/custom_script2979762391918001494
[18:25:21][Step 1/1] in directory: /var/buildAgent/work/bc9e47ac95c1cdb2
[18:25:22][Step 1/1] Running "jshint:files" (jshint) task
[18:25:22][Step 1/1] >> 3 files lint free.
[18:25:22][Step 1/1] 
[18:25:22][Step 1/1] Running "protractor:singlerun" (protractor) task
[18:25:22][Step 1/1] 
[18:25:22][Step 1/1] /var/buildAgent/work/bc9e47ac95c1cdb2/captcha-dev/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/index.js:25
[18:25:22][Step 1/1] const builder = require('./builder');
[18:25:22][Step 1/1] ^^^^^
[18:25:22][Step 1/1] SyntaxError: Use of const in strict mode.
[18:25:22][Step 1/1]     at Module._compile (module.js:439:25)
[18:25:22][Step 1/1]     at Object.Module._extensions..js (module.js:474:10)
[18:25:22][Step 1/1]     at Module.load (module.js:356:32)
[18:25:22][Step 1/1]     at Function.Module._load (module.js:312:12)
[18:25:22][Step 1/1]     at Module.require (module.js:364:17)
[18:25:22][Step 1/1]     at require (module.js:380:17)
[18:25:22][Step 1/1]     at Object.<anonymous> (/var/buildAgent/work/bc9e47ac95c1cdb2/captcha-dev/node_modules/grunt-protractor-runner/node_modules/protractor/built/driverProviders/driverProvider.js:8:17)
[18:25:22][Step 1/1]     at Module._compile (module.js:456:26)
[18:25:22][Step 1/1]     at Object.Module._extensions..js (module.js:474:10)
[18:25:22][Step 1/1]     at Module.load (module.js:356:32)
[18:25:22][Step 1/1] >> /var/buildAgent/work/bc9e47ac95c1cdb2/captcha-dev/node_modules/grunt-protractor-runner/node_modules/protractor/node_modules/selenium-webdriver/index.js:25
[18:25:22][Step 1/1] >> const builder = require('./builder');
[18:25:22][Step 1/1] >> ^^^^^
[18:25:22][Step 1/1] >> SyntaxError: Use of const in strict mode.
[18:25:22][Step 1/1] >>     at Module._compile (module.js:439:25)
[18:25:22][Step 1/1] >>     at Object.Module._extensions..js (module.js:474:10)
[18:25:22][Step 1/1] >>     at Module.load (module.js:356:32)
[18:25:22][Step 1/1] >>     at Function.Module._load (module.js:312:12)
[18:25:22][Step 1/1] >>     at Module.require (module.js:364:17)
[18:25:22][Step 1/1] >>     at require (module.js:380:17)
[18:25:22][Step 1/1] >>     at Object.<anonymous> (/var/buildAgent/work/bc9e47ac95c1cdb2/captcha-dev/node_modules/grunt-protractor-runner/node_modules/protractor/built/driverProviders/driverProvider.js:8:17)
[18:25:22][Step 1/1] >>     at Module._compile (module.js:456:26)
[18:25:22][Step 1/1] >>     at Object.Module._extensions..js (module.js:474:10)
[18:25:22][Step 1/1] >>     at Module.load (module.js:356:32)
[18:25:22][Step 1/1] Warning: Tests failed, protractor exited with code: 8  Use --force to continue.
[18:25:22][Step 1/1] 
[18:25:22][Step 1/1] Aborted due to warnings.
[18:25:22][Step 1/1] Process exited with code 8
[18:25:22][Step 1/1] Step Run captcha tests via Protractor (Command Line) failed
node v6.2.2
npm v3.9.5
protractor 4.0.0
module.exports = function(grunt) {

grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    jshint: {
        files: ['Gruntfile.js', 'Client/Test_E2E/*.js'],
        options: {
            // options here to override JSHint defaults
            globals: {
                jQuery: true,
                console: true,
                module: true,
                document: true
            },
            loopfunc:true
        }
    },
    protractor: {
        options: {
            keepAlive: true,
            configFile: "Client/Test_E2E/conf.js"
        },
        singlerun: {},
        auto: {
            keepAlive: true,
            options: {
                args: {
                    directConnect: true
                    // seleniumServerJar: 'node_modules/grunt-protractor-runner/node_modules/protractor/selenium/selenium-server-standalone-2.52.0.jar'
                }
            }
        }

    }

});

grunt.loadNpmTasks('grunt-contrib-jshint');

grunt.loadNpmTasks('grunt-protractor-runner');

grunt.registerTask('default', ['jshint', 'protractor:singlerun']);
};
exports.config = {
 allScriptsTimeout: 11000,

 specs: [
   'test.js'
 ],

 capabilities: {
   'browserName': 'chrome'
 },

 baseUrl: 'http://localhost:55555/',

 framework: 'jasmine',

 jasmineNodeOpts: {
   defaultTimeoutInterval: 30000
 },

   onPrepare: function() {
       var jasmineReporters = require('jasmine-reporters');
       jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
           consolidateAll: true,
           savePath: 'testresults',
           filePrefix: 'xmloutput'
       }));
   }
};