I want to use ngScenario to test my NG scripts. But I have no idea how to load it...
Besides loading the JS file using <script>
tag, how to make it work? Please give a full sample.
There number of way to kick-start e2e tests execution, the most common one being a standalone HTML file or a test runner.
To trigger e2e tests execution via HTML file one would write something like:
<html lang="en">
<head>
<title>End2end Test Runner</title>
<script src="http://code.angularjs.org/1.0.3/angular-scenario.js" ng-autotest></script>
<script src="app.scenario.js"></script>
</head>
<body>
</body>
</html>
Please note several things about this approach:
angular-scenario.js
file first. It includes all the necessary dependencies (including jQuery and AngularJS) so there is no need to include other files.app.scenario.js
)ng-autotest
attribute on the tagfile://
protocol won't work here.Another approach (probably preferred in reality) is to use a test runner and execute e2e tests as part of the continuous build. Using Karma is a popular option in the AngularJS community. A sample configuration for the Karma executing e2e tests can be found here: https://github.com/angular/angular-seed/blob/master/config/karma-e2e.conf.js