Protractor : How to wait for page complete after click a button?

后端 未结 9 781
抹茶落季
抹茶落季 2020-11-29 00:16

In a test spec, I need to click a button on a web page, and wait for the new page completely loaded.

emailEl.sendKeys(\'jack\');
passwordEl.sendKeys(\'123pwd         


        
9条回答
  •  野性不改
    2020-11-29 00:34

    Depending on what you want to do, you can try:

    browser.waitForAngular();

    or

    btnLoginEl.click().then(function() {
      // do some stuff 
    }); 
    

    to solve the promise. It would be better if you can do that in the beforeEach.

    NB: I noticed that the expect() waits for the promise inside (i.e. getCurrentUrl) to be solved before comparing.

提交回复
热议问题