Angular 2 Protractor: Click div element -
my html code looks this:
<div class="btn-login1 btn-login-email" (click)="optionselected('email')"> <i class="fa fa-at fa-fw"></i><span> sign in email </span> </div> using protractor, need test click function. have code in test case:
ele = element(by.css('.btn-login1')); expect(ele).tobetruthy(); ele.click(); when run test case, error:
failed: timed out waiting asynchronous angular tasks finish after 11 seconds. may because current page not angular application. please see faq more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular while waiting element locator - locator: by(css selector, .btn-login1)
i have updated configuration file timeout value , still similar error timeout. believe because div element being clicked. other test case button being clicked works fine.
how go writing test case?
since you're not testing angular application need set:
browser.ignoresynchronization = true; even if angular application try this.
i find best results including entire attribute when locating elements like:
ele = element(by.css('[class="btn-login1 btn-login-email"]'));
Comments
Post a Comment