From fec4ef38815340e8e5a6b65fd6c08f5c74e701d8 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 3 Apr 2013 14:36:57 -0700 Subject: feat(Scenario): autodisable animations when running e2e tests animations cause the dom to contain elements that have been removed from the model but are being animated out. we could teach the e2e runner to wait for animations but that would make all tests slower. it should be quite safe to just disable animations automatically when the app is running via the e2e test runner. this change disables only css animations. we should make additional change that disables js animations as well, but since we don't need this right now I'm punting on it. --- test/ngScenario/ApplicationSpec.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ngScenario/ApplicationSpec.js b/test/ngScenario/ApplicationSpec.js index 0236b8d7..cb9fb478 100644 --- a/test/ngScenario/ApplicationSpec.js +++ b/test/ngScenario/ApplicationSpec.js @@ -9,11 +9,20 @@ describe('angular.scenario.Application', function() { } beforeEach(function() { + document.body.innerHTML = ''; frames = _jQuery("
"); + _jQuery(document.body).append(frames); app = new angular.scenario.Application(frames); }); - it('should return new $window and $document after navigate', function() { + + afterEach(function() { + _jQuery('iframe').unbind(); // cleanup any leftover onload handlers + document.body.innerHTML = ''; + }); + + + it('should return new $window and $document after navigateTo', function() { var called; var testWindow, testDocument, counter = 0; app.getWindow_ = function() { -- cgit v1.2.3