Closed JohnAllenTech closed 1 month ago
@JohnAllenTech is attempting to deploy a commit to the Codú Team on Vercel.
A member of the Team first needs to authorize it.
The pull request introduces significant changes to the end-to-end test suite for the articles page, focusing on user authentication. It separates tests for authenticated and unauthenticated users, removing the cookie-clearing step for unauthenticated tests and adding a login step for authenticated tests. A new utility function, loggedInAsUserOne
, is introduced to streamline authentication across various test suites. Additionally, the playwright.config.ts
file is updated to simplify configurations by removing certain properties related to storage state and dependencies.
File | Change Summary |
---|---|
e2e/articles.spec.ts | Separated tests for authenticated and unauthenticated users; added beforeEach for login in authenticated tests; updated visibility checks and loading simulation. |
e2e/auth.setup.ts | Deleted file containing authentication setup for end-to-end tests, including session token checks. |
e2e/home.spec.ts | Introduced loggedInAsUserOne for authenticated tests; removed cookie-clearing step for unauthenticated tests. |
e2e/login.spec.ts | Added loggedInAsUserOne for authenticated tests; updated visibility assertions based on user state. |
e2e/my-posts.spec.ts | Removed cookie-clearing step for unauthenticated tests; added loggedInAsUserOne for authenticated tests. |
e2e/settings.spec.ts | Removed cookie-clearing step for unauthenticated tests; added loggedInAsUserOne for authenticated tests. |
e2e/utils/index.ts | Re-exported all entities from ./utils for easier access. |
e2e/utils/utils.ts | Introduced loggedInAsUserOne function for user authentication in end-to-end tests. |
playwright.config.ts | Removed storageState and dependencies properties from several project configurations. |
README.md | Renamed environment variable E2E_USER_SESSION_ID to E2E_USER_ONE_SESSION_ID with updated description. |
drizzle/seed.ts | Updated to use process.env.E2E_USER_ONE_SESSION_ID for session ID in seeding process. |
sample.env | Renamed E2E_USER_SESSION_ID to E2E_USER_ONE_SESSION_ID . |
🐇 In the land of tests, we hop and play,
With cookies cleared, we find our way.
Authenticated friends, we greet with cheer,
As bookmarks appear, our path is clear.
So let’s raise a toast, to tests anew,
In the garden of code, where dreams come true! 🌼
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
codu | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 26, 2024 10:31pm |
Something strange happening when deployed. Will do some troubleshooting. Everything is working locally with the same commands.
@NiallJoeMaher it seems that the PR workflow always runs from the main branches version.
I have a new env var thats needed for the tests to pass. Not sure how to work around this..
I am pretty confident it will pass the E2E tests if you merge it though. Can we see and revert if thats not the case?
Heres the reason its failing.
It needs E2E_USER_ONE_SESSION_ID which i have added to the E2E test workflow file.
It worked anyway! I imagine this will be the same for the other two... maybe
✨ Codu Pull Request 💻
Helps with #1168 and #468
Pull Request details
So eventually we will need multiple user personas in a single E2E test.
One example is a user replying to another users comment. This PR is a first step to support multiple users in our E2E test. Follow on PRs will create a new loggedInAsUserTwo function which will be used to reply to 'user on'
I have also switched from having our tests run as authenticated by default
Any Breaking changes
Associated Screenshots