diff options
| author | Elliott Sprehn | 2010-10-19 13:17:49 -0700 |
|---|---|---|
| committer | Elliott Sprehn | 2010-10-20 14:38:00 -0700 |
| commit | 2115db69035c5993533fe7a3825e64cf6e9068ad (patch) | |
| tree | 796a502b28cd2bda8108a672eac0bf28c8bc21d4 /src/scenario/Runner.js | |
| parent | 9c8b1800b90e14b643bab6ada8e96f8f850e84a6 (diff) | |
| download | angular.js-2115db69035c5993533fe7a3825e64cf6e9068ad.tar.bz2 | |
Lots of stability and performance updates and UI polish too.
Polish the Scenario Runner UI to include:
- a scroll pane that steps appear in since the list can be very long
- Collapse successful tests
- Show the line where the DSL statements were when there's an error (Chrome, Firefox)
Also:
- Remove lots angular.bind calls to reduce the amount of stack space used.
- Use setTimeout(...,0) to schedule the next future to let the browser breathe and have it repaint the steps. Also prevents overflowing the stack when an it() creates many futures.
- Run afterEach() handlers even if the it() block fails.
- Make navigateTo() take a function as the second argument so you can compute a URL in the future.
- Add wait() DSL statement to allow interactive debugging of tests.
- Allow custom jQuery selectors with element(...).query(fn) DSL statement.
Known Issues:
- All afterEach() handlers run even if a beforeEach() handler fails. Only after handlers for the same level as the failure and above should run.
Diffstat (limited to 'src/scenario/Runner.js')
| -rw-r--r-- | src/scenario/Runner.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scenario/Runner.js b/src/scenario/Runner.js index 55360592..a8b23f83 100644 --- a/src/scenario/Runner.js +++ b/src/scenario/Runner.js @@ -91,6 +91,7 @@ angular.scenario.Runner.prototype.run = function(ui, application, specRunnerClas }); angular.foreach(angular.scenario.dsl, function(fn, key) { self.$window[key] = function() { + var line = callerFile(3); var scope = angular.scope(runner); // Make the dsl accessible on the current chain @@ -103,10 +104,12 @@ angular.scenario.Runner.prototype.run = function(ui, application, specRunnerClas // Make these methods work on the current chain scope.addFuture = function() { - return angular.scenario.SpecRunner.prototype.addFuture.apply(scope, arguments); + Array.prototype.push.call(arguments, line); + return specRunnerClass.prototype.addFuture.apply(scope, arguments); }; scope.addFutureAction = function() { - return angular.scenario.SpecRunner.prototype.addFutureAction.apply(scope, arguments); + Array.prototype.push.call(arguments, line); + return specRunnerClass.prototype.addFutureAction.apply(scope, arguments); }; return scope.dsl[key].apply(scope, arguments); |
