callbacks/promises for the re-usable methods in Protractor
<p>Should we write callbacks/promises for the re-usable methods in Page Object Pattern based testing in Protractor?</p>

<p>For example .. I have the below test code and Page Objects and its working fine without issues. But should I add callbacks for re-usable methods in page class?</p>

<pre><code>describe('This is a test suite for Login cases',function(){
    beforeEach(function() {
        LoginPage.goHome();
        LoginPage.doLogin();
    });
    afterEach(function() {
        LoginPage.doLogout();
    });
    it('Scenario1_Login_VerifyFirstName',function(){
            //Some Test step      
    });
</code></pre>

<p>Page Class:</p>

<pre><code>var Login = {

    PageElements: {
        emailInput: element(by.css('.email')),
        passwordInput: element(by.css('.password')),
        loginForm: element(by.css('.form')),
        logout: element(by.linkText('LOG OUT'))
    },
    goHome: function goHome() {
        browser.get('/signin');
        browser.driver.manage().window().maximize();
    },
    doLogin: function doLogin() {
        this.PageElements.emailInput.sendKeys(UserName);
        this.PageElements.passwordInput.sendKeys(Password);
        this.PageElements.loginForm.submit();
    },
    doLogout: function doLogout() {
        browser.wait(EC.elementToBeClickable(this.PageElements.profileLink));
        this.PageElements.profileLink.click();
        this.PageElements.logout.click();
    }
};

module.exports = Login;
</code></pre>