Problem with palywright e2e env vars on Vercel

I'm working on E2E testing using Playwright with a Next.js project deployed on Vercel. In my local environment, everything works fine as I have my user and password variables defined in an .env file. However, I'm encountering a problem when running tests in the Vercel preview environment. The environment variables defined as: env
NEXT_PUBLIC_TEST_USER=user
NEXT_PUBLIC_TEST_PASSWORD=pass
NEXT_PUBLIC_TEST_USER=user
NEXT_PUBLIC_TEST_PASSWORD=pass
result in undefinedin the Vercel preview environment. I have set up these variables in Vercel, but I'm not sure how to correctly pass them to my GitHub Actions workflow. Does anyone have experience with this setup or could offer some guidance on how to ensure these environment variables are available in GitHub Actions when running tests with Playwright in a Vercel preview environment?
2 Replies
cje
cje6mo ago
the tests arent running in vercel they're running in github ci so you need the environment variables to be available there
Daher
Daher6mo ago
Thanks that was the problem