forked from bluesmoon/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RT: Fix t_page and t_resp missing from the beacon
- Loading branch information
Showing
5 changed files
with
65 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<%= header %> | ||
<%= boomerangSnippet %> | ||
<script src="02-front-end-back-end.js" type="text/javascript"></script> | ||
<script> | ||
BOOMR_test.init({ | ||
testAfterOnBeacon: true | ||
}); | ||
</script> | ||
<%= footer %> |
51 changes: 51 additions & 0 deletions
51
tests/page-templates/19-navtiming/02-front-end-back-end.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*eslint-env mocha*/ | ||
/*global BOOMR_test,assert*/ | ||
|
||
describe("e2e/19-navtiming/02-front-end-back-end", function() { | ||
var tf = BOOMR.plugins.TestFramework; | ||
var t = BOOMR_test; | ||
|
||
it("Should have Front-End time (t_page) on the beacon (if NavigationTiming is supported)", function() { | ||
if (!t.isNavigationTimingSupported()) { | ||
return this.skip(); | ||
} | ||
|
||
assert.isNumber(tf.lastBeacon().t_page); | ||
}); | ||
|
||
it("Should not have Front-End time (t_page) on the beacon (if NavigationTiming is not supported)", function() { | ||
if (t.isNavigationTimingSupported()) { | ||
return this.skip(); | ||
} | ||
|
||
assert.isUndefined(tf.lastBeacon().t_page); | ||
}); | ||
|
||
it("Should have Back-End time (t_resp) on the beacon (if NavigationTiming is supported)", function() { | ||
if (!t.isNavigationTimingSupported()) { | ||
return this.skip(); | ||
} | ||
|
||
assert.isNumber(tf.lastBeacon().t_resp); | ||
}); | ||
|
||
it("Should not have Back-End time (t_resp) on the beacon (if NavigationTiming is not supported)", function() { | ||
if (t.isNavigationTimingSupported()) { | ||
return this.skip(); | ||
} | ||
|
||
assert.isUndefined(tf.lastBeacon().t_resp); | ||
}); | ||
|
||
it("Should have Back-End time + Front-End time equal Page Load time (t_resp + t_page = t_done) on the beacon (if NavigationTiming is supported)", function() { | ||
if (!t.isNavigationTimingSupported()) { | ||
return this.skip(); | ||
} | ||
|
||
var fe = parseInt(tf.lastBeacon().t_page, 10); | ||
var be = parseInt(tf.lastBeacon().t_resp, 10); | ||
var tt = parseInt(tf.lastBeacon().t_done, 10); | ||
|
||
assert.equal(fe + be, tt); | ||
}); | ||
}); |