2017-07-06 57 views
0

您好我已经编写了一个nodejs应用程序,其中包含一些用jasmine编写的测试。我正在尝试使用CLI获取在TFS中发布的测试结果。在执行量角器时找不到指定的路径

我已经安装了下列包

“茉莉花规格-记者”: “^ 4.1.1”, “茉莉花TFS-记者”: “^ 1.0.0”, “phantomjs,预建“: “^ 2.1.14”, “TS-节点”: “^ 3.2.0”

以下是protractor.conf

/*global jasmine */ 
var SpecReporter = require('jasmine-spec-reporter'); 
var TfsReporter = require('jasmine-tfs-reporter'); 

exports.config = { 
    allScriptsTimeout: 11000, 
    specs: [ 
    './src/tests/*spec.js' 
    ], 
    capabilities: { 
    'browserName': 'phantomjs', 
    'phantomjs.binary.path': require('phantomjs-prebuilt').path, 
    'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG'] 
    }, 
    directConnect: true, 
    baseUrl: 'http://localhost:4200/', 
    framework: 'jasmine', 
    jasmineNodeOpts: { 
    showColors: true, 
    defaultTimeoutInterval: 30000, 
    print: function() {} 
    }, 
    useAllAngular2AppRoots: false, 
    beforeLaunch: function() { 
    require('ts-node').register({ 
     project: 'PartyAndIndustryDataMigration' 
    }); 
    }, 
    onPrepare: function() { 
    jasmine.getEnv().addReporter(new SpecReporter()); 
    jasmine.getEnv().addReporter(new TfsReporter()); 
    } 
}; 

当我尝试并从命令提示执行量角器我得到错误 指定的路径没有存在PartyAndIndustryDataMigration

+0

你是通过tfs构建还是在本地执行?如果错误发生在本地,这个问题似乎与TFS无关。 –

+1

我想在本地运行。我现在通过了这个问题。有另一个问题 – Tom

回答

1

这是一个小小的修复。它必须纠正路径

useAllAngular2AppRoots: false, 
    beforeLaunch: function() { 
    require('ts-node').register({ 
     project: '../PartyAndIndustryDataMigration' 
    }); 
    },