I am writing a test to automate a scenario, using PROTRACTOR:
I am getting "Undefined is not a function" at .toBe below is my code: trying to get offset position of an element :
this.Then(/^I should have ONLY LOGO available on main page$/, function () { 
    element(by.id('mainPage')).getLocation().then(function (navDivLocation) { 
        var currTop = navDivLocation.y; 
        var currLeft = navDivLocation.x; 
        expect(currLeft).toBe(0); 
        expect(currTop).toBe(0); 
     }); 
});