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

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

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

        <bdo id='iaqDl'></bdo><ul id='iaqDl'></ul>
      <legend id='iaqDl'><style id='iaqDl'><dir id='iaqDl'><q id='iaqDl'></q></dir></style></legend>

        cucumber-js 和 Chai 如何期待具有給定選擇器的元素

        cucumber-js and Chai how to expect if element with given selector exist in DOM(cucumber-js 和 Chai 如何期待具有給定選擇器的元素是否存在于 DOM 中)
              • <bdo id='1ms6y'></bdo><ul id='1ms6y'></ul>

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

                  <legend id='1ms6y'><style id='1ms6y'><dir id='1ms6y'><q id='1ms6y'></q></dir></style></legend>
                    <tbody id='1ms6y'></tbody>
                1. <small id='1ms6y'></small><noframes id='1ms6y'>

                2. <tfoot id='1ms6y'></tfoot>
                3. 本文介紹了cucumber-js 和 Chai 如何期待具有給定選擇器的元素是否存在于 DOM 中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我對 cucumberjs 有疑問.我找不到方法來確保具有給定選擇器的元素被呈現到 DOM 中.我正在使用cucumberjs 與柴.https://github.com/cucumber/cucumber-jsisPresent 返回對象 - 無論元素是否存在.所以問題是如何檢查元素是否存在于 DOM 中.

                  I have a problem with cucumberjs. I cannot find a way to ensure that element with given selector is presented into DOM. I'm using cucumberjs with Chai. https://github.com/cucumber/cucumber-js isPresent returns object - no matter if the element exists or not. So the question is how to check if element is present in DOM.

                  我將編輯問題以分享一個經驗教訓.我閱讀了文檔還要感謝 Nathan Thompson.存在()返回一個承諾,該承諾將解決該元素是否存在于頁面上.

                  I will edit the question to share one learned lesson. I read the documentation also want to thanks to Nathan Thompson. isPresent() returns a promise that will resolve to whether the element is present on the page.

                  http://angular.github.io/protractor/#/api?view=Protractor.prototype.isElementPresent

                  代碼示例有點誤導.因此,如果您想知道 DOM 中是否存在具有給定選擇器的元素,您必須使用如下內容:

                  The code examples is a little misleading. So if you want to expect if element with a given selector exist in DOM you must use something like this:

                  element(by.id('someId')).isPresent().then(function(isElementVisible) {
                       expect(isElementVisible).to.be.true;   
                  });
                  

                  或者使用帶有 promise 的 chai.

                  Or use chai with promises.

                  expect(element.isPresent()).to.eventually.be.false
                  

                  但是,最終"這個詞聽起來令人不快.我們希望確定最終不確定.:)

                  However, the word "eventually" sounds unpleasant. We want to be sure not eventually sure. :)

                  這里可以在我的個人博客中查看了有關此問題的文章.

                  Here can be viewed article about this question into my personal blog.

                  推薦答案

                  Protractor 中幾乎所有的函數都返回 promise,這些 promise 將解析為您實際想要測試的值.因此,如果您只是嘗試執行以下操作,它總是會失敗,因為它是在 isPresent 返回的 Promise 對象上聲明:

                  Almost all functions in Protractor return promises that will resolve into the values you actually want to test against. So if you're just trying to do something like the following, it will always fail because it's asserting on the promise object returned by isPresent:

                  expect(element.isPresent()).to.be.false
                  

                  我建議使用 chai-as-promised 插件來處理 Chai像這樣的情況.它提供了 eventually 鏈,該鏈將為您解析 Promise 并對結果值進行斷言.上面的例子看起來像這樣:

                  I would recommend using the chai-as-promised plugin for Chai to handle situations like this. It provides the eventually chain that will resolve promises for you and assert on the resulting value. The above example would look like this:

                  expect(element.isPresent()).to.eventually.be.false
                  

                  這篇關于cucumber-js 和 Chai 如何期待具有給定選擇器的元素是否存在于 DOM 中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='UjAS0'><tr id='UjAS0'><dt id='UjAS0'><q id='UjAS0'><span id='UjAS0'><b id='UjAS0'><form id='UjAS0'><ins id='UjAS0'></ins><ul id='UjAS0'></ul><sub id='UjAS0'></sub></form><legend id='UjAS0'></legend><bdo id='UjAS0'><pre id='UjAS0'><center id='UjAS0'></center></pre></bdo></b><th id='UjAS0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='UjAS0'><tfoot id='UjAS0'></tfoot><dl id='UjAS0'><fieldset id='UjAS0'></fieldset></dl></div>

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

                      • <bdo id='UjAS0'></bdo><ul id='UjAS0'></ul>
                        <legend id='UjAS0'><style id='UjAS0'><dir id='UjAS0'><q id='UjAS0'></q></dir></style></legend>
                              <tbody id='UjAS0'></tbody>
                            <tfoot id='UjAS0'></tfoot>
                            主站蜘蛛池模板: 国产色片 | 欧美精品第一页 | 另类专区亚洲 | 久久久久久www | 国产视频福利一区 | 亚洲欧美日韩精品 | 国产人成精品一区二区三 | 国产精品综合色区在线观看 | 成人国产精品色哟哟 | 亚洲精彩视频 | 一区二区三区视频在线观看 | 久久精品一区二区视频 | 青青久在线视频 | 日韩精品一区二区三区中文字幕 | 一区二区三区四区国产 | aaa在线观看| 欧美精品一区二区三区在线播放 | www.99re| 欧洲在线视频 | 日本激情一区二区 | 丝袜美腿av | 亚洲精品久久久一区二区三区 | 国产成在线观看免费视频 | 波多野结衣中文字幕一区二区三区 | 久久专区 | 国产精品久久久久久久久免费桃花 | 国产乱码精品一区二区三区五月婷 | 波多野结衣二区 | 一区二区三区在线播放 | 久久中文免费视频 | 亚洲精品在线观看网站 | 日本精品一区二区 | 亚洲一区二区高清 | 日本91av视频 | 99久久婷婷国产亚洲终合精品 | 羞羞视频在线观看 | 99久久精品国产一区二区三区 | 国产日韩精品在线 | 国产欧美一区二区精品久导航 | 亚洲成人一二区 | 天天操天天插天天干 |