dimanche 25 juin 2017

How to do display the hidden view in Protractor Testing?

I am trying to use protractor testing for my website. When I run the test, firefox displays Welcome home soldier which is the part from ng-view="admin" (correct view) in the screen however the test results as failed.

index.html

<div ui-view="!admin">
 <h1> Please sign up </h1> 
</div>

<div ui-view="admin">
 <h1> Welcome home soldier </h1> 
</div> 

index_spec.js

If I do this then the test fails.

expect($('[ui-view="admin"]').isDisplayed()).toBe(true);

If I do this then the test success.

expect($('[ui-view="admin"]').isDisplayed()).toBe(false);

I have tried to do isPresent(), but it gives me the same result.

Aucun commentaire:

Enregistrer un commentaire