Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix(e2e): add index-nocache.html to run e2e tests without cache
Browse files Browse the repository at this point in the history
using appcache while running e2e tests was causing the following
problems:
- Safari would occasionally reload the app (as a result of the appcache
  refresh) during the angular.validator.asychronous test, which would
  result in test failure and false positivy.
- Firefox6 would run the tests very slowly, disabling the cache resolved
  the latency issues
- Sometimes tests would run with stale code pulled from cache, which
  would result in flaky tests.
  • Loading branch information
IgorMinar committed Sep 26, 2011
1 parent ea3228e commit 2e9fed7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,24 @@ task :package => [:clean, :compile, :docs] do
end


File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-nocache.html", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js").
sub('/build/docs/', "/#{NG_VERSION.full}/docs-#{NG_VERSION.full}/")
end


File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-jq-nocache.html", File::RDWR) do |f|
text = f.read
f.truncate 0
f.rewind
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js").
sub('/build/docs/', "/#{NG_VERSION.full}/docs-#{NG_VERSION.full}/")
end


File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-debug.html", File::RDWR) do |f|
text = f.read
f.truncate 0
Expand Down
8 changes: 8 additions & 0 deletions docs/src/gen-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ function writeTheRest(writesFuture) {
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index.html',
writer.replace, {'doc:manifest': manifest}));

writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-nocache.html',
writer.replace, {'doc:manifest': ''}));


writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq.html',
writer.replace, {'doc:manifest': manifest}));

writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-nocache.html',
writer.replace, {'doc:manifest': ''}));


writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-debug.html',
writer.replace, {'doc:manifest': ''}));

Expand Down
4 changes: 2 additions & 2 deletions docs/src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,14 +570,14 @@ function scenarios(docs){
var specs = [];

specs.push('describe("angular+jqlite", function() {');
appendSpecs('');
appendSpecs('index-nocache.html#!/');
specs.push('});');

specs.push('');
specs.push('');

specs.push('describe("angular+jquery", function() {');
appendSpecs('index-jq.html#!/');
appendSpecs('index-jq-nocache.html#!/');
specs.push('});');

return specs.join('\n');
Expand Down

0 comments on commit 2e9fed7

Please sign in to comment.