Testing an externally hosted app on HTTPS using Karma -
i have angularjs/flask app (serverside) redirects https version of if you're not on https. i'd use karma test app using https, btu can't locally without running https server on own computer (which hassle), pushed app heroku site (say @ mine.herokuapp.com
) has ssl. now, i'm trying run karma tests against external site config file like
var proxypath = 'mine.herokuapp.com'; files = [ ... ]; urlroot = '/_karma_/'; singlerun = true; browsers = ['chrome']; proxies = { '/': proxypath };
but when try run tests, error sandbox error: application document not accessible
upon navigating app. i'm positive nothing wrong on heroku side; can navigate there fine. there way test https in karma or on wild goose chase?
i had problem running dev site in iis redirect http requests https
i still haven't go working, can @ least load site inside iframe in karma runner
i had specify hostname , allow invalid ssl certificates proxyvalidatessl
this config (gruntjs) formatted.
config.set({ frameworks: [], files: [ 'assets/angular-scenario.js', 'node_modules/karma-ng-scenario/lib/adapter.js', 'tests/e2e/**/*spec.js'], urlroot: '/__e2e/', hostname: '10.0.0.3', proxyvalidatessl: false, proxies: { '/': 'https://10.0.0.3/' }, browsers: ['chrome'] });
the next problem ran use x-frame-options:deny http header stop external sites injecting mysite site inside iframes
i had change x-frame-options:sameorigin , dev site load inside karma runner within chrome.
my problem
i have following jasmine spec, navigateto works fine, hangs on expect() line , never returns.
describe('my app', function () { beforeeach(function () { browser().navigateto('/'); }); it('should redirect login', function () { expect(browser().location().url()).tobe('/login'); // <- hangs here }); });
update (6th sep 2013)
i did playing around see if working. app uses routes, , after removing otherwise route config worked. still need otherwise route still not happy yet. there must me in there stopping loading
fails with
app.config(['$routeprovider', function ($routeprovider) { $routeprovider .when('/foo', { templateurl: 'foo.tpl.html', controller: 'fooctrl', controlleras: 'ctrl' }).otherwise({ redirectto: '/foo' }); }]);
works with
app.config(['$routeprovider', function ($routeprovider) { $routeprovider .when('/foo', { templateurl: 'foo.tpl.html', controller: 'fooctrl', controlleras: 'ctrl' }); }]);
Comments
Post a Comment