I have a simple service that sets cookies in angular, but there is no obvious way to verify that they were set in an end-to-end test.
The code for testing is simple as
var splashApp = angular.module('splashApp', ['ngCookies']); splashApp.controller('FooterController', function ($location, $cookies) { $cookies.some_cookie = $location.absUrl(); });
But I can not find any documents on how to test. Here is what I found:
I also tried
angular.scenario.dsl('cookies', function() { var chain = {}; chain.get = function(name) { return this.addFutureAction('get cookies', function($window, $document, done) { var injector = $window.angular.element($window.document.body).inheritedData('$injector'); var cookies = injector.get('$cookies'); done(null, cookies); }); }; return function() { return chain; } });
But this only returns cookies for the parent browser, not the page I want to check.
Any examples of how to do this?
source share