简体   繁体   English

如何使用Eclipse调试量角器脚本?

[英]How to debug protractor script using Eclipse?

From command line, protractor is run by typing protractor conf.js which in turn runs the script. 从命令行开始,通过键入protractor conf.js来运行protractor conf.js ,后者又运行脚本。

My conf.js looks like this: 我的conf.js看起来像这样:

  exports.config = {
  directConnect: true,

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Framework to use. Jasmine is recommended.
  framework: 'jasmine',

  // Spec patterns are relative to the current working directory when
  // protractor is called.
  specs: ['animal_adoption_1.js'],

  // Options to be passed to Jasmine.
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

The error that I am getting is : 我得到的错误是:

js: "C:\\Users\\Shikhar\\AppData\\Roaming\\npm\\node_modules\\protractor\\ParamProc\\conf.js", line 2: uncaught JavaScript runtime exception: ReferenceError: "exports" is not defined. js:“C:\\ Users \\ Shikhar \\ AppData \\ Roaming \\ npm \\ node_modules \\ protractor \\ ParamProc \\ conf.js”,第2行:未捕获的JavaScript运行时异常:ReferenceError:未定义“exports”。 at C:\\Users\\Shikhar\\AppData\\Roaming\\npm\\node_modules\\protractor\\ParamProc\\conf.js:2 在C:\\ Users \\ Shikhar \\ AppData \\ Roaming \\ npm \\ node_modules \\ protractor \\ ParamProc \\ conf.js:2

I am using Eclipse Indigo as the IDE. 我使用Eclipse Indigo作为IDE。 Do I need to use Karma in order to do this or anything else? 我是否需要使用Karma来执行此操作或其他任何操作?

How are you running the tests inside of Eclipse? 你是如何在Eclipse中运行测试的? It looks like you are invoking node and passing conf.js as the script to run. 看起来您正在调用节点并将conf.js作为要运行的脚本传递。

Make sure that you are invoking protractor and passing conf.js to it. 确保您正在调用protractor并将conf.js传递给它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM