darkmode img added and extended e2e test suit#18
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adds dark-mode variants for landing page imagery with theme-based rendering, and rebuilds the Playwright E2E suite with authentication helpers, setup/storageState, and additional auth/session coverage.
Changes:
- Add theme-aware image selection on the homepage and expand global CSS variables/utilities for dark mode.
- Rework Playwright configuration and add a structured E2E suite (public pages, auth, session flows, authenticated route coverage).
- Add an E2E-only Turnstile bypass flag and update scripts/ignores/docs to support running Playwright locally/CI.
Reviewed changes
Copilot reviewed 19 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| playwright.config.js | Loads env files, adds setup/authenticated projects, configures baseURL and webServer env for E2E. |
| package.json | Adds Playwright convenience scripts (UI/headed). |
| package-lock.json | Updates lockfile to reflect dependency upgrades. |
| e2e/session/login-logout.spec.js | Adds login/logout session flow coverage for client and freelancer. |
| e2e/public/homepage.spec.js | Adds public homepage/nav/theme-toggle smoke coverage. |
| e2e/helpers/auth.js | Introduces shared auth helpers (login, logout, dashboard wait, turnstile stub). |
| e2e/flows.spec.js | Removes the previous monolithic E2E spec. |
| e2e/auth/registration.spec.js | Adds UI-only coverage for join/signin flows. |
| e2e/auth/protected-routes.spec.js | Adds unauthenticated redirect coverage for protected routes. |
| e2e/auth/login.spec.js | Adds login page coverage (rendering, invalid creds, role-based dashboard). |
| e2e/auth/authenticated.spec.js | Adds authenticated client coverage using storageState. |
| e2e/auth.setup.js | Adds Playwright setup project that generates client storageState. |
| components/theme-switch.js | Reformats theme toggle handler (and now interacts with layout-level theme provider). |
| app/page.js | Adds theme-aware landing images and theme-side effects. |
| app/layout.js | Fixes theme provider wrapping so children are actually under AppThemeProvider. |
| app/globals.css | Expands dark-mode variables and utilities; adjusts body color/background behavior. |
| app/api/auth/[...nextauth]/route.js | Adds E2E_TEST flag to bypass Turnstile verification during E2E. |
| app/(Auth)/login/page.js | Improves post-login role detection via getSession() polling; adds input names for E2E selectors. |
| .gitignore | Ignores Playwright reports/artifacts and auth storage output. |
| .env.example | Documents optional Playwright E2E env vars and seeded-user expectations. |
| tests/snapshot.js | Mocks next-themes to keep homepage snapshot stable with theme usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <AppThemeProvider | ||
| attribute="class" | ||
| defaultTheme={theme} | ||
| enableSystem | ||
| > |
| useEffect(() => { | ||
| theme.setTheme(theme.theme); | ||
| }, [theme.theme]); |
| <button onClick={() => { | ||
| setTheme(theme === 'light' ? 'dark' : 'light'); | ||
| }}> | ||
| {theme === 'light' ? ( | ||
| <BsFillMoonStarsFill /> | ||
| ) : ( |
| if (process.env.E2E_TEST !== '1') { | ||
| const token = credentials?.['cf-turnstile-response']; | ||
|
|
||
| const verifyRes = await fetch('https://challenges.cloudflare.com/turnstile/v0/siteverify', { | ||
| method: 'POST', | ||
| headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, | ||
| body: `secret=${process.env.TURNSTILE_SECRET_KEY}&response=${token}`, | ||
| }); | ||
| const verifyRes = await fetch('https://challenges.cloudflare.com/turnstile/v0/siteverify', { | ||
| method: 'POST', |
Agent-Logs-Url: https://github.com/prathmesh796/getlancer/sessions/80332c74-1708-4bc3-91fa-3c374009f140 Co-authored-by: prathmesh796 <145089371+prathmesh796@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/prathmesh796/getlancer/sessions/59c598ec-3495-4c3d-94e6-732a93b55ba5 Co-authored-by: prathmesh796 <145089371+prathmesh796@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
UI:
e2e Test: