jeudi 26 mai 2016

Protractor tests inconsistently passing / failing

The problem that I have with this test is that sometimes it passes, sometimes it fails, and when it does the latter a "Failed: No element found using locator: By(css selector, .add.create_ServiceOrders)" message appears in the console. Idk what to do to fix it :(

 describe('angularjs homepage', function() {

   it('should greet the named user', function() {     
  //browser.ignoreSynchronization = true
  browser.get('http://ift.tt/1TE7G9U');
  browser.waitForAngular();

  var input = element(by.model('loginInfo.login'));
  input.sendKeys('xxx');
  expect(input.getAttribute('value')).toBe('xxx');

  var input = element(by.model('loginInfo.password'));
  input.sendKeys('yyy');
  expect(input.getAttribute('value')).toBe('yyy');

  browser.waitForAngular(); 

  browser.driver.actions().sendKeys(protractor.Key.ENTER).perform();

  browser.waitForAngular(); 

  var AddButton = element(by.css(".add.create_ServiceOrders" ));
  browser.actions().mouseDown(AddButton).mouseUp().perform();   
  browser.actions().mouseMove(AddButton).click().perform();

  browser.waitForAngular(); 

  var AddButton = element(by.css(".icon-standard-issue-floors" ));
  browser.actions().mouseDown(AddButton).mouseUp().perform();  
  browser.actions().mouseMove(AddButton).click().perform();

  browser.waitForAngular(); 
  .....
 });
});

Aucun commentaire:

Enregistrer un commentaire