angular中的e2e检测sendkeys将绑定值设置为空
生活随笔
收集整理的這篇文章主要介紹了
angular中的e2e检测sendkeys将绑定值设置为空
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
<button id="publish" [disabled]="((!testContent)&&iValue)" >發表</button> <textarea cols="40" rows="5" [(ngModel)]="testContent" name="content" id="chinese"></textarea>在使用e2e檢測的時候,不能將testContent的默認值給清除掉
var e = element(by.id("chinese")) e.clear()
解決的方法:
var e = element(by.id("chinese"))e.sendKeys(protractor.Key.chord(protractor.Key.CONTROL,"a")) //模擬鍵盤輸入nulle.sendKeys(protractor.Key.BACK_SPACE)e.clear()
?
轉載于:https://www.cnblogs.com/MyUniverse/p/11285371.html
總結
以上是生活随笔為你收集整理的angular中的e2e检测sendkeys将绑定值设置为空的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sharepoint简单说明
- 下一篇: 一、字符串问题