Injecting a mock into an AngularJS service

You can inject mocks into your service by using $provide. If you have the following service with a dependency that has a method called getSomething: angular.module(‘myModule’, []) .factory(‘myService’, function (myDependency) { return { useDependency: function () { return myDependency.getSomething(); } }; }); You can inject a mock version of myDependency as follows: describe(‘Service: myService’, function … Read more

Protractor e2e test case for downloading pdf file

I can currently set download path location Chrome capabilities: { ‘browserName’: ‘chrome’, ‘platform’: ‘ANY’, ‘version’: ‘ANY’, ‘chromeOptions’: { // Get rid of –ignore-certificate yellow warning args: [‘–no-sandbox’, ‘–test-type=browser’], // Set download path and avoid prompting for download even though // this is already the default on Chrome but for completeness prefs: { ‘download’: { ‘prompt_for_download’: … Read more