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

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

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

    <legend id='8g0bq'><style id='8g0bq'><dir id='8g0bq'><q id='8g0bq'></q></dir></style></legend>
    • <bdo id='8g0bq'></bdo><ul id='8g0bq'></ul>

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

      1. 量角器清除()不工作

        Protractor clear() not working(量角器清除()不工作)
          <tbody id='xaflZ'></tbody>

      2. <legend id='xaflZ'><style id='xaflZ'><dir id='xaflZ'><q id='xaflZ'></q></dir></style></legend>

            <bdo id='xaflZ'></bdo><ul id='xaflZ'></ul>
            1. <small id='xaflZ'></small><noframes id='xaflZ'>

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

                  本文介紹了量角器清除()不工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有兩個測試:

                    it('should filter the phone list as user types into the search box', function() {
                  
                      var results = ptor.findElements(protractor.By.repeater('phone in phones').column('phone.name'));
                      results.then(function(arr) {
                              expect(arr.length).toEqual(3);
                      });
                  
                      var queryInput = ptor.findElement(protractor.By.input('query'));
                  
                      queryInput.sendKeys('nexus');
                  
                      results = ptor.findElements(protractor.By.repeater('phone in phones').column('phone.name'));
                      results.then(function(arr) {
                          expect(arr.length).toEqual(1);
                      });
                  
                      queryInput.clear();
                      queryInput.sendKeys('motorola');
                  
                      results = ptor.findElements(protractor.By.repeater('phone in phones').column('phone.name'));
                      results.then(function(arr) {
                          expect(arr.length).toEqual(2);
                      });
                  
                  });
                  
                  it('should display the current filter value within an element with id "status"',
                      function() {
                          //expect(element('#status').text()).toMatch(/Current filter: s*$/);
                          var queryInput = ptor.findElement(protractor.By.input('query'));
                          queryInput.clear();
                  
                          expect(ptor.findElement(protractor.By.id('status')).getText()).toMatch('Current Filter:');
                  
                          //input('query').enter('nexus');
                  
                          //queryInput.clear();
                          //queryInput.sendKeys('nexus');
                  
                          //expect(element('#status').text()).toMatch(/Current filter: nexuss*$/);
                          //expect(ptor.findElement(protractor.By.id('status')).getText()).toMatch('^Current Filter:.');
                  
                          //alternative version of the last assertion that tests just the value of the binding
                          //using('#status').expect(binding('query')).toBe('nexus');
                      });
                  

                  第一個測試,搜索框,效果很好.第二個測試 status 沒有通過,因為在 queryInput 中輸入的最后一個值被傳遞到第二個測試,并且 queryInput.clear() 不起作用.但是,在第二個測試中,如果我調用 queryInput.sendKeys("something"),則會顯示something".如果我在第二個測試中取出 clear(),我會看到motorolaso??mething".因此,雖然 clear() 似乎在工作,但如果我在第二個測試中只有 clear(),我的測試沒有通過,當我運行第二個測試時,即使調用 clear(),我也會看到motorola"在第二次測試之前.

                  the first test, search box, works great. the second test, status, does not pass because the last value entered in queryInput is carried over to the second test, and the queryInput.clear() does not work. However, in the second test, if i make a call queryInput.sendKeys("something"), "something" will display. If I take out the clear() in the second test, I'll see "motorolasomething". So, while it seems the clear() is working, my test is not passing if I just have clear() in the second test, when i run the second test, I will see "motorola", even when clear() is called prior to the second test.

                  我想知道為什么 clear() 之后沒有 sendKeys() 時在第二次測試中沒有清除它.

                  I'm wondering why the clear() is not clearing in the second test when I do not have a sendKeys() after it.

                  推薦答案

                  clear() 的文檔說明如下:

                  The Documentation of clear() says the following:

                  [ !webdriver.promise.Promise ] 清除( )

                  [ !webdriver.promise.Promise ] clear( )

                  安排一個命令來清除此元素的 {@code 值}.如果底層 DOM 元素既不是文本 INPUT 元素也不是 TEXTAREA元素.

                  Schedules a command to clear the {@code value} of this element. This command has no effect if the underlying DOM element is neither a text INPUT element nor a TEXTAREA element.

                  返回:當元素具有被清除了.

                  Returns: A promise that will be resolved when the element has been cleared.

                  所以為了清楚地做你想做的事,你必須遵守它返回的承諾!為此,您必須使用 then()

                  so in order to get clear to do what you want, you have to work with the promise that it returns! to do so you have to use then()

                  這是它的工作原理:

                  queryInput.clear().then(function() {
                      queryInput.sendKeys('motorola');
                  })
                  

                  所以 clear() 返回一個清除輸入的承諾,而 then() 告訴承諾在輸入被清除后立即執行什么操作.

                  so clear() returns you a promise to clear the input and then() tells the promise what to do as soon as the input is cleared.

                  這篇關于量角器清除()不工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  <legend id='lrQtz'><style id='lrQtz'><dir id='lrQtz'><q id='lrQtz'></q></dir></style></legend>
                      <tbody id='lrQtz'></tbody>

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

                        <bdo id='lrQtz'></bdo><ul id='lrQtz'></ul>

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

                            主站蜘蛛池模板: 狠狠久久| 亚洲欧美日韩国产 | 中文字幕a√ | 日日摸夜夜爽人人添av | www免费视频 | 色中文在线 | 国产精品美女一区二区 | www.国产91 | 美日韩精品 | 97超碰免费 | 国产精品久久久久久久久久久久午夜片 | 色综合一区二区三区 | 国产精品99久久久久久www | 一区二区三区亚洲视频 | 欧美日韩高清一区二区三区 | 成人免费日韩 | 亚洲视频中文字幕 | 欧美一级片免费看 | 羞羞视频网站在线观看 | 97操操 | 精品真实国产乱文在线 | 在线看亚洲 | 日本精品在线一区 | 毛片网站在线观看 | 国产男女猛烈无遮掩视频免费网站 | 久久国产一区二区 | 欧美精品二区三区 | 亚洲国产精品区 | 久久国产精品一区二区 | 国产91精品久久久久久久网曝门 | 久久狠狠 | 久久久国产精品一区 | 久久剧场 | 水蜜桃亚洲一二三四在线 | 久久免费精彩视频 | 精品国产欧美日韩不卡在线观看 | 中文字幕在线一区二区三区 | 色婷婷综合在线观看 | 国产特级毛片aaaaaa | 国产高清免费视频 | 欧美日韩激情 |