-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(tracing): Add TTFB tests. (#4424)
- Loading branch information
1 parent
5b0a53e
commit 3f2bf69
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/template.hbs
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,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
<script src="{{htmlWebpackPlugin.options.initialization}}"></script> | ||
</head> | ||
<body> | ||
<div>Rendered</div> | ||
</body> | ||
</html> |
13 changes: 13 additions & 0 deletions
13
packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/test.ts
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,13 @@ | ||
import { expect } from '@playwright/test'; | ||
|
||
import { sentryTest } from '../../../../utils/fixtures'; | ||
import { getSentryTransactionRequest } from '../../../../utils/helpers'; | ||
|
||
sentryTest('should capture TTFB vital.', async ({ getLocalTestPath, page }) => { | ||
const url = await getLocalTestPath({ testDir: __dirname }); | ||
const eventData = await getSentryTransactionRequest(page, url); | ||
|
||
expect(eventData.measurements).toBeDefined(); | ||
expect(eventData.measurements?.ttfb?.value).toBeDefined(); | ||
expect(eventData.measurements?.['ttfb.requestTime']?.value).toBeDefined(); | ||
}); |