我正在尝试使用Aurelia项目的量角器进行E2E测试。 this is my protactor.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观看时,它会在浏览器中运行该项目,当我Fyn Gulp E2e时,它给出以下错误
events.js:160 投掷er;//未经处理的"错误"事件 ^
Error: spawn C:Automated_TestingVetserve.WebsrcVetserve.Web.Apptsnode_modu
es.binprotractor.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)
有人可以帮助我这个
我找到了原因,它与aurelia,node或npm无关。我错误地更新了环境变量" comspec",而不是路径这个变量" comspec"只能保持一条路径,这是所有量角错误的真实问题