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

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

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

  • <tfoot id='L3EE3'></tfoot>
      <bdo id='L3EE3'></bdo><ul id='L3EE3'></ul>

      <legend id='L3EE3'><style id='L3EE3'><dir id='L3EE3'><q id='L3EE3'></q></dir></style></legend>

        使用 Protractor 設(shè)置 Angular 模型

        Setting an Angular model using Protractor(使用 Protractor 設(shè)置 Angular 模型)
          <tbody id='xjiFl'></tbody>

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

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

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

                  本文介紹了使用 Protractor 設(shè)置 Angular 模型的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試使用 Protractor 在我的網(wǎng)站上模擬用戶故事.

                  I'm trying to emulate a user story on my website with Protractor.

                  用戶必須輸入使用自動(dòng)完成的輸入.在現(xiàn)實(shí)生活中,用戶必須在輸入中鍵入一些文本,然后使用鼠標(biāo)或更自然地使用向下箭頭鍵選擇正確的命題.

                  The user has to type in an input that uses auto-completion. In real life, the user has to type some text in the input, then select the right proposition with either her mouse or more naturally her downarrow key.

                  問題是我似乎無法用 Protractor 模擬它.element.sendKeys 只是不允許您這樣做.我已經(jīng)嘗試了十幾種不同的方式,但充其量只能產(chǎn)生不可預(yù)測的結(jié)果.

                  The problem is that I can't seem to simulate that with Protractor. element.sendKeys just does not allow you to do that. I have tried in a dozen different manners and it yields unpredictable results at best.

                  所以我想直接操作我輸入的 ng-model.有沒有辦法從量角器訪問元素的范圍并在其上調(diào)用函數(shù)/設(shè)置屬性?

                  So I would like to manipulate the ng-model behing my input directly. Is there a way to access the scope of an element from Protractor and call functions/set properties on it?

                  這是我的問題的簡化版本:

                  Here is a simplified version of my problem :

                  查看:

                  <div ng-controller="MyController"> 
                    <input id="my-input" ng-model="myModel"/>
                  </div>
                  

                  控制器:

                   myModule.controller('MyController', ['$scope', function($scope){
                     $scope.myModel = "";
                     //[...]
                   }]);
                  

                  e2e 量角器測試:

                  describe("setting myModel to a fixture value", function(){
                    it("should set myModel to 'a test value'", function(){
                      var myInput = element('my-input');
                      // Now what?
                    });
                  });
                  

                  推薦答案

                  你可以使用.evaluate() 直接設(shè)置你的模型值:

                  You can use .evaluate() to set your model value directly:

                  var elm = element(by.model("obj.field"));
                  elm.evaluate("obj.field = 'test';");
                  

                  獲取模型值:

                  elm.evaluate("obj.field").then(function (value) {
                      console.log(value);
                  });
                  

                  這篇關(guān)于使用 Protractor 設(shè)置 Angular 模型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  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標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                      <tbody id='GW4F9'></tbody>
                    <tfoot id='GW4F9'></tfoot>
                      <i id='GW4F9'><tr id='GW4F9'><dt id='GW4F9'><q id='GW4F9'><span id='GW4F9'><b id='GW4F9'><form id='GW4F9'><ins id='GW4F9'></ins><ul id='GW4F9'></ul><sub id='GW4F9'></sub></form><legend id='GW4F9'></legend><bdo id='GW4F9'><pre id='GW4F9'><center id='GW4F9'></center></pre></bdo></b><th id='GW4F9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GW4F9'><tfoot id='GW4F9'></tfoot><dl id='GW4F9'><fieldset id='GW4F9'></fieldset></dl></div>
                      <legend id='GW4F9'><style id='GW4F9'><dir id='GW4F9'><q id='GW4F9'></q></dir></style></legend>
                          <bdo id='GW4F9'></bdo><ul id='GW4F9'></ul>

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

                            主站蜘蛛池模板: 中文字幕亚洲欧美日韩在线不卡 | 欧美日韩亚洲系列 | 亚洲一区二区久久 | 最近免费日本视频在线 | 99精品99| 国产精品视频在线播放 | 久久久久国产精品一区二区 | 中文字幕1区2区3区 亚洲国产成人精品女人久久久 | 国产精品欧美一区二区 | 欧美三级在线 | 精品自拍视频在线观看 | 中文字幕一区二区三区四区五区 | 精品精品视频 | 美女拍拍拍网站 | 亚洲免费在线视频 | 一区二区三区视频在线免费观看 | 亚洲在线一区二区三区 | 天天干狠狠操 | 99成人| 99国产精品99久久久久久粉嫩 | 欧美日韩中文在线观看 | 欧美一二三 | 国产伦精品一区二区三毛 | 97人人超碰| 男人天堂av网站 | 久久精品久久久久久 | 亚洲欧美在线一区 | 久久九七 | 91久久| 91九色porny首页最多播放 | 在线免费观看视频你懂的 | 日日骚网| 欧美一区二区大片 | 99亚洲精品 | 国产午夜亚洲精品不卡 | 韩日在线视频 | 亚洲中午字幕 | 欧美色性| 日本精品视频一区二区三区四区 | 97国产超碰| 午夜丁香视频在线观看 |