0

I'm so new in writing scenarios for e2e testing in Angularjs. I want to write a scenario to test the login. I have a form which has an email field as follow:

<input type="email" placeholder="Enter your e-mail" name="email" ng-model="form.email" value="" required autofocus > 

And in my scenario I'm having having the following line which tries to pass some email address to that input field:

input('form.email').enter('blabla@blabla.com'); 

But unfortunately I'me getting the following error after running the test:

6ms input 'form.email' enter 'blabla@blabla.com'
Selector [ng\:model="form.email"] did not match any elements.


Any suggestion?

Sherry
  • 66
  • 5
  • I'm not seeing any problem in this example: http://plnkr.co/edit/yyF0YWIQ1zq0gMMwMv4X Can you produce an example which fails? – Piran Feb 07 '13 at 16:35
  • Thanks for your reply. After checking your example, I found out my problem is not regarding input(name), Seems like I cant give the correct address in browser().navigateTo('../../partials/login.html'). I just wonder why it shows 'browser navigate to '../../views/login.html' in green if it cant navigate to that page!!! – Sherry Feb 08 '13 at 13:49
  • I've had a go but I can't trap the error: See http://stackoverflow.com/a/6867890 which says it doesn't apear to be possible. – Piran Feb 11 '13 at 13:03

1 Answers1

0

check to make sure that you have:

browser().navigateTo('/');

Without navigating first angular does not have any reference to the DOM.

You can also use :

pause();

To see exactly what the browser is displaying at the given time when running an e2e test.

bktz
  • 41
  • 6