Hi I am working on an app that has a non-angular interface and new modules with angular on it. It is in a transition phase. I was trying to use protractor for my tests, but some require to be logged and the login page is in PHP. I already knew that something was to be done to test a non-angular page which I did in my conf:
exports.config = {
specs: ['app/**/*.e2e.js'],
baseUrl: 'http://localhost:8099/ma#',
maxSessions: 1,
framework: 'jasmine2',
// rootElement: 'myApp',
multiCapabilities: [
{
browserName: 'chrome',
chromeOptions: {
args: [
'--disable-cache',
'--disable-application-cache',
'--disable-offline-load-stale-cache',
'--disk-cache-size=0',
'--v8-cache-options=off'
]
}
}
],
jasmineNodeOpts: {
isVerbose: false,
showColors: true,
includeStackTrace: true,
defaultTimeoutInterval: 50000
},
// getPageTimeout: 500000,
onPrepare: function () {
browser.driver.ignoreSynchronization = true;
browser.driver.wait(browser.driver.get('http://localhost:8099/Authentication.php'));
browser.driver.sleep(1000);
browser.driver.findElement(by.id('input_login')).sendKeys('login');
browser.driver.findElement(by.id('input_password')).sendKeys('pass');
browser.driver.findElement(by.id('submit_button')).click();
return browser.wait(function(){
browser.get('/ma#/99/page/');
browser.waitForAngular();
}, 1000);
}
};
Then in my test I do the following:
describe('Test Spec', function () {
it('should get the correct title', function () {
expect(browser.getCurrentUrl()).toBe('http://localhost:8099/ma#/99/page/');
});
});
But all I get are various errors to do with timeouts such as:
Error: Error: Wait timed out after 14074ms
or
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
or the infamous
Uncaught exception: Error while waiting for Protractor to sync with the page: "angular could not be found on the window"
I am lost here, can anybody enlighten me ?