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 --- docs/cookbook.deeplinking.ngdoc | 8 ++++---- docs/examples/settings.html | 18 ++++++++++++++++++ docs/examples/welcome.html | 5 +++++ docs/src/gen-docs.js | 26 +++++++++++++------------- docs/src/templates/docs-scenario.html | 2 +- docs/src/writer.js | 2 +- docs/static/settings.html | 18 ------------------ docs/static/welcome.html | 5 ----- 8 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 docs/examples/settings.html create mode 100644 docs/examples/welcome.html delete mode 100644 docs/static/settings.html delete mode 100644 docs/static/welcome.html (limited to 'docs') diff --git a/docs/cookbook.deeplinking.ngdoc b/docs/cookbook.deeplinking.ngdoc index 5270eb16..7d69ee84 100644 --- a/docs/cookbook.deeplinking.ngdoc +++ b/docs/cookbook.deeplinking.ngdoc @@ -34,8 +34,8 @@ In this example we have a simple app which consist of two screens: The two partials are defined in the following URLs: -* {@link ./static/settings.html} -* {@link ./static/welcome.html} +* {@link ./examples/settings.html} +* {@link ./examples/welcome.html} @@ -44,8 +44,8 @@ The two partials are defined in the following URLs: AppCntl.$inject = ['$route'] function AppCntl($route) { // define routes - $route.when("", {template:'./static/welcome.html', controller:WelcomeCntl}); - $route.when("/settings", {template:'./static/settings.html', controller:SettingsCntl}); + $route.when("", {template:'./examples/welcome.html', controller:WelcomeCntl}); + $route.when("/settings", {template:'./examples/settings.html', controller:SettingsCntl}); $route.parent(this); // initialize the model to something useful diff --git a/docs/examples/settings.html b/docs/examples/settings.html new file mode 100644 index 00000000..2fa5dca8 --- /dev/null +++ b/docs/examples/settings.html @@ -0,0 +1,18 @@ + + + +
+ + + [ X ] +
+
+ [ add ] +
+ + + \ No newline at end of file diff --git a/docs/examples/welcome.html b/docs/examples/welcome.html new file mode 100644 index 00000000..b085123d --- /dev/null +++ b/docs/examples/welcome.html @@ -0,0 +1,5 @@ +Hello {{person.name}}, +
+ Your contact information: +
{{contact.type}}: {{contact.url|linky}}
+
diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 83e33942..464916b1 100644 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -25,22 +25,22 @@ var writes = callback.chain(function(){ var metadata = ngdoc.metadata(docs); writer.output('docs-keywords.js', ['NG_PAGES=', JSON.stringify(metadata).replace(/{/g, '\n{'), ';'], writes.waitFor()); writer.copyDir('img', writes.waitFor()); - writer.copyDir('static', writes.waitFor()); - writer.copy('index.html', writes.waitFor()); - writer.copy('docs.js', writes.waitFor()); - writer.copy('docs.css', writes.waitFor()); - writer.copy('doc_widgets.js', writes.waitFor()); - writer.copy('doc_widgets.css', writes.waitFor()); - writer.copy('docs-scenario.html', writes.waitFor()); + writer.copyDir('examples', writes.waitFor()); + writer.copyTpl('index.html', writes.waitFor()); + writer.copyTpl('docs.js', writes.waitFor()); + writer.copyTpl('docs.css', writes.waitFor()); + writer.copyTpl('doc_widgets.js', writes.waitFor()); + writer.copyTpl('doc_widgets.css', writes.waitFor()); + writer.copyTpl('docs-scenario.html', writes.waitFor()); writer.output('docs-scenario.js', ngdoc.scenarios(docs), writes.waitFor()); writer.output('sitemap.xml', new SiteMap(docs).render(), writes.waitFor()); writer.output('robots.txt', 'Sitemap: http://docs.angularjs.org/sitemap.xml\n', writes.waitFor()); - writer.copy('syntaxhighlighter/shBrushJScript.js', writes.waitFor()); - writer.copy('syntaxhighlighter/shBrushXml.js', writes.waitFor()); - writer.copy('syntaxhighlighter/shCore.css', writes.waitFor()); - writer.copy('syntaxhighlighter/shCore.js', writes.waitFor()); - writer.copy('syntaxhighlighter/shThemeDefault.css', writes.waitFor()); - writer.copy('jquery.min.js', writes.waitFor()); + writer.copyTpl('syntaxhighlighter/shBrushJScript.js', writes.waitFor()); + writer.copyTpl('syntaxhighlighter/shBrushXml.js', writes.waitFor()); + writer.copyTpl('syntaxhighlighter/shCore.css', writes.waitFor()); + writer.copyTpl('syntaxhighlighter/shCore.js', writes.waitFor()); + writer.copyTpl('syntaxhighlighter/shThemeDefault.css', writes.waitFor()); + writer.copyTpl('jquery.min.js', writes.waitFor()); }); writes.onDone(function(){ console.log('DONE. Generated ' + docs.length + ' pages in ' + diff --git a/docs/src/templates/docs-scenario.html b/docs/src/templates/docs-scenario.html index bc244d5d..fcc70431 100644 --- a/docs/src/templates/docs-scenario.html +++ b/docs/src/templates/docs-scenario.html @@ -2,7 +2,7 @@ <angular/> Docs Scenario Runner - + diff --git a/docs/src/writer.js b/docs/src/writer.js index 3251b9cd..cf54e1a3 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -49,7 +49,7 @@ exports.makeDir = function (path, callback) { })(); }; -exports.copy = function(filename, callback){ +exports.copyTpl = function(filename, callback) { copy('docs/src/templates/' + filename, OUTPUT_DIR + filename, callback); }; diff --git a/docs/static/settings.html b/docs/static/settings.html deleted file mode 100644 index 2fa5dca8..00000000 --- a/docs/static/settings.html +++ /dev/null @@ -1,18 +0,0 @@ - - - -
- - - [ X ] -
-
- [ add ] -
- - - \ No newline at end of file diff --git a/docs/static/welcome.html b/docs/static/welcome.html deleted file mode 100644 index b085123d..00000000 --- a/docs/static/welcome.html +++ /dev/null @@ -1,5 +0,0 @@ -Hello {{person.name}}, -
- Your contact information: -
{{contact.type}}: {{contact.url|linky}}
-
-- cgit v1.2.3