microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
62.28k stars 3.35k forks source link

[Feature]: experimental-ct-svelte Svelte 5 support - svelte/internal won't be available #30278

Open siliconcat opened 1 month ago

siliconcat commented 1 month ago

🚀 Feature Request

I was trying to run some component tests with a Svelte 5 development version. However I see that Svelte 5 has removed the svelte/internal package that is used in the experimental-ct-svelte module. It is "internal" and not for public use, so the risk was there.

https://github.com/microsoft/playwright/blob/a6827772a5f210ca5b760586e0b685ef0054cfbb/packages/playwright-ct-svelte/registerSource.mjs#L21

This then throws the error:

RollupError: "noop" is not exported by "../../node_modules/.pnpm/svelte@5.0.0-next.95/node_modules/svelte/src/internal/index.js", imported by "playwright/index.ts".

when trying to run the component test.

I understand that Svelte 5 is not there yet, and the component tests are a experimental feature, so the priorities are pretty low. I am happy to help if pointed to the right direction, but sadly I don't have enough understanding on how to address this or if there is any workaround.

Thanks!

Example

No response

Motivation

Svelte 5 will be out there one day and Playwright will make it greater with the component tests.

sand4rt commented 3 weeks ago

The svelte/internal module is used for testing slots, but it appears that slots are replaced by snippets/render tags in Svelte 5. There are more breaking changes: https://svelte-5-preview.vercel.app/docs/breaking-changes so i think this will require a new @playwright/experimental-ct package unfortunately. Rich also mentions this in his presentation: https://www.youtube.com/live/gkJ09joGBZ4?si=zXhDBYYj9cYteOOF&t=8547 on Svelte Summit.