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

    1. <legend id='XBJj6'><style id='XBJj6'><dir id='XBJj6'><q id='XBJj6'></q></dir></style></legend>

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

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

        量角器 browser.wait 不等待

        Protractor browser.wait doesn#39;t wait(量角器 browser.wait 不等待)
          <tbody id='vVQ2Q'></tbody>

        1. <tfoot id='vVQ2Q'></tfoot>

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

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

                • 本文介紹了量角器 browser.wait 不等待的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我假設 browser.wait 應該是一個阻塞調用,但它沒有按我預期的那樣工作.這是我的示例:

                  I am assuming that browser.wait should be a blocking call, but it is not working as I expected. Here is my sample:

                  describe("browser.wait", function() {
                      beforeEach(function() {
                          browser.wait(function() {
                              console.log('1 - BeforeEach WAIT');
                              return true;
                          });
                      console.log('2 - BeforeEach after wait');
                  });
                  
                  afterEach(function() {
                      browser.wait(function() {
                          console.log('4 - afterEach WAIT');
                          return true;
                      });
                      console.log('5 - afterEach after wait');
                  });
                  
                  it('should probably actually wait.', function() {
                      console.log('3 - IT statement');
                      expect(1).toBe(1);      
                  });
                  

                  現在,因為我假設 browser.wait 實際上是阻塞的,所以我認為我的 console.log 調用會按順序運行;1,2,3,4,5;

                  Now, because I assumed browser.wait was actually blocking, I thought that my console.log calls would be run in order; 1,2,3,4,5;

                  我得到的實際輸出是:

                  2 - BeforeEach after wait  
                  1 - BeforeEach WAIT  
                  3 - IT statement  
                  5 - afterEach after wait  
                  4 - afterEach WAIT  
                  

                  如何讓 browser.wait 等待?還是我完全使用了錯誤的功能?我需要阻止一些事情,直到我的瀏覽器到達下一次調用所需的位置.

                  How can I get browser.wait to wait? Or am I using the wrong function completely? I need things to block until my browser gets to where it needs to be for the next call.

                  推薦答案

                  都是關于承諾的(實際上每個量角器問題都是關于承諾的).

                  It is all about promises (actually every protractor question is about promises).

                  browser.wait() 不是阻塞調用,它調度一個命令 等待一個條件:

                  安排一個命令等待一個條件成立,如定義一些用戶提供的功能.如果在評估過程中出現任何錯誤等等,他們將被允許傳播.如果有條件返回一個 webdriver.promise.Promise,輪詢循環將等待它被解析并使用解析的值來評估是否條件已經滿足.承諾的解決時間是考慮等待是否超時.

                  Schedules a command to wait for a condition to hold, as defined by some user supplied function. If any errors occur while evaluating the wait, they will be allowed to propagate. In the event a condition returns a webdriver.promise.Promise, the polling loop will wait for it to be resolved and use the resolved value for evaluating whether the condition has been satisfied. The resolution time for a promise is factored into whether a wait has timed out.

                  它不會立即調用你傳入的函數,它會安排一個命令并等待 promise 被解析(如果里面的函數返回一個 promise).

                  It would not call the function you are passing in immediately, it would schedule a command and wait for promise to be resolved (if the function inside returns a promise).

                  在這種情況下,您可以使用 then() 來獲得正確的順序:

                  You can use then() to have a correct order in this case:

                  beforeEach(function() {
                      browser.wait(function() {
                          console.log('1 - BeforeEach WAIT');
                          return true;
                      }).then(function () {
                          console.log('2 - BeforeEach after wait');
                      });
                  });
                  

                  在此處查看用例:

                  • 如何等待條件?

                  這篇關于量角器 browser.wait 不等待的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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() 的限制?)
                  <i id='H74u5'><tr id='H74u5'><dt id='H74u5'><q id='H74u5'><span id='H74u5'><b id='H74u5'><form id='H74u5'><ins id='H74u5'></ins><ul id='H74u5'></ul><sub id='H74u5'></sub></form><legend id='H74u5'></legend><bdo id='H74u5'><pre id='H74u5'><center id='H74u5'></center></pre></bdo></b><th id='H74u5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='H74u5'><tfoot id='H74u5'></tfoot><dl id='H74u5'><fieldset id='H74u5'></fieldset></dl></div>

                          <tbody id='H74u5'></tbody>
                          <bdo id='H74u5'></bdo><ul id='H74u5'></ul>

                        • <tfoot id='H74u5'></tfoot>
                        • <small id='H74u5'></small><noframes id='H74u5'>

                          1. <legend id='H74u5'><style id='H74u5'><dir id='H74u5'><q id='H74u5'></q></dir></style></legend>
                            主站蜘蛛池模板: h视频在线免费 | 在线一级片| 天天爽天天操 | 日韩无| 精品一二三 | 国产在线一区二区三区 | 久久久精品网 | 日韩中文一区二区三区 | 人人玩人人添人人澡欧美 | 最新av在线播放 | 一级黄色绿像片 | 精品国产免费人成在线观看 | 亚洲成av| 亚洲一区二区在线视频 | 亚洲成人999 | 日韩欧美电影在线 | 黑人粗黑大躁护士 | 精品视频一区二区三区在线观看 | 久久视频免费观看 | 久久精品小视频 | 精品久久久久久国产 | 超碰3 | 日本精品网站 | 欧美亚洲国产一区二区三区 | 亚洲福利电影网 | 超碰综合 | 99国产精品视频免费观看一公开 | 国产最好的av国产大片 | 免费观看的av | 国产大学生情侣呻吟视频 | 日日噜| 国产精品久久久久久福利一牛影视 | 91看片在线| 亚洲精品电影在线 | 黄色国产大片 | 在线午夜 | 欧美一区二区黄 | 欧美性网 | 久久久91精品国产一区二区三区 | 国产三级国产精品 | 成人在线电影网站 |