Protractor Check if Element Does Not Exist

后端 未结 6 2021
长情又很酷
长情又很酷 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 03:01

    stalenessOf may be a good way to go: Protractor - ExpectedConditions.stalenessOf

    For example you have a modal that is currently open. You close it and expect it to not be present:

    element(by.css('.modal-dialog .cancel-button')).click();
    browser.wait(EC.stalenessOf(element(by.css('.modal-dialog')), 60000);
    expect(element(by.css('.modal-dialog')).isPresent()).toBeFalsy();
    

提交回复
热议问题