Skip to content

feat(examples): migrate examples/apps/ packages from Jest+Puppeteer to Playwright#26619

Draft
alexvy86 wants to merge 23 commits intomicrosoft:mainfrom
alexvy86:replace-jest-with-playwright
Draft

feat(examples): migrate examples/apps/ packages from Jest+Puppeteer to Playwright#26619
alexvy86 wants to merge 23 commits intomicrosoft:mainfrom
alexvy86:replace-jest-with-playwright

Conversation

@alexvy86
Copy link
Contributor

@alexvy86 alexvy86 commented Mar 3, 2026

Description

Replaces jest, jest-puppeteer, jest-environment-puppeteer, expect-puppeteer, and puppeteer dependencies with @playwright/test across all 9 browser-tested packages in examples/apps/.

  • Adds playwright.config.ts per package (port via getTestPort from package.json name)
  • Rewrites test files using Playwright fixtures and locator API
  • Deletes jest.config.cjs and jest-puppeteer.config.cjs from each package
  • Updates package.json scripts: test:playwright / test:playwright:verbose
  • Adds test:playwright to fluidBuild.config.cjs task graph
  • Adds test:playwright to repoPolicyCheck split test script names
  • Adds test-results/ to root .gitignore (Playwright last-run artifacts)
  • Updates tsconfig.json per package: adds playwright.config.ts to include, replaces skipLibCheck workaround with explicit "node" in types array
  • Bumps minimum Node.js requirement to 20.19.6: Node.js 20.19.0–20.19.4 ship cjs-module-lexer 1.4.1, which fails to detect Object.defineProperty-style named CJS exports when imported from ESM — causing a TypeError: Class extends value undefined when Playwright loads test files that transitively import @fluid-internal/client-utils (example). Node.js 20.19.5 bumped cjs-module-lexer to 2.1.0, fixing the detection. Requiring 20.19.6 (the latest patch) ensures a stable baseline.

Reviewer Guidance

The review process is outlined on this wiki page.

Pipeline run for this PR shows 40,800 tests running, vs 40,791 in other PRs, which is due to the fact that the inventory-app mocha tests are currently not running for some reason (see today, vs this PR).

alexvy86 and others added 20 commits March 3, 2026 00:19
…o Playwright

Replaces jest, jest-puppeteer, jest-environment-puppeteer, expect-puppeteer,
and puppeteer dependencies with @playwright/test across all 9 browser-tested
packages in examples/apps/.

- Adds playwright.config.ts per package (port via getTestPort from package.json name)
- Rewrites test files using Playwright fixtures and locator API
- Deletes jest.config.cjs and jest-puppeteer.config.cjs from each package
- Updates package.json scripts: test:playwright / test:playwright:verbose
- Adds test:playwright to fluidBuild.config.cjs task graph
- Adds test:playwright to repoPolicyCheck split test script names
- Adds test-results/ to root .gitignore (Playwright last-run artifacts)
- Updates tsconfig.json per package: adds playwright.config.ts to include,
  replaces skipLibCheck workaround with explicit "node" in types array

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adding tests/**/* broke build:compile because tests/index.ts uses extensionless
imports that violate --moduleResolution node16. The tests directory was never
included in this package's tsconfig (only src/**/*); only playwright.config.ts
needed to be added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nfig

Adding @types/node to the types array resolves the original ts-loader failure
that occurred when playwright.config.ts (which uses node:module and process)
was included in the bundler tsconfig. With @types/node available, both the
webpack build and ESLint's project service can parse the test files correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ation

Restores rootDir: "./src" to preserve lib/ output at the root (not lib/src/),
which is required since data-object-grid depends on collaborative-textarea's
lib/index.js. Adds a separate tsconfig.test.json with noEmit: true for
type-checking test files and playwright.config.ts without affecting the build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Node.js 20.19.0–20.19.4 ship `cjs-module-lexer` 1.4.1, which fails to
detect `Object.defineProperty(exports, "Name", { get: ... })` as a named
CJS export when imported from ESM. This causes a
`TypeError: Class extends value undefined` when Playwright loads test
files that transitively pull in `@fluid-internal/client-utils` (whose
`typedEventEmitter.js` does `import { EventEmitter } from
"./eventEmitter.cjs"`).

Node.js 20.19.5 bumped `cjs-module-lexer` to 2.1.0 (a major version
bump), which correctly handles this pattern. Requiring 20.19.6 (the
latest patch) ensures a stable fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Matches the minimum version requirement set in package.json engines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 03903a1.
@alexvy86 alexvy86 changed the title feat(examples): migrate examples/ packages from Jest+Puppeteer to Playwright feat(examples): migrate examples/apps/ packages from Jest+Puppeteer to Playwright Mar 6, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  257792 links
    1822 destination URLs
    2063 URLs ignored
       0 warnings
       0 errors


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