Skip to content

feat(e2e): add Playwright post submission test (E2E-POST-001)#399

Merged
motirebuma merged 10 commits into
mainfrom
Issue-391
Jul 6, 2026
Merged

feat(e2e): add Playwright post submission test (E2E-POST-001)#399
motirebuma merged 10 commits into
mainfrom
Issue-391

Conversation

@niamao

@niamao niamao commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Playwright E2E infrastructure for the frontend (e2e/, playwright.config.ts, flexible pnpm test:e2e scripts)
  • Implements E2E-POST-001: logged-in user creates a public post via the composer, verifies explore feed and post detail page (desktop + mobile)
  • Fixes REST login to support hosted API (/login) and local backend (/auth/login) via shared restLogin helper
  • Adds UI data-testids, combobox z-index fix for group selection in the Create Quote dialog, and excludes e2e/ from Jest so CI unit tests stay isolated
  • Documents setup in README.md, CLAUDE.md, and .env.e2e.example; adds optional CI E2E job when E2E_AUTHOR_PASSWORD is configured

Test plan

  • pnpm type-check
  • pnpm lint
  • pnpm build
  • pnpm test (Jest — 155 suites)
  • pnpm test:e2e post-submission.spec.ts (2 passed: desktop + mobile)
  • CI E2E job (requires repo secrets: E2E_AUTHOR_PASSWORD, optional E2E_AUTHOR_USERNAME, E2E_PUBLIC_GROUP_NAME)

Made with Cursor

Introduce Playwright E2E infrastructure with E2E-POST-001 for creating a
public post, dual REST login paths for hosted/local APIs, and CI/docs updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
quotevote Ready Ready Preview, Comment Jul 6, 2026 1:53am

@niamao niamao self-assigned this Jun 24, 2026
@niamao niamao requested review from Om7035, motirebuma and mzpolini and removed request for motirebuma and mzpolini June 24, 2026 12:42
@niamao niamao linked an issue Jun 24, 2026 that may be closed by this pull request
@flyblackbox

Copy link
Copy Markdown
Contributor

I am sorry for the delay @niamao we need to find a new system for reviews instead of relying on one person. Please give me some time and I will find a volunteer who can do review. In the meantime, may I ask that you review someone else's PR?

@motirebuma motirebuma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @niamao the E2E infrastructure and test spec look solid, good global setup, clean helper abstractions, and the restLogin.ts fallback for hosted vs local backends is a nice touch. Docs and config are thorough.

A couple things to sort out before merging:

  • The CI job gate if: ${{ secrets.E2E_AUTHOR_PASSWORD }} likely won't work as intended -- GitHub Actions masks secrets in if: expressions. You'll want to set the secret into an env var and check that instead, otherwise this job may silently always skip.
  • There's some scope creep here: the GET_GROUP query + group badge in Post.tsx and the z-index: 80 bump on the combobox popover aren't related to E2E setup.
  • Minor: saveAuthorStorageState launches a full Chromium instance just to write localStorage. A plain JSON file with cookies/origins would be faster and skip the browser roundtrip, but not a blocker.

Status: Approved (Will be merged after the fixes)

Thankyou @niamao, and sorry for late review.

@niamao @flyblackbox

@niamao

niamao commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

I am sorry for the delay @niamao we need to find a new system for reviews instead of relying on one person. Please give me some time and I will find a volunteer who can do review. In the meantime, may I ask that you review someone else's PR?

Currently, the remaining PRs still have build errors and it's better if they can fix it first.

@niamao

niamao commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Hey @niamao the E2E infrastructure and test spec look solid, good global setup, clean helper abstractions, and the restLogin.ts fallback for hosted vs local backends is a nice touch. Docs and config are thorough.

A couple things to sort out before merging:

  • The CI job gate if: ${{ secrets.E2E_AUTHOR_PASSWORD }} likely won't work as intended -- GitHub Actions masks secrets in if: expressions. You'll want to set the secret into an env var and check that instead, otherwise this job may silently always skip.
  • There's some scope creep here: the GET_GROUP query + group badge in Post.tsx and the z-index: 80 bump on the combobox popover aren't related to E2E setup.
  • Minor: saveAuthorStorageState launches a full Chromium instance just to write localStorage. A plain JSON file with cookies/origins would be faster and skip the browser roundtrip, but not a blocker.

Status: Approved (Will be merged after the fixes)

Thankyou @niamao, and sorry for late review.

@niamao @flyblackbox

No problem. Thank you also for reviewing. I'll update my changes and also fix merge conflicts.

@flyblackbox flyblackbox 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.

Looking good to me

@niamao

niamao commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Looking good to me

I wanted to check and fix my deployment error but I don't have access permission. @flyblackbox @motirebuma

@flyblackbox

Copy link
Copy Markdown
Contributor

I'm not sure how to address this one @niamao / @motirebuma I will message you

Revert accidental lock file changes from the E2E branch so CI uses the same dependency tree as main.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove duplicate @playwright/test specifier and unused dotenv/wait-on entries that caused frozen-lockfile install failures on deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove job-level working-directory from the E2E job so the credentials gate runs at the repo root, then set working-directory only on steps after checkout.

Co-authored-by: Cursor <cursoragent@cursor.com>
@niamao

niamao commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Hey @niamao the E2E infrastructure and test spec look solid, good global setup, clean helper abstractions, and the restLogin.ts fallback for hosted vs local backends is a nice touch. Docs and config are thorough.

A couple things to sort out before merging:

  • The CI job gate if: ${{ secrets.E2E_AUTHOR_PASSWORD }} likely won't work as intended -- GitHub Actions masks secrets in if: expressions. You'll want to set the secret into an env var and check that instead, otherwise this job may silently always skip.
  • There's some scope creep here: the GET_GROUP query + group badge in Post.tsx and the z-index: 80 bump on the combobox popover aren't related to E2E setup.
  • Minor: saveAuthorStorageState launches a full Chromium instance just to write localStorage. A plain JSON file with cookies/origins would be faster and skip the browser roundtrip, but not a blocker.

Status: Approved (Will be merged after the fixes)

Thankyou @niamao, and sorry for late review.

@niamao @flyblackbox

Thanks for the review — addressed: (1) CI gate now checks E2E_AUTHOR_PASSWORD via step env + output, not if: secrets.*; (2) reverted Post.tsx scope creep; (3) kept combobox z-[80] because group select is blocked in E2E without it; (4) storage state is plain JSON, no Chromium launch.

E2E runs in CI once E2E_AUTHOR_PASSWORD is set in repo Actions secrets. (Optional) @motirebuma @flyblackbox

Restores Playwright env loading and CI server wait; package.json and
pnpm-lock.yaml updated together to avoid frozen-lockfile install failures.

Co-authored-by: Cursor <cursoragent@cursor.com>

@motirebuma motirebuma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work @niamao. The E2E infrastructure is solid -- good global setup, clean helper abstractions, and the restLogin.ts fallback for hosted vs local backends is a nice touch. Docs and config are thorough.

  • Minor: saveAuthorStorageState launches a full Chromium instance just to write localStorage. A plain JSON file with cookies/origins would be faster, but not a blocker.

Thank you!!

@flyblackbox @niamao

@motirebuma motirebuma merged commit af17359 into main Jul 6, 2026
5 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.

5.1.2 E2E-POST-001 Create Public Post

3 participants