diff options
| author | Di Peng | 2011-07-14 18:28:15 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-07-17 22:19:08 -0700 | 
| commit | f9b4c9da648f81aef1fbee41d24822e420eb56f9 (patch) | |
| tree | 35d40aeda6d1aca27d4b283faf8d84a776b0a141 /docs/src/ngdoc.js | |
| parent | 83ac1193f2322f71f314e7e160af46142b01a290 (diff) | |
| download | angular.js-f9b4c9da648f81aef1fbee41d24822e420eb56f9.tar.bz2 | |
refactor(docs): run e2e tests with and without jquery
- e2e tests will run index.html (without jquery) and with
index-jq.html(with jquery).
- many small changes to make e2e tests work withough JQuery as we
discover problems that were previously hidden by using real JQuery.
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 41 | 
1 files changed, 27 insertions, 14 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 148a400f..91c4662a 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -546,22 +546,35 @@ Doc.prototype = {  //////////////////////////////////////////////////////////  function scenarios(docs){    var specs = []; -  docs.forEach(function(doc){ -    specs.push('describe("' + doc.section + '/' + doc.id + '", function(){'); -    specs.push('  beforeEach(function(){'); -    specs.push('    browser().navigateTo("index.html#!/' + doc.section + '/' + doc.id + '");'); -    specs.push('  });'); -    specs.push(''); -    doc.scenarios.forEach(function(scenario){ -      specs.push(indent(trim(scenario), 2)); + +  specs.push('describe("angular without jquery", function() {'); +  appendSpecs('index.html'); +  specs.push('});'); + +  specs.push(''); +  specs.push(''); + +  specs.push('describe("angular with jquery", function() {'); +  appendSpecs('index-jq.html'); +  specs.push('});'); + +  return specs.join('\n'); + +  function appendSpecs(htmlFile) { +    docs.forEach(function(doc){ +      specs.push('  describe("' + doc.section + '/' + doc.id + '", function(){'); +      specs.push('    beforeEach(function(){'); +      specs.push('      browser().navigateTo("' + htmlFile + '#!/' + doc.section + '/' + doc.id + '");'); +      specs.push('    });'); +      specs.push('  '); +      doc.scenarios.forEach(function(scenario){ +        specs.push(indent(trim(scenario), 4)); +        specs.push(''); +      }); +      specs.push('});');        specs.push('');      }); -    specs.push('});'); -    specs.push(''); -    if (doc.scenario) { -    } -  }); -  return specs.join('\n'); +  }  } | 
