Running into Error while waiting for Protractor to sync with the page with basic protractor test

前端 未结 7 2003
南旧
南旧 2020-12-03 10:31
describe(\'my homepage\', function() {
    var ptor = protractor.getInstance();
    beforeEach(function(){
        // ptor.ignoreSynchronization = true;
        ptor         


        
7条回答
  •  囚心锁ツ
    2020-12-03 10:53

    The rootElement param of the exports.config object defined in your protractor configuration file must match the element containing your ng-app directive. This doesn't have to be uniquely identifying the element -- 'div' suffices if the directive is in a div, as in my case.

    From referenceConf.js:

    // Selector for the element housing the angular app - this defaults to
    // body, but is necessary if ng-app is on a descendant of   
    rootElement: 'div',
    

    I got started with Protractor by watching the otherwise excellent egghead.io lecture, where he uses a condensed exports.config. Since rootElement defaults to body, there is no hint as to what is wrong with your configuration if you don't start with a copy of the provided reference configuration, and even then the

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

    message doesn't give much of a clue.

提交回复
热议问题