1

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?

Nico
  • 255
  • 2
  • 12

1 Answers1

0

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

Community
  • 1
  • 1
Ashley Coolman
  • 11,095
  • 5
  • 59
  • 81