I have these two booleans in a configuration object that I pass to the angular application constant.
These logical values ββare checked at the point allowed by the page. If both of them are true, it remains on the page, and if one or the other is true, it bounces the user to the specified page.
See code below
angular .module('ecardGeneratorPrototype') .constant('config', { "enable-file-upload": true, "enable-webcam": true
Then I check them in the resolution function:
.when('/home', { templateUrl: 'app/home/home.html', controller: 'HomeController', controllerAs: 'home', resolve : { choice: ['$route', '$window', 'config', function ($route, $window, config) { if ( config["enable-file-upload"] && config["enable-webcam"] ){ //return return; } else { if ( config["enable-file-upload"] ){ //go to the file upload page //$log( "display the file upload page" ); $window.location.href = '#/file-upload'; } else if ( config["enable-webcam"] ){ //$log( "display the webcam page" ); $window.location.href = '#/webcam'; } } return; }] } })
My question is: can I override these constants to check if the pages in my protractor tests are redirected correctly?
source share