Protractor 使用带有Aurelia的量角器会产生误差

Protractor 使用带有Aurelia的量角器会产生误差,protractor,aurelia,enoent,Protractor,Aurelia,Enoent,我正在尝试为aurelia项目使用量角器进行e2e测试。 这是我的proactor.conf.js exports.config = { directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome' }, //seleniumAddress: 'http://0.0.0.0:4444', /

我正在尝试为aurelia项目使用量角器进行e2e测试。
这是我的proactor.conf.js

exports.config = {
  directConnect: true,

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

  //seleniumAddress: 'http://0.0.0.0:4444',
  // add proper version number
  seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar',
  specs: ['test/e2e/dist/**/*.ts'],

  plugins: [{
    path: 'aurelia.protractor.js'
  }],


  // Options to be passed to Jasmine-node.
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000
  }
};
这是demo.spec.ts

import {PageObject_Welcome} from './welcome.po';
import {PageObject_Skeleton} from './skeleton.po';

describe('aurelia skeleton app', function() {
  let po_welcome: PageObject_Welcome;
  let po_skeleton: PageObject_Skeleton;

  beforeEach( () => {
    po_skeleton = new PageObject_Skeleton();
    po_welcome = new PageObject_Welcome();

    browser.loadAndWaitForAureliaPage("http://localhost:9000");
  });

  it('should load the page and display the initial page title', () => {
    expect(po_skeleton.getCurrentPageTitle()).toBe('Welcome | Aurelia');
  });

  it('should display greeting', () => {
    expect(po_welcome.getGreeting()).toBe('Welcome to the Aurelia Navigation App!');
  });

  it('should automatically write down the fullname', () => {
    po_welcome.setFirstname('Rob');
    po_welcome.setLastname('Eisenberg');

    // For now there is a timing issue with the binding.
    // Until resolved we will use a short sleep to overcome the issue.
    browser.sleep(200);
    expect(po_welcome.getFullname()).toBe('ROB EISENBERG');
  });

  it('should show alert message when clicking submit button', () => {
    expect(po_welcome.openAlertDialog()).toBe(true);
  });

  it('should navigate to users page', () => {
    po_skeleton.navigateTo('#/users');
    expect(po_skeleton.getCurrentPageTitle()).toBe('Github Users | Aurelia');
  });
});
当我运行gulp watch时,它会在浏览器中运行项目,当我运行gulp e2e时, 它给出了以下错误

events.js:160 投掷者;//未处理的“错误”事件 ^


有人能帮我解决这个问题吗?

我已经找到了原因,它与aurelia、node或npm无关。我错误地更新了环境变量“comSpec”,而不是PATH
这个变量“comSpec”只能保存一条路径,这是所有量角器错误的真正问题

您得到的错误是文件
C:\Automated\u Testing\Vetserve.Web\src\Vetserve.Web.Appts\node\u modu es\.bin\dragrator.cmd不存在。它存在吗?是的,它存在there@thebluefox我删除了一些at标记,因为如果存在“%~dp0\node.exe”(“%~dp0\node.exe”“%~dp0\..\dragrator\bin\dragrator”%*)或其他(SETLOCAL SET pathText=%pathText:;.JS;=;%node“%~dp0\..\dragrator\bin\dragrator”%*)则不允许发布注释
Error: spawn C:\Automated_Testing\Vetserve.Web\src\Vetserve.Web.Appts\node_modu
es\.bin\protractor.cmd ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)