为什么getAttribute('ng-reflect-model')在我的情况下返回Null?

时间:2016-08-02 15:49:25

标签: angularjs jasmine protractor

我正在尝试比较我的标签ng-reflect-model,但是量角器返回null。为什么呢?

我的HTML代码:

**Input Tag code**:


  <input class="form-control ng-datepicker-input ng-valid ng-touched ng-dirty" maxlength="10" name="viewValue" oncopy="return false" onpaste="return false" onkeypress="return event.charCode > = 48 &amp;&amp; event.charCode <= 57" type="text" ng-reflect-name="viewValue" ng-reflect-model="12/03/4567">

我的测试代码:

it('Deve verificar se o campo de Fim Vigência só aceita numeros', function()    
      {
      var fimVigencia = element(by.xpath('/html/body/application/auth-
                container/layout/div/main-content/div/norma-
                cadastro/div/form/div[7]/datapicker/form/div[1]/input'));
        fimVigencia.sendKeys('abcdefghijlmnopqrstuvxz123456789');
        element(by.buttonText('Salvar')).click();
        expect(fimVigencia.getAttribute('ng-reflect-
                                        model')).toBe('123456789');
 });

错误:预计null为'1234567'。

0 个答案:

没有答案