量角器元素不可见

时间:2017-02-24 10:06:34

标签: javascript unit-testing jasmine protractor

我使用量角器在angular2应用程序中自动进行测试。一切正常,但我的复选框上看不到错误元素。

有人知道为什么它适用于我的昵称文本框,而不是我的复选框?

  <div class="form-item">
        <label for="nicknaam">nicknaam</label>
        <input  id="nicknaam" name="nicknaam" type="text" />
      </div>

      <div class="form-item">
        <input #termscb id="termscb" name="termscb" type="checkbox" (change)="pro.terms= (termscb.checked?'Y':'N')" />
        <label for="termscb">{{"settings.acceptour" |_}} <a class="" href="#modalTerms">{{"settings.terms" |_ }}</a></label>
      </div>






describe('Protractor Demo App', function() {

    beforeAll(function () {
        browser.ignoreSynchronization = true;
        browser.get('http://localhost:4000/register');
    });


    it('create user', function() {

        element(by.id('nicknaam')).sendKeys("test");
        element(by.id('termscb')).click();

        browser.sleep(3000);
        element.all(by.buttonText('Validate')).click();

    });
});

0 个答案:

没有答案
相关问题