Getting error: Error while waiting for Protractor to sync with the page: {}

后端 未结 5 2203
独厮守ぢ
独厮守ぢ 2020-12-15 11:22

My e2e.conf.coffee file is:

exports.config =
  baseUrl: \'http://localhost:9001\'
  specs: [
    \'e2e/**/*.coffee\'
  ]

  framework: \'jasmine         


        
5条回答
  •  抹茶落季
    2020-12-15 12:08

    If you need to be using browser.get and are getting this error, the issue is most likely to be the rootElement property in protractor config file.

    By default Protractor assumes that the ng-app declaration sits on the BODY-element. However, in our case, it could be declared somewhere else in the DOM. So we have to assign the selector of that element to the rootElement property:

    // rootElement: 'body', // default, but does not work in my case
    rootElement: '.my-app', // or whatever selector the ng-app element has
    

    Corresponding HTML:

    I copied the answer from http://www.tomgreuter.nl/tech/2014/03/timing-errors-with-angular-protractor-testing/

提交回复
热议问题