<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")) //模拟键盘输入null e.sendKeys(protractor.Key.BACK_SPACE) e.clear()