I have an e2e testing using protractor. My test involves angular page and non-angular page. I have no problem to test on non-angular page. But I have an error when the test finished on the non-angular page and back to angular page.
My test starts from a home page(angular page) and click login button. This will redirect to a non-angular page. Finish typing username and password, then redirect to angular page again. I have issue on the last step when test back to angular page.
beforeAll(() => {
page = new Abcflow();
});
fdescribe('step 1', () => {
beforeEach(async () => await page.navigateToStart());
fit('login as staff and come back to home page', async () => {
//start from an angular page
await page.clickButton('a', 'Login / Register');
//now in a non-angular page
browser.driver.findElement(by.id('Email')).sendKeys('email');
browser.driver.findElement(by.id('Password')).sendKeys('password');
browser.driver.findElement(by.name('button')).click();
//navigate back to angular page
await page.navigateToStart();
expect(await page.getPageTitleText()).toEqual('abc title');
});
});
I can see my test page came back from non-angular page to the angular page. Then I got error like
- Failed: Error while waiting for Protractor to sync with the page: "both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor's bootstrapping. See https://github.com/angular/protractor/issues/2643 for details"
I have tried to add the lines:
browser.ignoreSynchronization = true;
browser.waitForAngularEnabled(false);
Then I got another error said "No element found using locator". The funny thing is if I don't test the login page and just go for the last line, it will pass successfully. Seems like the angular page tests stopped working after navigating from non-angular page.