I've been working on this code snippet:
browser.sleep(5000).then(function() {console.log('rotel:' + browser.rootEl)});
browser.ignoreSynchronization = true;
browser.rootEl = 'div#overview';
browser.driver.switchTo().defaultContent().then(function() {console.log('Switch default')});
browser.sleep(500);
browser.wait(function() { return browser.isElementPresent(by.css('[class="box-header"]'))}, 10000);
element(by.model("ssn")).sendKeys(pat + "\n").then(function() {console.log('sendkeys')});
browser.rootEl = 'body';
Whenever I remove the line with the browser wait, the testing proceeds smoothly. However, if I keep it in, I encounter this error message:
'Error while waiting for Protractor to sync with the page: "root element (body) has no injector. this may mean it is not inside ng-app."'
I'm confused as to why the wait function, which doesn't involve any Angular elements, fails while the "by.model" line works perfectly fine?
Also, it's puzzling because I distinctly remember it was functioning correctly earlier today before I stepped out for some errands.