-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(remix): Update remix E2E tests to avoid sending to Sentry
Part of #11910
- Loading branch information
Showing
51 changed files
with
665 additions
and
1,591 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
5 changes: 0 additions & 5 deletions
5
dev-packages/e2e-tests/test-applications/create-next-app/tests/server-transactions.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
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
192 changes: 0 additions & 192 deletions
192
...2e-tests/test-applications/create-remix-app-express-legacy/tests/behaviour-client.test.ts
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...s/e2e-tests/test-applications/create-remix-app-express-legacy/tests/client-errors.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,29 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForError } from '@sentry-internal/test-utils'; | ||
|
||
test('Sends a client-side exception to Sentry', async ({ page }) => { | ||
const errorPromise = waitForError('create-remix-app-express-legacy', errorEvent => { | ||
return errorEvent.exception?.values?.[0].value === 'I am an error!'; | ||
}); | ||
|
||
await page.goto('/'); | ||
|
||
const exceptionButton = page.locator('id=exception-button'); | ||
await exceptionButton.click(); | ||
|
||
const errorEvent = await errorPromise; | ||
|
||
expect(errorEvent).toBeDefined(); | ||
}); | ||
|
||
test('Sends a client-side ErrorBoundary exception to Sentry', async ({ page }) => { | ||
const errorPromise = waitForError('create-remix-app-express-legacy', errorEvent => { | ||
return errorEvent.exception?.values?.[0].value === 'Sentry React Component Error'; | ||
}); | ||
|
||
await page.goto('/client-error'); | ||
|
||
const errorEvent = await errorPromise; | ||
|
||
expect(errorEvent).toBeDefined(); | ||
}); |
57 changes: 57 additions & 0 deletions
57
...tests/test-applications/create-remix-app-express-legacy/tests/client-transactions.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,57 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForTransaction } from '@sentry-internal/test-utils'; | ||
|
||
test('Sends a pageload transaction to Sentry', async ({ page }) => { | ||
const transactionPromise = waitForTransaction('create-remix-app-express-legacy', transactionEvent => { | ||
return transactionEvent.contexts?.trace?.op === 'pageload' && transactionEvent.transaction === 'routes/_index'; | ||
}); | ||
|
||
await page.goto('/'); | ||
|
||
const transactionEvent = await transactionPromise; | ||
|
||
expect(transactionEvent).toBeDefined(); | ||
}); | ||
|
||
test('Sends a navigation transaction to Sentry', async ({ page }) => { | ||
const transactionPromise = waitForTransaction('create-remix-app-express-legacy', transactionEvent => { | ||
return transactionEvent.contexts?.trace?.op === 'navigation' && transactionEvent.transaction === 'routes/user.$id'; | ||
}); | ||
|
||
await page.goto('/'); | ||
|
||
const linkElement = page.locator('id=navigation'); | ||
await linkElement.click(); | ||
|
||
const transactionEvent = await transactionPromise; | ||
|
||
expect(transactionEvent).toBeDefined(); | ||
}); | ||
|
||
test('Renders `sentry-trace` and `baggage` meta tags for the root route', async ({ page }) => { | ||
await page.goto('/'); | ||
|
||
const sentryTraceMetaTag = await page.waitForSelector('meta[name="sentry-trace"]', { | ||
state: 'attached', | ||
}); | ||
const baggageMetaTag = await page.waitForSelector('meta[name="baggage"]', { | ||
state: 'attached', | ||
}); | ||
|
||
expect(sentryTraceMetaTag).toBeTruthy(); | ||
expect(baggageMetaTag).toBeTruthy(); | ||
}); | ||
|
||
test('Renders `sentry-trace` and `baggage` meta tags for a sub-route', async ({ page }) => { | ||
await page.goto('/user/123'); | ||
|
||
const sentryTraceMetaTag = await page.waitForSelector('meta[name="sentry-trace"]', { | ||
state: 'attached', | ||
}); | ||
const baggageMetaTag = await page.waitForSelector('meta[name="baggage"]', { | ||
state: 'attached', | ||
}); | ||
|
||
expect(sentryTraceMetaTag).toBeTruthy(); | ||
expect(baggageMetaTag).toBeTruthy(); | ||
}); |
14 changes: 14 additions & 0 deletions
14
...s/e2e-tests/test-applications/create-remix-app-express-legacy/tests/server-errors.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,14 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { waitForError } from '@sentry-internal/test-utils'; | ||
|
||
test('Sends a loader error to Sentry', async ({ page }) => { | ||
const loaderErrorPromise = waitForError('create-remix-app-express-legacy', errorEvent => { | ||
return errorEvent.exception.values[0].value === 'Loader Error'; | ||
}); | ||
|
||
await page.goto('/loader-error'); | ||
|
||
const loaderError = await loaderErrorPromise; | ||
|
||
expect(loaderError).toBeDefined(); | ||
}); |
Oops, something went wrong.