No injector found for element argument to getTestability

前端 未结 5 2059
遇见更好的自我
遇见更好的自我 2020-12-05 19:32

I\'m trying to run this tutorial against my own AngularJS code. I can\'t get past the first test. Any attempt to pull any information from my page gets this error:

5条回答
  •  生来不讨喜
    2020-12-05 20:09

    I have my angular bootstrapping code as below:

    var appName = "testApp";
    var appContainer = document.getElementById('app-container');
    angular.bootstrap(appContainer, [appName]);
    

    I got the same error that you got and with the advice that I took from @jgiralt, here is my conf.js of protractor that fixed this error:

    // conf.js
    exports.config = {
      framework: 'jasmine',
      seleniumAddress: 'http://localhost:4444/wd/hub',
      rootElement: '#app-container',
      specs: ['spec.js']
    }
    

提交回复
热议问题