-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(nextjs): Add NextJS client-side E2E tests #6669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ecc9a0b
to
44a4ede
Compare
size-limit report 📦
|
The auto-upload of sourcemaps returns with |
204d223
to
2d4d93c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already looking good! Noted some minor things. Thank you! :)
@@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-11-8-18-19-18zm-10 15c2-4 5-7 10-7s8 3 9 7h-19zm-39 3c0 6 4 10 10 10 4 0 7-2 9-5l8 5c-3 5-9 8-17 8-11 0-19-7-19-18s8-18 19-18c8 0 14 3 17 8l-8 5c-2-3-5-5-9-5-6 0-10 4-10 10zm83-29v46h-9V5h9zM37 0l37 64H0L37 0zm92 5-27 48L74 5h10l18 30 17-30h10zm59 12v10l-3-1c-6 0-10 4-10 10v15h-9V17h9v9c0-5 6-9 13-9z"/></svg> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove all these static assets and also the .css files. They're not really relevant to our tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 7790eb3
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"incremental": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting an error "Option 'noEmit' cannot be specified with option 'incremental'." here. Is this something you added or something Next.js generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's auto-generated / modified by Next.JS. Tried to suppress it, but thought that might make the application diverted from the original create-next-app
. This will get resolved when we update our TS version, though.
packages/e2e-tests/run.ts
Outdated
SENTRY_ORG: process.env.E2E_TEST_SENTRY_ORG_SLUG, | ||
SENTRY_PROJECT: process.env.E2E_TEST_SENTRY_TEST_PROJECT, | ||
SENTRY_AUTH_TOKEN: process.env.E2E_TEST_AUTH_TOKEN, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldn't be needed in this PR yet. Let's remove them here until we actually get to the part where we're thesting the uploading of source maps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 394b73b
@@ -0,0 +1,171 @@ | |||
import { test, expect } from '@playwright/test'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely extract this into a helper sometime in the future. Doesn't have to be this PR. I say after we would add this kind of file 2 more times we go for it. The only thing I am worried just now that there is some custom thing we need to do in some framework and we're doing premature DRY.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes sense to me 👍
@@ -0,0 +1,101 @@ | |||
import Head from 'next/head'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wdyt about replacing the contents of this page with the contents of client.tsx
and deleting client.tsx
? Just so we conform to the standard test defined in the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was mainly to have separate client / server contexts, but we can discuss it when working on server-side tests. Moved to index -> a9772ae
693c5cf
to
a9772ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thank you Onur!
Ref: #6292 (Only client-side is tested)
Added a
create-next-app
application to our E2Etest-applications
.Added the default behaviour tests (
error
/pageload
/navigation
) in Playwright.(This set of tests are exactly the same with what we have for
standard-frontend-react
test application, which made me wonder if we can extract most of them to utilities, as they don't seem library / framework dependent)Also added 2 recipes; one for
dev
mode, one forbuild
mode, as we had issues specifically happen ondev
mode before. -> @sentry/nextjs v.7.21.1 broke "npm run dev" - works for v.7.21.0 #6284