Take the 2-minute tour ×

I've tried: https://github.com/velesin/jasmine-jquery and https://github.com/ferronrsmith/angularjs-jasmine-matchers but looks like that it only works with jasmine framework and I'm using a ng-scenario in my app.

At first I thought that just using pseudo classes should works:


because I found in angular-scenario.js this lines:

pseudos: {
"focus": function( elem ) {
        return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);

but it didn't work.

I've also tried something like this:

element('#email').query(function(elements, done) {
            console.log( elements.is(':focus'));

Input got a focus, but elements.is(':focus') always returned false.

Is there a simple way to check if input has a focus in Angularjs e2e tests?

share|improve this question
add comment

Your Answer



Browse other questions tagged or ask your own question.