PageObjects + non-angular page - how to join them?

孤人 提交于 2019-12-04 09:10:37

I got error immediately after protractor start

This is because of where you initialize the Page Object - Protractor initializes your Page Object very early, when gathering the specs. You need to initialize the page object inside the beforeEach():

describe('Damage selection - ', function() {
    var damagePage;

    beforeEach(function () {
       damagePage = new DamagePage();
    });

    // ...
});

Or, directly inside the it():

it('Put I on it with 5 WU', function() {
    var damagePage = new DamagePage();

    // Click I
    damagePage.leftMenuButtons.I.button.click();
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!