Daher
Daher
TTCTheo's Typesafe Cult
Created by Daher on 1/10/2024 in #questions
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?
6 replies