久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='J3j6b'></tfoot>

        <small id='J3j6b'></small><noframes id='J3j6b'>

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

        使用 $resource 時量角器超時等待與頁面同步

        Protractor times out waiting for sync with page when using $resource(使用 $resource 時量角器超時等待與頁面同步)

          • <tfoot id='SvGoo'></tfoot>

            <small id='SvGoo'></small><noframes id='SvGoo'>

              <tbody id='SvGoo'></tbody>
            <legend id='SvGoo'><style id='SvGoo'><dir id='SvGoo'><q id='SvGoo'></q></dir></style></legend>
              <bdo id='SvGoo'></bdo><ul id='SvGoo'></ul>
            • <i id='SvGoo'><tr id='SvGoo'><dt id='SvGoo'><q id='SvGoo'><span id='SvGoo'><b id='SvGoo'><form id='SvGoo'><ins id='SvGoo'></ins><ul id='SvGoo'></ul><sub id='SvGoo'></sub></form><legend id='SvGoo'></legend><bdo id='SvGoo'><pre id='SvGoo'><center id='SvGoo'></center></pre></bdo></b><th id='SvGoo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SvGoo'><tfoot id='SvGoo'></tfoot><dl id='SvGoo'><fieldset id='SvGoo'></fieldset></dl></div>

                1. 本文介紹了使用 $resource 時量角器超時等待與頁面同步的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在用一個小型 AngularJS 應用程序測試 Protractor.

                  I'm testing Protractor with a small AngularJS app.

                  這是測試:

                  describe('Testing Protractor', function() {
                    var draftList;
                  
                    it('should count the number of drafts', function() {
                      browser.get('#/');
                      draftList = element.all(by.repeater('newsletter in drafts'));
                      expect(draftList.count()).toEqual(2);
                    });
                  });
                  

                  控制器:

                  angular.module('myApp.controllers', []).
                    controller('DraftsCtrl', ['$scope', 'Draft', function($scope, Draft) {
                      $scope.drafts = Draft.query();
                  }])
                  

                  草稿服務:

                  angular.module('myApp.services', ['ngResource']).
                    factory('Draft', ['$resource',
                      function($resource) {
                        return $resource('api/drafts/:id')
                      }])
                  

                  使用 Protractor 運行此測試會導致以下錯誤:

                  Running this test using Protractor results in the following error:

                  Error: Timed out waiting for Protractor to synchronize with the page after 11 seconds
                  

                  但是,如果在控制器中我更改此行:

                  However, if in the controller I change this line:

                  $scope.drafts = Draft.query();
                  

                  到這里:

                  $scope.drafts = [];
                  

                  測試按預期失敗,但更重要的是:它不會超時.

                  The test fails as expected, but more importantly: it does not time out.

                  啟用 query() 后,無論是在瀏覽器中手動運行應用程序,還是查看 Protractor 打開的瀏覽器窗口時,API 返回的數據都會由中繼器正確顯示.

                  With query() enabled, both when running the app manually in a browser and when looking at the browser window opened by Protractor, the data returned by the API is correctly displayed by a repeater.

                  為什么服務與 API 通信時 Protractor 無法與頁面同步?

                  Why is Protractor not able to synchronize with the page when the service is communicating with the API?

                  AngularJS 是 v1.2.0-rc3.量角器是 v0.12.0.

                  AngularJS is v1.2.0-rc3. Protractor is v0.12.0.

                  推薦答案

                  這是一個已知問題,但是有一個臨時的解決方法.設置 ptor.ignoreSynchronization = true.

                  This is a known issue, but there is a temporary workaround. Set ptor.ignoreSynchronization = true.

                  例如:

                  describe('Testing Protractor', function() {
                    var draftList;
                    var ptor;
                  
                    beforeEach(function() {
                      ptor = protractor.getInstance();
                      ptor.ignoreSynchronization = true;
                    });
                  
                    it('should count the number of drafts', function() {
                      ptor.get('#/');
                      draftList = element.all(by.repeater('newsletter in drafts'));
                      expect(draftList.count()).toEqual(2);
                    });
                  });
                  

                  這篇關于使用 $resource 時量角器超時等待與頁面同步的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                  • <tfoot id='lKH9O'></tfoot>
                      <bdo id='lKH9O'></bdo><ul id='lKH9O'></ul>
                    • <i id='lKH9O'><tr id='lKH9O'><dt id='lKH9O'><q id='lKH9O'><span id='lKH9O'><b id='lKH9O'><form id='lKH9O'><ins id='lKH9O'></ins><ul id='lKH9O'></ul><sub id='lKH9O'></sub></form><legend id='lKH9O'></legend><bdo id='lKH9O'><pre id='lKH9O'><center id='lKH9O'></center></pre></bdo></b><th id='lKH9O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lKH9O'><tfoot id='lKH9O'></tfoot><dl id='lKH9O'><fieldset id='lKH9O'></fieldset></dl></div>

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

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

                          1. 主站蜘蛛池模板: 亚洲精品一区二区另类图片 | 精品日韩在线 | 久久久久久国产免费视网址 | 国产精品日韩在线 | 欧美日韩在线免费观看 | 日日干夜夜操 | 中文字幕日韩一区 | 久久久福利 | 春色av| 国产视频日韩 | 九九热re| 国产乱码精品1区2区3区 | 成人午夜免费网站 | 亚洲福利一区二区 | 欧美成人激情 | 精品九九 | 91久久国产精品 | 国产99久久精品一区二区300 | 成人精品久久 | chengrenzaixian| 国产精品免费看 | 日韩欧美在线观看 | 国产在线视频一区二区董小宛性色 | 欧美精品第一区 | 精品小视频 | 国产精品久久久久久久久婷婷 | 久久亚洲视频 | 三级特黄特色视频 | 日韩免费视频一区二区 | 91在线观看 | 国产精品伦一区二区三级视频 | 欧美日韩最新 | 久久国产成人午夜av影院武则天 | 欧美日韩成人在线 | 亚洲国产一区二区三区, | 色综合99 | 日韩一级欧美一级 | 久久不卡| 综合色播 | 黄色在线观看网址 | 国产欧美在线视频 |