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

后端 未结 5 2206
独厮守ぢ
独厮守ぢ 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:16

    Not sure where I picked up the pieces that put this answer at this point, but this is what works for me:

    1. Add class='ng-app' to the element that contains your app.
    1. Add rootElement to your protractor.conf.
    exports.config = {
      specs: ['your-spec.js'],
      rootElement: ".ng-app"
    };
    
    1. Use browser.driver.get not browser.get.
    describe('foobar element', function() {
      it('should be "baz" after view is initialized', function() {
      browser.driver.get('http://localhost/view');
    
        var inputBox = $('input[name=foobar]');
        expect(inputBox.getAttribute('value')).toEqual("baz");
      });
    });
    

提交回复
热议问题