Angular E2E scenario selector does not detect if hyperlink is visible

177 Views Asked by At

I have the following e2e test:

expect(element('a[name="prevStepButton"]:visible').count()).toEqual(1);

On the following template:

<a class="btn btn-primary" name="prevStepButton" ng-show="wizardstep > 1" 
 ng-click="prevStep()">Previous</a>

Where $scope.wizardstep = 2

Unfortunately the expectation is always 0.

Anyone any idea what is wrong with this code/test?

1

There are 1 best solutions below

0
On

Have you tried putting browser().navigateTo('/'); before your expect?