How can I wait for a condition?

前端 未结 8 749
礼貌的吻别
礼貌的吻别 2020-12-07 15:39

I\'m new on protractor, and I\'m trying to implement an e2e test. I don\'t know if this is the right way to do this, but... The page that I want to test is not a full angula

8条回答
  •  隐瞒了意图╮
    2020-12-07 16:29

    I finally find out...

       var waitLoading = by.css('#loading.loader-state-hidden');
    
       browser.wait(function() {
           return ptor.isElementPresent(waitLoading);
       }, 8000);
    
       expect(ptor.isElementPresent(waitLoading)).toBeTruthy();
    
       var openContact = by.xpath("//a[@href='#/contacts']");
       element(openContact).click();
    

    With this protractor could wait for that element until it loading page disappears. Thanks for those who tried to help XD.

提交回复
热议问题