1
votes

I'm trying to create some tests for my app, using protractor.

The browser.get is ok, and when my page is loaded and my app bootstraped, the first test is running.

it('should go to the where and when page', function() {     
  var nextButton = element(by.id('cg_btnValidationQuoi'));
  expect(nextButton.getText()).toBe('Suivant');
}

This cause a timedout.

it('should go to the where and when page', function() {     
  var nextButton = element(by.id('cg_btnValidationQuoi'));
  nextButton.click()
}

Cause "Error: No element found using locator: By.id("cg_btnValidationQuoi")"

it('should go to the where and when page', function() {     
  var nextButton = element(by.id('cg_btnValidationQuoi'));
  expect(nextButton.getInnerHtml()).toBe('Suivant');
}

Cause :

Message:
  Expected '
         Suivant
     ' to be 'Suivant'.

Does it sound like anything that anybody knows?

1
Which protractor version do you use ? - gontard
This is very strange indeed, we're clearly missing something. Could you give us more code/info? - glepretre
I cannot paste you the original code, but I wrote a simily copy! Find it here: jsfiddle.net/89AR9 - Nico

1 Answers

0
votes

toBe() checks to see if its the exact same object (string). I'd suggest using toEqual() and see if it works. More info in this SO Answer