Hi,

I have a single page site that requires a user to login. I've managed to 
get the login to work using the onPrepare of the config file I'm using as 
part of the tests I have 

onPrepare: function(){

   browser.driver.get(env.baseUrl);


   // find the sign in button
   browser.driver.findElement(by.id('homepage_sign_in_btn')).click();
   browser.sleep(1000);

   // fire click event of the sign in button
   // check that the Sign In to Lifecake panel is opened
   // enter a email address
   
browser.driver.findElement(by.id('sign-in-menu-email')).sendKeys('[email protected]');

   // enter the password
   
browser.driver.findElement(by.id('sign-in-menu-password')).sendKeys('Space99Ship');
   browser.sleep(1000);

   // click the sign in button
   browser.driver.findElement(by.id('home_menu_sign_in_btn')).click();

   return browser.driver.wait(function(){
      return browser.driver.getCurrentUrl().then(function(url){
         return url + '/index.html#/photos';
      })
   }, 10000)

}


This is great, it successfully logs into the site. Then when my tests run I 
keep getting timeout errors. If I add the beforeEach statement like this:

beforeEach(function () {
   browser.get(browser.baseUrl + '/index.html#/photos');
});



The user is logged at as it seems a new browser version opens, so none of 
the login process has happened. If I take this out the test time out, 
looking like the tests cannot access the logged in version of the site.  

Any suggestions on how I can keep the logged in state when running the 
tests? And avoiding the timeout problems 

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to