From 1abdc097b235366759a889bdcc68359653a9b8a3 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 19 May 2011 17:33:25 +0200 Subject: JSTD adapter for running e2e tests Couple of changes into angular.scenario runner: - add autotest config (runs tests when document ready) - update ObjectModel (forwards events) - use only one ObjectModel instance for all outputters - expose error msg and line number in ObjectModel.Spec and ObjectModel.Step - fix generating spec.ids - fix 'html' output so that it does not mutate ObjectModel Couple of changes into docs / generator: - rename copy -> copyTpl - move docs/static into docs/examples (to avoid conflict with jstd proxy) Running all docs e2e tests: ======================================================== 1/ compile angular-scenario, jstd-scenario-adapter >> rake compile 2/ build docs >> rake docs 3/ start jstd server >> ./server-scenario.sh 4/ capture some browser 5/ run node server to serve static content >> node ../lib/nodeserver/server.js 6/ run tests >> ./test-scenario.sh --- test/scenario/output/HtmlSpec.js | 5 +++-- test/scenario/output/jsonSpec.js | 5 +++-- test/scenario/output/objectSpec.js | 5 +++-- test/scenario/output/xmlSpec.js | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'test/scenario/output') diff --git a/test/scenario/output/HtmlSpec.js b/test/scenario/output/HtmlSpec.js index f973397e..6694bb45 100644 --- a/test/scenario/output/HtmlSpec.js +++ b/test/scenario/output/HtmlSpec.js @@ -1,5 +1,5 @@ describe('angular.scenario.output.html', function() { - var runner, spec, listeners; + var runner, model, spec, listeners; var ui, context; beforeEach(function() { @@ -22,8 +22,9 @@ describe('angular.scenario.output.html', function() { line: function() { return 'unknown:-1'; } }; runner = new angular.scenario.testing.MockRunner(); + model = new angular.scenario.ObjectModel(runner); context = _jQuery("
"); - ui = angular.scenario.output.html(context, runner); + ui = angular.scenario.output.html(context, runner, model); }); it('should create nested describe context', function() { diff --git a/test/scenario/output/jsonSpec.js b/test/scenario/output/jsonSpec.js index afc74a21..2c56b297 100644 --- a/test/scenario/output/jsonSpec.js +++ b/test/scenario/output/jsonSpec.js @@ -1,13 +1,14 @@ describe('angular.scenario.output.json', function() { var output, context; - var runner, $window; + var runner, model, $window; var spec, step; beforeEach(function() { $window = {}; context = _jQuery(''); runner = new angular.scenario.testing.MockRunner(); - output = angular.scenario.output.json(context, runner); + model = new angular.scenario.ObjectModel(runner); + output = angular.scenario.output.json(context, runner, model); spec = { name: 'test spec', definition: { diff --git a/test/scenario/output/objectSpec.js b/test/scenario/output/objectSpec.js index 73c3dcf9..9fc2f7d4 100644 --- a/test/scenario/output/objectSpec.js +++ b/test/scenario/output/objectSpec.js @@ -1,13 +1,14 @@ describe('angular.scenario.output.object', function() { var output; - var runner, $window; + var runner, model, $window; var spec, step; beforeEach(function() { $window = {}; runner = new angular.scenario.testing.MockRunner(); + model = new angular.scenario.ObjectModel(runner); runner.$window = $window; - output = angular.scenario.output.object(null, runner); + output = angular.scenario.output.object(null, runner, model); spec = { name: 'test spec', definition: { diff --git a/test/scenario/output/xmlSpec.js b/test/scenario/output/xmlSpec.js index fbfabcc4..a0e92639 100644 --- a/test/scenario/output/xmlSpec.js +++ b/test/scenario/output/xmlSpec.js @@ -1,13 +1,14 @@ describe('angular.scenario.output.json', function() { var output, context; - var runner, $window; + var runner, model, $window; var spec, step; beforeEach(function() { $window = {}; context = _jQuery(''); runner = new angular.scenario.testing.MockRunner(); - output = angular.scenario.output.xml(context, runner); + model = new angular.scenario.ObjectModel(runner); + output = angular.scenario.output.xml(context, runner, model); spec = { name: 'test spec', definition: { -- cgit v1.2.3