Skip to content

darkmode img added and extended e2e test suit#18

Merged
prathmesh796 merged 6 commits into
mainfrom
ui
May 24, 2026
Merged

darkmode img added and extended e2e test suit#18
prathmesh796 merged 6 commits into
mainfrom
ui

Conversation

@prathmesh796

Copy link
Copy Markdown
Owner

UI:

  • Generated the darkmode version of landing page images
  • Dynamically render them as per the current theme

e2e Test:

  • Rebuild the e2e testing suit
  • added auth tests
  • added auth helpers and authenticated tests

Copilot AI review requested due to automatic review settings May 22, 2026 18:14
@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
getlancer Ready Ready Preview, Comment May 24, 2026 1:45pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/layout.js
Comment on lines +33 to +37
<AppThemeProvider
attribute="class"
defaultTheme={theme}
enableSystem
>
Comment thread app/page.js
Comment thread app/page.js
Comment on lines +26 to +28
useEffect(() => {
theme.setTheme(theme.theme);
}, [theme.theme]);
Comment thread app/page.js
Comment on lines +11 to +16
<button onClick={() => {
setTheme(theme === 'light' ? 'dark' : 'light');
}}>
{theme === 'light' ? (
<BsFillMoonStarsFill />
) : (
Comment thread playwright.config.js
Comment thread app/api/auth/[...nextauth]/route.js Outdated
Comment on lines +23 to +27
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>

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

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:

  • https://api.github.com/repos/prathmesh796/getlancer/pulls/comments/3290483272
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

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>

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

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:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/getlancer/getlancer/node_modules/.bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@prathmesh796 prathmesh796 merged commit 837053f into main May 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants