I have several protractor tests and sometimes I get a error saying:
Message:
timeout: timed out after 10000 msec waiting for spec to complete
Stacktrace:
undefined
It can be randomly happening on some tests. I usually test on BrowserStack and it shows the error once in 3-5 builds. But recently I tried SauceLabs and almost every (every!) but not all the tests fail with that error. Probably, SauceLabs are just significantly slower so I get the error more often...
So here are the questions:
- Is there a way in Protractor/Selenium to change test running timeout? It needs to be changed on BrowserStack/Saucelabs as well.
- Why am I getting the error so often? Is there anything wrong with my tests? Most of the doesn't seem complicated or long running. Again, on local machine it's almost always fine.
Here is the example:
it('should check that login gives error on empty or incorrect email', function () {
p.get('/#/login');
p.findElement(protractor.By.css('button[type="submit"]')).click();
expect(p.findElement(protractor.By.css('.alert-danger')).getText()).toEqual('E-mailadres is niet geldig');
p.findElement(protractor.By.model('user.email')).sendKeys('test-1xtc.vc');
p.findElement(protractor.By.css('button[type="submit"]')).click();
expect(p.findElement(protractor.By.css('.alert-danger')).getText()).toEqual('E-mailadres is niet geldig');
p.findElement(protractor.By.model('user.email')).clear();
});
The app is using AngularJS, selenium 2.20, protractor 0.20.1