Protractor Check if Element Does Not Exist

后端 未结 6 2039
长情又很酷
长情又很酷 2021-02-05 02:56

I have a setting in my angular based website that turns a dropdown on and off. If it is off, then it does not show on the main page.

With Protractor, I need to check to

6条回答
  •  佛祖请我去吃肉
    2021-02-05 02:58

    Another option that worked a bit better for me, and uses protractor 'way' of doing things http://angular.github.io/protractor/#/api?view=ElementArrayFinder.prototype.all

    element.all(by.css('.k-loading-image')).then(function(items) {
        expect(items.length).toBe(0);
    });
    

    (I wanted to check that a loading indicator had disappeared)

提交回复
热议问题