In the browser, the angular produces errors that, in fact, do not affect the work, but I do not know how to fix them yet. The problem is that after an error appears in the console, the test crashes with a message about this error.
I'm not sure until the end, but this does not seem to be the default behavior of the protractor, - he, it seems, should not take into account the console without additional settings.
Next, I tried to install the plugin protractor-console-plugin , which should determine the reaction to events in the browser console, configuring it as follows:
plugins: [{ package: 'protractor-console-plugin', //pakage: '/usr/lib/node_modules/protractor-console-plugin', failOnWarning: false, failOnError: false, logWarnings: false }] But I did not get the desired result: the test continued to fall after an error in the browser console.
I understand that in the current version of the protractor there are mechanisms already built out of the box for this option, and they are by default configured to look at the console.
Tell me how to disable this thing? Or, alternatively, suggest some other test framework. But the protractor is preferable because it will be closer to the angular.
Config code:
exports.config = { directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { //'browserName': 'firefox' 'browserName': 'chrome' }, // Framework to use. Jasmine is recommended. framework: 'jasmine', // Spec patterns are relative to the current working directory when // protractor is called. specs: ['spec/avtorization_test.js'], // Options to be passed to Jasmine. jasmineNodeOpts: { defaultTimeoutInterval: 30000 }, plugins: [{ package: 'protractor-console-plugin', //pakage: '/usr/lib/node_modules/protractor-console-plugin', failOnWarning: false, failOnError: false, logWarnings: false }] }; Test code:
var testingAdress = 'http://localhost:1340', describe('admin avtorization test', function(){ beforeEach(function(){ // should be called before each it block }); it('should avtorizate as admin', function(){ browser.get(testingAdress); expect(browser.getCurrentUrl()).toEqual('localhost:1340'+'/#!/'); //element(by.linkText('Sign Up')).click(); //expect(browser.getCurrentUrl()).toEqual(testingAdress + '/#!/signup'); //element(by.id('myLink').click()); //expect(browser.getCurrentUrl()).toEqual("http://myUrl.com"); }); });