E2E testing remote AngularJS application -
i'm trying realize e2e testing of existing angularjs application karma test runner. application located on host1.internal
, i'm on host2.internal
. in karma config file have:
proxies = { '/': 'http://host1.internal/', };
before logging in shows different <div>
's inside of index.html
, after logging in hides visible before divs ng-hide='loggedin'
. problem partial view files being fetched <div ng-view>
angularjs routing config that:
$routeprovider. when('/', { controller: overviewcontroller, templateurl: 'views/overview.html', // templateurl: 'http://host2.internal/views/overview.html', title_prefix: 'home' }). etc. etc. etc.
and these errors in browser's console:
get http://localhost:9876/views/homepage.html 404 (not found)
as can see in routing config code snippet, i've tried getting templates full url, unfortunately, request not simple get
, it's options
(i'm not sure why?) , i'm getting error old access-control-allow-origin header.
how configure proxy in karma config correctly fetch these static files? or other solution?
thanks!
i've found solution problem, i've put $templatecache
use. way html files being loaded in 1 .js file rest scripts on index.html
.
if use grunt me, @ grunt-html2js.
cheers!
Comments
Post a Comment