asp.net mvc - Selector [ng\:model="query"] did not match any elements -
why getting error: selector [ng\:model="query"] did not match elements
i've read through this: angularjs: end end testing issue , link doesn't apply in .net env:
ide: visual studio 2012
project type: asp.net mvc4
file strucure:
running ci tests through karma start e2e.conf.js in node.js command prompt
my karma conf:
basepath = '../../../'; files = [ angular_scenario, angular_scenario_adapter, 'angular/app/*.js', 'angular/tests/e2e/*.js' ]; reporters = ['progress']; port = 10876; runnerport = 10100; colors = true; loglevel = log_error; autowatch = true; browsers = ['firefox']; capturetimeout = 60000; singlerun = false; proxies = { '/': 'http://localhost:60607/' };
my e2e test:
describe('e2e: ams', function () { describe('settings users', function () { beforeeach(function () { browser().navigateto('/#/settings/users'); }); it('filters users list user types search box', function () { expect(repeater('.users li').count()).tobe(2); input('query').enter('abc'); expect(repeater('.users li').count()).tobe(1); input('query').enter('efg'); expect(repeater('.users li').count()).tobe(1); input('query').enter('ijk'); expect(repeater('.users li').count()).tobe(0); }); }); });
my view:
<div data-ng-view=""> add user: <br /> <input type="text" /> <button>submit</button><br /> search: <input data-ng-model="query" type="text" /> users <br /> <ul class="users"> <li data-ng-repeat="user in users | filter:query"> {{user.name}} </li> </ul> </div>
and grins, route
angular.module('ams', []). config(['$routeprovider', function ($routeprovider) { $routeprovider. when('/login', { templateurl: '/accesscontrol/login/', controller: settingscontroller }). when('/dashboard', { templateurl: '/dashboard/dashboard', controller: dashboardcontroller }). when('/settings', { templateurl: '/settings/settings', controller: settingscontroller }). when('/settings/users', { templateurl: '/settings/users', controller: settingscontroller }). otherwise({ redirectto: '/dashboard' }); }]);
it looks angular e2e testing api looking "ng-model" in view instead of "data-ng-model" you're using.
my understanding both valid, give try see if that's problem.
Comments
Post a Comment