我收到以下错误:
>失败:未知错误:角度未定义
这仅在使用角度特定选择器(如“by.model”)时发生.但是“by.css”等选择器可以正常工作.这是一个Angular 2应用程序
测试
it('should set focus',() => { //This works //var input = element(by.css('myclass')); //This fails var input = element(by.model('config.value')); input.clear(); input.sendKeys('test'); input.sendKeys(Key.TAB); input.click(); var highlightedText = browser.executeScript(function getSelectionText() { return window.getSelection().toString(); }); expect(highlightedText).toEqual('test'); }); exports.config = { baseUrl: 'http://localhost:5555',specs: [ 'dist/dev/**/*.e2e.js' ],exclude: [],framework: 'jasmine2',allScriptsTimeout: 110000,jasmineNodeOpts: { showTiming: true,showColors: true,isVerbose: false,includeStackTrace: false,defaultTimeoutInterval: 400000 },directConnect: true,capabilities: { 'browserName': 'chrome' },onPrepare: function() { var SpecReporter = require('jasmine-spec-reporter'); jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: true})); browser.ignoreSynchronization = false; },useAllAngular2AppRoots: true };
铬= 49.0.2623.87
chromedriver = 2.9.248315
platform = Windows NT 6.1 SP1 x86_64
节点= 5.9.1
解决方法
我在开发人员文档下的angular.io网站上找到了答案.