<legend id='0CFlH'><style id='0CFlH'><dir id='0CFlH'><q id='0CFlH'></q></dir></style></legend>

  • <i id='0CFlH'><tr id='0CFlH'><dt id='0CFlH'><q id='0CFlH'><span id='0CFlH'><b id='0CFlH'><form id='0CFlH'><ins id='0CFlH'></ins><ul id='0CFlH'></ul><sub id='0CFlH'></sub></form><legend id='0CFlH'></legend><bdo id='0CFlH'><pre id='0CFlH'><center id='0CFlH'></center></pre></bdo></b><th id='0CFlH'></th></span></q></dt></tr></i><div id='0CFlH'><tfoot id='0CFlH'></tfoot><dl id='0CFlH'><fieldset id='0CFlH'></fieldset></dl></div>

      <bdo id='0CFlH'></bdo><ul id='0CFlH'></ul>

    1. <small id='0CFlH'></small><noframes id='0CFlH'>

    2. <tfoot id='0CFlH'></tfoot>
      1. 量角器 + 混合 Angular 1+2 应用程序 = 失败

        时间:2023-10-12

            <tbody id='Dez8H'></tbody>
          <legend id='Dez8H'><style id='Dez8H'><dir id='Dez8H'><q id='Dez8H'></q></dir></style></legend>

              <bdo id='Dez8H'></bdo><ul id='Dez8H'></ul>
            • <tfoot id='Dez8H'></tfoot>
              <i id='Dez8H'><tr id='Dez8H'><dt id='Dez8H'><q id='Dez8H'><span id='Dez8H'><b id='Dez8H'><form id='Dez8H'><ins id='Dez8H'></ins><ul id='Dez8H'></ul><sub id='Dez8H'></sub></form><legend id='Dez8H'></legend><bdo id='Dez8H'><pre id='Dez8H'><center id='Dez8H'></center></pre></bdo></b><th id='Dez8H'></th></span></q></dt></tr></i><div id='Dez8H'><tfoot id='Dez8H'></tfoot><dl id='Dez8H'><fieldset id='Dez8H'></fieldset></dl></div>

                1. <small id='Dez8H'></small><noframes id='Dez8H'>

                  本文介绍了量角器 + 混合 Angular 1+2 应用程序 = 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  Protractor 在 Angular 1 上运行良好,但在将我的应用升级到混合 Angular 1+2 后,我收到此错误:

                  Protractor works well on Angular 1 but after upgrading my app to an hybrid Angular 1+2 I get this error:

                  失败:等待 Protractor 与页面同步时出错:"[ng:test] 没有为 getTestability 的元素参数找到注入器http://errors.angularjs.org/1.4.9/ng/test"

                  Failed: Error while waiting for Protractor to sync with the page: "[ng:test] no injector found for element argument to getTestability http://errors.angularjs.org/1.4.9/ng/test"

                  当您的 Angular 1 应用程序中没有 ng-app 标签 <div ng-app=myAppManager"> 并且可以轻松修复时,这似乎是一个常见错误wiyh rootElement : 'html' 在您的量角器配置文件中,但它似乎没有改变混合应用程序的任何内容.

                  It seems a common error when you don't have a ng-app tag <div ng-app=myAppManager"> in your Angular 1 app and can be easily fixed wiyh rootElement : 'html' in your protractor config file but it doesn't seem to change anything on hybrid app.

                  我尝试了 rootElement : 'html' 甚至 useAllAngular2AppRoots: true.

                  我怀疑问题来自混合 Angular 的异步加载(来自 升级文档):

                  I suspect the problem comes from the asynchronous loading of the hybrid angular (from the upgrade doc):

                  angular.bootstrap 和upgradeAdapter.bootstrap 是后者异步工作.这意味着我们不能假设应用程序已经实例化在引导调用返回后立即.

                  One notable difference between angular.bootstrap and upgradeAdapter.bootstrap is that the latter works asynchronously. This means that we cannot assume that the application has been instantiated immediately after the bootstrap call returns.

                  我的配置文件:

                  exports.config = {
                      framework: 'jasmine2',
                      seleniumAddress: 'http://localhost:4444/wd/hub',
                      specs: ['protractor.js'],
                      jasmineNodeOpts: {
                          showColors: true,
                          defaultTimeoutInterval: 50000,
                      },
                      allScriptsTimeout: 50000,//seb
                      capabilities: {
                          'browserName': 'chrome',
                          'chromeOptions': {
                              'prefs': {
                                  'profile.managed_default_content_settings.notifications':2
                              }
                          }
                      },
                      rootElement : 'html',
                      // useAllAngular2AppRoots: true,
                      jasmineNodeOpts: {
                          realtimeFailure: true
                      },
                      onPrepare: function() {
                        var failFast = require('jasmine-fail-fast');
                        jasmine.getEnv().addReporter(failFast.init());
                      }
                  }
                  

                  推荐答案

                  Protractor 团队已经解决了这个问题:

                  Protractor team has fixed with this:

                  https://github.com/angular/angular/pull/7603

                  我还没有测试过

                  编辑 2:似乎不起作用,我回到了 angularJs(版本 1)

                  编辑 3:我移至 React

                  这篇关于量角器 + 混合 Angular 1+2 应用程序 = 失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在量角器上按 Ctrl+单击? 下一篇:如何使量角器中的自动化测试脚本等待,直到页

                  相关文章

                  最新文章

                    <small id='8frnU'></small><noframes id='8frnU'>

                    <tfoot id='8frnU'></tfoot>

                      <i id='8frnU'><tr id='8frnU'><dt id='8frnU'><q id='8frnU'><span id='8frnU'><b id='8frnU'><form id='8frnU'><ins id='8frnU'></ins><ul id='8frnU'></ul><sub id='8frnU'></sub></form><legend id='8frnU'></legend><bdo id='8frnU'><pre id='8frnU'><center id='8frnU'></center></pre></bdo></b><th id='8frnU'></th></span></q></dt></tr></i><div id='8frnU'><tfoot id='8frnU'></tfoot><dl id='8frnU'><fieldset id='8frnU'></fieldset></dl></div>
                    1. <legend id='8frnU'><style id='8frnU'><dir id='8frnU'><q id='8frnU'></q></dir></style></legend>

                        <bdo id='8frnU'></bdo><ul id='8frnU'></ul>