Skip to content

test: setup playwright tests#437

Merged
Brentlok merged 4 commits intomainfrom
e2e-web-tests
Mar 5, 2026
Merged

test: setup playwright tests#437
Brentlok merged 4 commits intomainfrom
e2e-web-tests

Conversation

@Brentlok
Copy link
Copy Markdown
Contributor

@Brentlok Brentlok commented Mar 5, 2026

Summary by CodeRabbit

  • Tests

    • Added end-to-end Playwright tests, fixtures, a global setup to prepare browser artifacts, and a new test script to run E2E suites.
  • Chores

    • Added Playwright as a dev dependency and updated CI to install browsers.
    • Integrated E2E into automation/pre-commit tasks and added generated test artifacts to ignore rules.
    • Removed obsolete release tooling from dev dependencies.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f26f8f7-662a-4abe-a3ca-4fde2840a1ab

📥 Commits

Reviewing files that changed from the base of the PR and between 596a8f5 and 400c84f.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • package.json
  • packages/uniwind/package.json

📝 Walkthrough

Walkthrough

Adds Playwright end-to-end tests and supporting infrastructure to packages/uniwind: Playwright config, global setup that compiles CSS and bundles a browser IIFE, tests and TypeScript globals, package/CI updates, .gitignore entries, and a Jest mapping removal.

Changes

Cohort / File(s) Summary
E2E Config & Setup
packages/uniwind/playwright.config.ts, packages/uniwind/tests/e2e/global-setup.ts, packages/uniwind/tests/e2e/window.d.ts
New Playwright config, globalSetup that compiles Tailwind CSS and bundles a browser IIFE via esbuild, and TypeScript global augmentation exposing window.__uniwind utilities.
E2E Tests
packages/uniwind/tests/e2e/getWebStyles.test.ts
New Playwright test that injects compiled CSS and the bundled IIFE, exercising window.__uniwind.getWebStyles and asserting colors and scoped theme behavior (one test skipped).
Package & CI
packages/uniwind/package.json, turbo.json, package.json
Adds @playwright/test and test:e2e script; updates turbo to add test:e2e task and precommit dependency; bumps turbo devDependency; CI workflow adds step to install Playwright browsers.
Ignore & Jest
packages/uniwind/.gitignore, packages/uniwind/jest.config.web.js
Adds tests/e2e/.generated/, playwright-report/, and test-results/ to .gitignore; removes CSS module mapping from Jest web config.

Sequence Diagram(s)

sequenceDiagram
  participant CI as CI Job
  participant Playwright as Playwright Runner
  participant GlobalSetup as global-setup
  participant FS as File System (.generated/)
  participant Browser as Chromium Browser

  CI->>Playwright: run `test:e2e`
  Playwright->>GlobalSetup: invoke globalSetup()
  GlobalSetup->>FS: ensure .generated/ exists
  GlobalSetup->>FS: write compiled CSS (uniwind.css)
  GlobalSetup->>FS: write bundled IIFE (getWebStyles.iife.js)
  Playwright->>Browser: launch browser and load test page
  Playwright->>Browser: inject compiled CSS and bundle
  Browser->>Browser: expose window.__uniwind (getWebStyles/getWebVariable)
  Playwright->>Browser: execute tests (getWebStyles assertions)
  Browser-->>Playwright: return test results
  Playwright-->>CI: report pass/fail
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I stitched a stylesheet and bundled a tune,

I hopped through pages under the test-run moon,
Playwright danced and the browser agreed,
Colors and themes delivered at speed,
Hooray — tiny rabbit tests made it bloom! 🌷

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'test: setup playwright tests' clearly and directly describes the main change: adding Playwright end-to-end testing setup to the project. It accurately reflects the core additions across multiple configuration files and test files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch e2e-web-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/uniwind/tests/e2e/global-setup.ts`:
- Line 1: The e2e setup imports and uses esbuild (import { build } from
'esbuild' and await build(...)) but esbuild is not declared in the uniwind
package's devDependencies; add "esbuild" to the uniwind package.json
devDependencies (with a suitable version range) so the import resolves in
isolated installs and CI.
- Line 9: ROOT is currently derived from resolve(process.cwd()), which makes it
depend on where the test runner was invoked; change it to resolve the test
file's directory instead so ROOT is independent of invocation cwd. Replace the
use of process.cwd() when computing ROOT with a directory computed from the
module/file location (e.g., using __dirname in CommonJS or
path.dirname(fileURLToPath(import.meta.url)) in ESM) so the symbol ROOT is
anchored to the global-setup.ts file location rather than the process working
directory.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d4ff9a26-cb1b-41de-b75f-883875e32f95

📥 Commits

Reviewing files that changed from the base of the PR and between 131da4c and f0dea93.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • packages/uniwind/.gitignore
  • packages/uniwind/jest.config.web.js
  • packages/uniwind/package.json
  • packages/uniwind/playwright.config.ts
  • packages/uniwind/tests/e2e/getWebStyles.test.ts
  • packages/uniwind/tests/e2e/global-setup.ts
  • packages/uniwind/tests/e2e/window.d.ts
  • turbo.json
💤 Files with no reviewable changes (1)
  • packages/uniwind/jest.config.web.js

@Brentlok Brentlok merged commit 86f7a78 into main Mar 5, 2026
1 of 2 checks passed
@Brentlok Brentlok deleted the e2e-web-tests branch March 5, 2026 14:14
@github-actions
Copy link
Copy Markdown
Contributor

🚀 This pull request is included in v1.6.0. See Release v1.6.0 for release notes.

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.

1 participant