Skip to content

feat: add Playwright test harness with SSR and CSR support#7428

Open
radium-v wants to merge 10 commits intomainfrom
users/radium-v/fast-test-harness
Open

feat: add Playwright test harness with SSR and CSR support#7428
radium-v wants to merge 10 commits intomainfrom
users/radium-v/fast-test-harness

Conversation

@radium-v
Copy link
Copy Markdown
Collaborator

Pull Request

📖 Description

Adds @microsoft/fast-test-harness, a new Playwright testing harness package for FAST web components. The harness provides shared fixtures for both client-side rendering (CSR) and server-side rendering (SSR) test workflows, a custom Express + Vite dev server, SSR rendering utilities, and support for custom assertions.

This package is intended to be consumed by component packages in the monorepo (and downstream projects like MAI) to standardize how Playwright tests are authored and run against FAST-based web components.

👩‍💻 Reviewer Notes

  • The package is currently marked private and is not published to npm.
  • SSR support depends on optional peer dependencies @microsoft/fast-html and @microsoft/fast-build.
  • The server.mjs entrypoint uses Express 5 and Vite's createServer API to handle both CSR page serving and SSR fixture generation in a single process.

📑 Test Plan

This package provides test infrastructure rather than component behavior. Validation will come from downstream adoption in component packages that use the harness fixtures. No Playwright tests are included in this package itself.

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

⏭ Next Steps

  • The wasm-renderer.ts module wraps the Rust-based fast-build WASM renderer for SSR template compilation. This may be extracted or refined as fast-build stabilizes.

test.describe("Button", () => {
test.use({ tagName: "my-button", innerHTML: "Click me" });

test("should render", async ({ fastPage }) => {
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.

Since this is specifically from the @microsoft/fast-test-harness package, could this just be page instead of fastPage?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

page is already the name of the built-in Playwright page fixture: https://playwright.dev/docs/test-fixtures#built-in-fixtures

@radium-v radium-v force-pushed the users/radium-v/fast-test-harness branch from 71e6073 to c552d2d Compare April 12, 2026 20:55
@radium-v radium-v requested a review from janechu April 12, 2026 22:47
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