简体   繁体   中英

ng-2 and ionic 2: Error while waiting for Protractor to sync with the page: "window.angular is undefined

I'm running a pretty basic Protractor test with Page Object scheming set up. But when I run my tests, I get the error described in the title. This is my spec file.

var tabs = require('../../pages/tabBar.page.js');
var dashboard = require('../../pages/dashboard.page.js');

describe('Dashboard - Nav', function() {

    beforeEach(function() {
        browser.ignoreSynchronization = false;
        browser.waitForAngular();
    })

    it('Given I open the dashboard tab', function() {
        browser.get('http://localhost:8100');
        browser.refresh();
        browser.sleep(2000);
        expect(dashboard.salesButton.isDisplayed()).toBe(true);
        browser.sleep(1000);
    })
})

I can get it to run by setting ignoreSync to true, but the test is a lot slower due to some dependencies, and I don't see why I should have to anyway, it's all angular2/ionic2. Anyone able to help?

Homer Simpson: DOH

It would probably help if I loaded my page before waiting for Angular huh?

Thanks everyone for humoring me on this. As you were.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM