isFocused

Return true or false if the selected DOM-element currently has focus. If the selector matches multiple elements, it will return true if one of the elements has focus.

Usage#
$(selector).isFocused()
Examples#
index.html
<input name="login" autofocus="" />
hasFocus.js
it('should detect the focus of an element', () => {
browser.url('/');
const loginInput = $('[name="login"]');
console.log(loginInput.isFocused()); // outputs: false
loginInput.click();
console.log(loginInput.isFocused()); // outputs: true
})