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

Commit 2e9fed7

Browse files
committed
fix(e2e): add index-nocache.html to run e2e tests without cache
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.
1 parent ea3228e commit 2e9fed7

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

Rakefile

+18
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,24 @@ task :package => [:clean, :compile, :docs] do
223223
end
224224

225225

226+
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-nocache.html", File::RDWR) do |f|
227+
text = f.read
228+
f.truncate 0
229+
f.rewind
230+
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js").
231+
sub('/build/docs/', "/#{NG_VERSION.full}/docs-#{NG_VERSION.full}/")
232+
end
233+
234+
235+
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-jq-nocache.html", File::RDWR) do |f|
236+
text = f.read
237+
f.truncate 0
238+
f.rewind
239+
f.write text.sub('angular.min.js', "angular-#{NG_VERSION.full}.min.js").
240+
sub('/build/docs/', "/#{NG_VERSION.full}/docs-#{NG_VERSION.full}/")
241+
end
242+
243+
226244
File.open("#{pkg_dir}/docs-#{NG_VERSION.full}/index-debug.html", File::RDWR) do |f|
227245
text = f.read
228246
f.truncate 0

docs/src/gen-docs.js

+8
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,17 @@ function writeTheRest(writesFuture) {
4848
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index.html',
4949
writer.replace, {'doc:manifest': manifest}));
5050

51+
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-nocache.html',
52+
writer.replace, {'doc:manifest': ''}));
53+
54+
5155
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq.html',
5256
writer.replace, {'doc:manifest': manifest}));
5357

58+
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-jq-nocache.html',
59+
writer.replace, {'doc:manifest': ''}));
60+
61+
5462
writesFuture.push(writer.copy('docs/src/templates/index.html', 'build/docs/index-debug.html',
5563
writer.replace, {'doc:manifest': ''}));
5664

docs/src/ngdoc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,14 @@ function scenarios(docs){
570570
var specs = [];
571571

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

576576
specs.push('');
577577
specs.push('');
578578

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

583583
return specs.join('\n');

0 commit comments

Comments
 (0)