First off, sorry if this isn't the right place - I couldn't find a Protractor group and didn't want to log an issue in Github if this isn't actually a bug :)
My test is as follows:
var LoginPage = function () {
this.basePath = browser.params.baseUrl;
this.loginPart = "/#/login";
this.usernameInput = element(by.model('username'));
this.get = function () { ... }
}
it('should focus on the username field on load', function () {
loginPage.get();
expect(loginPage.usernameInput).toBe(browser.driver.switchTo().activeElement());
});
This assertion throws a gigantic stacktrace that doesn't appear to be of any help.
Is there a way of directly comparing elements like this, or do I (as the current lone SO answer says) have to rely on comparing on an attribute or HTML of both elements?