Skip to content

Commit

Permalink
test(tracing): Add TTFB tests. (#4424)
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Jan 20, 2022
1 parent 5b0a53e commit 3f2bf69
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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>
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();
});

0 comments on commit 3f2bf69

Please sign in to comment.