I am trying to test an Angular-webapp with protractor. After opening the app, you need to sign in, in order to access the REST API. When executing my tests with Chrome, the login dialog opens normally and I can input the login information, after which the tests run automatically and smoothly, but when I try setting the browser to firefox, the login dialog is dismissed and all tests fail.
The error message appears like this:
- Failed: Cannot read property 'ver' of null
- Failed: Dismissed user prompt dialog: http://localhost:4200 verlangt einen Benutzernamen und ein Passwort. Ausgabe der Website: "application"
(where 'verlangt einen Benutzernamen und ein Passwort. Ausgabe der Website: "application"' translates to 'requires a username and password. Output of the website: "application"') for the following test (which doesn't read any property ver):
it('Title contains title', () => {
expect(browser.getTitle()).toContain('title');
});
My protractor.conf.js looks like this:
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'firefox'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: require('path').join(__dirname, './tsconfig.json')
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
Is there any way to configure the webdriver such that Firefox doesn't dismiss the dialog or even to automatically fill in the dialog?