I'm running protractor, it runs successfully and load my angular app. The very first test I wrote is to get the sign-up button. Although I can see the sign-up button in my view and I'm targeting it with proper CSS.
Still, all I get is this error after running the test.
App
✗ should get the text of sign up button
- Failed: script timeout: result was not received in 11 seconds
(Session info: chrome=71.0.3578.98)
(Driver info: chromedriver=2.45.615355 (d5698f682d8b2742017df6c81e0bd8e6a3063189),platform=Mac OS X 10.14.2 x86_64)
I've tried to increase the allScriptsTimeout
in the protractor.conf.ts
file but to no avail.
app.e2e-spec.ts file
it('should get the text of sign up button', () => {
page.navigateTo();
expect<any>(page.getButtonText()).toEqual('Sign up');
});
app.po.ts
getButtonText() {
return element(by.css('a[data-e2e="nav-signup"]')).getText();
}
navigateTo() {
return browser.get('/');
}
What might I be doing wrong here?