Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix: component testing w/ svelte bot failures (#39282)
Pavel Feldman53fe06287530
diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.mdindex 5218a69edd..f501b50bec 100644--- a/docs/src/release-notes-js.md+++ b/docs/src/release-notes-js.md@@ -2464,8 +2464,8 @@ WebServer is now considered "ready" if request to the specified url has any of t- Components Testing (preview)- Playwright Test can now test your [React](https://reactjs.org/),- [Vue.js](https://vuejs.org/) or [Svelte](https://svelte.dev/) components.+ Playwright Test can now test your [React](https://reactjs.org/)+ or [Vue.js](https://vuejs.org/) components.You can use all the featuresof Playwright Test (such as parallelization, emulation & debugging) while running componentsin real browsers.diff --git a/docs/src/test-components-js.md b/docs/src/test-components-js.mdindex 73115bfad9..12d8b33f98 100644--- a/docs/src/test-components-js.md+++ b/docs/src/test-components-js.md@@ -40,7 +40,7 @@ test('event should work', async ({ mount }) => {## How to get started-Adding Playwright Test to an existing project is easy. Below are the steps to enable Playwright Test for a React, Vue or Svelte project.+Adding Playwright Test to an existing project is easy. Below are the steps to enable Playwright Test for a React or Vue project.### Step 1: Install Playwright Test for components for your respective framework@@ -108,7 +108,6 @@ component is mounted using this script. It can be either a `.js`, `.ts`, `.jsx`defaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -155,20 +154,6 @@ declare module '*.vue';</TabItem>-<TabItem value="svelte">--```js title="app.spec.ts"-import { test, expect } from '@playwright/experimental-ct-svelte';-import App from './App.svelte';--test('should work', async ({ mount }) => {- const component = await mount(App);- await expect(component).toContainText('Learn Svelte');-});-```--</TabItem>-</Tabs>### Step 3. Run the tests@@ -297,7 +282,6 @@ Provide props to a component when mounted.defaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -312,17 +296,6 @@ test('props', async ({ mount }) => {});```-</TabItem>-<TabItem value="svelte">--```js title="component.spec.ts"-import { test } from '@playwright/experimental-ct-svelte';--test('props', async ({ mount }) => {- const component = await mount(Component, { props: { msg: 'greetings' } });-});-```-</TabItem><TabItem value="vue">@@ -356,7 +329,6 @@ Provide callbacks/events to a component when mounted.defaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -371,17 +343,6 @@ test('callback', async ({ mount }) => {});```-</TabItem>-<TabItem value="svelte">--```js title="component.spec.ts"-import { test } from '@playwright/experimental-ct-svelte';--test('event', async ({ mount }) => {- const component = await mount(Component, { on: { click() {} } });-});-```-</TabItem><TabItem value="vue">@@ -415,7 +376,6 @@ Provide children/slots to a component when mounted.defaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -430,17 +390,6 @@ test('children', async ({ mount }) => {});```-</TabItem>-<TabItem value="svelte">--```js title="component.spec.ts"-import { test } from '@playwright/experimental-ct-svelte';--test('slot', async ({ mount }) => {- const component = await mount(Component, { slots: { default: 'Slot' } });-});-```-</TabItem><TabItem value="vue">@@ -550,7 +499,6 @@ Unmount the mounted component from the DOM. This is useful for testing the compodefaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -566,18 +514,6 @@ test('unmount', async ({ mount }) => {});```-</TabItem>-<TabItem value="svelte">--```js title="component.spec.ts"-import { test } from '@playwright/experimental-ct-svelte';--test('unmount', async ({ mount }) => {- const component = await mount(Component);- await component.unmount();-});-```-</TabItem><TabItem value="vue">@@ -612,7 +548,6 @@ Update props, slots/children, and/or events/callbacks of a mounted component. ThdefaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -630,22 +565,6 @@ test('update', async ({ mount }) => {});```-</TabItem>-<TabItem value="svelte">--```js title="component.spec.ts"-import { test } from '@playwright/experimental-ct-svelte';--test('update', async ({ mount }) => {- const component = await mount(Component);- await component.update({- props: { msg: 'greetings' },- on: { click() {} },- slots: { default: 'Child' }- });-});-```-</TabItem><TabItem value="vue">@@ -717,7 +636,7 @@ test('example test', async ({ mount, router }) => {## Frequently asked questions-### What's the difference between `@playwright/test` and `@playwright/experimental-ct-{react,svelte,vue}`?+### What's the difference between `@playwright/test` and `@playwright/experimental-ct-{react,vue}`?```jstest('…', async ({ mount, page, context }) => {@@ -725,14 +644,13 @@ test('…', async ({ mount, page, context }) => {});```-`@playwright/experimental-ct-{react,svelte,vue}` wrap `@playwright/test` to provide an additional built-in component-testing specific fixture called `mount`:+`@playwright/experimental-ct-{react,vue}` wrap `@playwright/test` to provide an additional built-in component-testing specific fixture called `mount`:<TabsgroupId="js-framework"defaultValue="react"values={[{label: 'React', value: 'react'},- {label: 'Svelte', value: 'svelte'},{label: 'Vue', value: 'vue'},]}>@@ -772,26 +690,6 @@ test('should work', async ({ mount }) => {</TabItem>-<TabItem value="svelte">--```js-import { test, expect } from '@playwright/experimental-ct-svelte';-import HelloWorld from './HelloWorld.svelte';--test.use({ viewport: { width: 500, height: 500 } });--test('should work', async ({ mount }) => {- const component = await mount(HelloWorld, {- props: {- msg: 'Greetings',- },- });- await expect(component).toContainText('Greetings');-});-```--</TabItem>-</Tabs>Additionally, it adds some config options you can use in your `playwright-ct.config.{ts,js}`.diff --git a/docs/src/testing-library-js.md b/docs/src/testing-library-js.mdindex bff0eb6162..c3f3e8f58d 100644--- a/docs/src/testing-library-js.md+++ b/docs/src/testing-library-js.md@@ -5,7 +5,7 @@ title: "Migrating from Testing Library"## Migration principles-This guide describes migration to Playwright's [Experimental Component Testing](./test-components) from [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro/), [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/), [Vue Testing Library](https://testing-library.com/docs/vue-testing-library/intro) and [Svelte Testing Library](https://testing-library.com/docs/svelte-testing-library/intro).+This guide describes migration to Playwright's [Experimental Component Testing](./test-components) from [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro/), [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) and [Vue Testing Library](https://testing-library.com/docs/vue-testing-library/intro).:::noteIf you use DOM Testing Library in the browser (for example, you bundle end-to-end tests with webpack), you can switch directly to Playwright Test. Examples below are focused on component tests, but for end-to-end test you just need to replace `await mount` with `await page.goto('http://localhost:3000/')` to open the page under test.@@ -78,7 +78,7 @@ test('sign in', async ({ mount }) => { // 2Migration highlights (see inline comments in the Playwright Test code snippet):-1. Import everything from `@playwright/experimental-ct-react` (or -vue, -svelte) for component tests, or from `@playwright/test` for end-to-end tests.+1. Import everything from `@playwright/experimental-ct-react` (or -vue) for component tests, or from `@playwright/test` for end-to-end tests.1. Test function is given a `page` that is isolated from other tests, and `mount` that renders a component in this page. These are two of the [useful fixtures](./api/class-fixtures) in Playwright Test.1. Replace `render` with `mount` that returns a [component locator](./locators).1. Use locators created with [`method: Locator.locator`] or [`method: Page.locator`] to perform most of the actions.diff --git a/package-lock.json b/package-lock.jsonindex 4980057315..c9d404b8c8 100644--- a/package-lock.json+++ b/package-lock.json@@ -1053,15 +1053,6 @@"@jridgewell/trace-mapping": "^0.3.24"}},- "node_modules/@jridgewell/remapping": {- "version": "2.3.5",- "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",- "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",- "dependencies": {- "@jridgewell/gen-mapping": "^0.3.5",- "@jridgewell/trace-mapping": "^0.3.24"- }- },"node_modules/@jridgewell/resolve-uri": {"version": "3.1.2","resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",@@ -1394,10 +1385,6 @@"resolved": "packages/playwright-ct-react17","link": true},- "node_modules/@playwright/experimental-ct-svelte": {- "resolved": "packages/playwright-ct-svelte",- "link": true- },"node_modules/@playwright/experimental-ct-vue": {"resolved": "packages/playwright-ct-vue","link": true@@ -1701,50 +1688,6 @@"eslint": ">=9.0.0"}},- "node_modules/@sveltejs/acorn-typescript": {- "version": "1.0.5",- "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz",- "integrity": "sha512-IwQk4yfwLdibDlrXVE04jTZYlLnwsTT2PIOQQGNLWfjavGifnk1JD1LcZjZaBTRcxZu2FfPfNLOE04DSu9lqtQ==",- "peerDependencies": {- "acorn": "^8.9.0"- }- },- "node_modules/@sveltejs/vite-plugin-svelte": {- "version": "5.1.1",- "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-5.1.1.tgz",- "integrity": "sha512-Y1Cs7hhTc+a5E9Va/xwKlAJoariQyHY+5zBgCZg4PFWNYQ1nMN9sjK1zhw1gK69DuqVP++sht/1GZg1aRwmAXQ==",- "dependencies": {- "@sveltejs/vite-plugin-svelte-inspector": "^4.0.1",- "debug": "^4.4.1",- "deepmerge": "^4.3.1",- "kleur": "^4.1.5",- "magic-string": "^0.30.17",- "vitefu": "^1.0.6"- },- "engines": {- "node": "^18.0.0 || ^20.0.0 || >=22"- },- "peerDependencies": {- "svelte": "^5.0.0",- "vite": "^6.0.0"- }- },- "node_modules/@sveltejs/vite-plugin-svelte-inspector": {- "version": "4.0.1",- "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-4.0.1.tgz",- "integrity": "sha512-J/Nmb2Q2y7mck2hyCX4ckVHcR5tu2J+MtBEQqpDrrgELZ2uvraQcK/ioCV61AqkdXFgriksOKIceDcQmqnGhVw==",- "dependencies": {- "debug": "^4.3.7"- },- "engines": {- "node": "^18.0.0 || ^20.0.0 || >=22"- },- "peerDependencies": {- "@sveltejs/vite-plugin-svelte": "^5.0.0",- "svelte": "^5.0.0",- "vite": "^6.0.0"- }- },"node_modules/@szmarczak/http-timer": {"version": "4.0.6","resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz",@@ -2393,6 +2336,7 @@"version": "8.15.0","resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz","integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",+ "dev": true,"bin": {"acorn": "bin/acorn"},@@ -2522,14 +2466,6 @@"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==","dev": true},- "node_modules/aria-query": {- "version": "5.3.2",- "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",- "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==",- "engines": {- "node": ">= 0.4"- }- },"node_modules/array-buffer-byte-length": {"version": "1.0.2","resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz",@@ -2721,14 +2657,6 @@"url": "https://github.com/sponsors/ljharb"}},- "node_modules/axobject-query": {- "version": "4.1.0",- "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",- "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",- "engines": {- "node": ">= 0.4"- }- },"node_modules/balanced-match": {"version": "1.0.2","resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",@@ -3059,14 +2987,6 @@"url": "https://github.com/sponsors/sindresorhus"}},- "node_modules/clsx": {- "version": "2.1.1",- "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",- "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",- "engines": {- "node": ">=6"- }- },"node_modules/codemirror": {"version": "5.65.18","resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.18.tgz",@@ -3354,14 +3274,6 @@"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==","dev": true},- "node_modules/deepmerge": {- "version": "4.3.1",- "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",- "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",- "engines": {- "node": ">=0.10.0"- }- },"node_modules/defer-to-connect": {"version": "2.0.1","resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz",@@ -4095,11 +4007,6 @@"node": ">=10.13.0"}},- "node_modules/esm-env": {- "version": "1.2.2",- "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz",- "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA=="- },"node_modules/espree": {"version": "10.4.0","resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",@@ -4129,14 +4036,6 @@"node": ">=0.10"}},- "node_modules/esrap": {- "version": "2.1.0",- "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.1.0.tgz",- "integrity": "sha512-yzmPNpl7TBbMRC5Lj2JlJZNPml0tzqoqP5B1JXycNUwtqma9AKCO0M2wHrdgsHcy1WRW7S9rJknAMtByg3usgA==",- "dependencies": {- "@jridgewell/sourcemap-codec": "^1.4.15"- }- },"node_modules/esrecurse": {"version": "4.3.0","resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",@@ -5342,14 +5241,6 @@"dev": true,"license": "MIT"},- "node_modules/is-reference": {- "version": "3.0.3",- "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",- "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==",- "dependencies": {- "@types/estree": "^1.0.6"- }- },"node_modules/is-regex": {"version": "1.2.1","resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",@@ -5636,14 +5527,6 @@"json-buffer": "3.0.1"}},- "node_modules/kleur": {- "version": "4.1.5",- "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",- "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",- "engines": {- "node": ">=6"- }- },"node_modules/levn": {"version": "0.4.1","resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",@@ -5767,11 +5650,6 @@"node": ">=4"}},- "node_modules/locate-character": {- "version": "3.0.0",- "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",- "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA=="- },"node_modules/locate-path": {"version": "6.0.0","resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",@@ -5833,6 +5711,7 @@"version": "0.30.18","resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.18.tgz","integrity": "sha512-yi8swmWbO17qHhwIBNeeZxTceJMeBvWJaId6dyvTSOwTipqeHhMhOrz6513r1sOKnpvQ7zkhlG8tPrpilwTxHQ==",+ "peer": true,"dependencies": {"@jridgewell/sourcemap-codec": "^1.5.5"}@@ -7603,31 +7482,6 @@"url": "https://github.com/sponsors/ljharb"}},- "node_modules/svelte": {- "version": "5.42.3",- "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.42.3.tgz",- "integrity": "sha512-+8dUmdJGvKSWEfbAgIaUmpD97s1bBAGxEf6s7wQonk+HNdMmrBZtpStzRypRqrYBFUmmhaUgBHUjraE8gLqWAw==",- "license": "MIT",- "dependencies": {- "@jridgewell/remapping": "^2.3.4",- "@jridgewell/sourcemap-codec": "^1.5.0",- "@sveltejs/acorn-typescript": "^1.0.5",- "@types/estree": "^1.0.5",- "acorn": "^8.12.1",- "aria-query": "^5.3.1",- "axobject-query": "^4.1.0",- "clsx": "^2.1.1",- "esm-env": "^1.2.1",- "esrap": "^2.1.0",- "is-reference": "^3.0.3",- "locate-character": "^3.0.0",- "magic-string": "^0.30.11",- "zimmerframe": "^1.1.2"- },- "engines": {- "node": ">=18"- }- },"node_modules/tinyglobby": {"version": "0.2.14","resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz",@@ -8062,19 +7916,6 @@}}},- "node_modules/vitefu": {- "version": "1.1.1",- "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.1.tgz",- "integrity": "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==",- "peerDependencies": {- "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0"- },- "peerDependenciesMeta": {- "vite": {- "optional": true- }- }- },"node_modules/vue": {"version": "3.5.21","resolved": "https://registry.npmjs.org/vue/-/vue-3.5.21.tgz",@@ -8349,11 +8190,6 @@"url": "https://github.com/sponsors/sindresorhus"}},- "node_modules/zimmerframe": {- "version": "1.1.2",- "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz",- "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w=="- },"node_modules/zod": {"version": "4.3.5","resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz",@@ -8510,24 +8346,6 @@"node": ">=18"}},- "packages/playwright-ct-svelte": {- "name": "@playwright/experimental-ct-svelte",- "version": "1.59.0-next",- "license": "Apache-2.0",- "dependencies": {- "@playwright/experimental-ct-core": "1.59.0-next",- "@sveltejs/vite-plugin-svelte": "^5.1.0"- },- "bin": {- "playwright": "cli.js"- },- "devDependencies": {- "svelte": "^5.37.3"- },- "engines": {- "node": ">=18"- }- },"packages/playwright-ct-vue": {"name": "@playwright/experimental-ct-vue","version": "1.59.0-next",diff --git a/packages/playwright-ct-core/src/tsxTransform.ts b/packages/playwright-ct-core/src/tsxTransform.tsindex fbf3d0cc18..09355b51af 100644--- a/packages/playwright-ct-core/src/tsxTransform.ts+++ b/packages/playwright-ct-core/src/tsxTransform.ts@@ -176,7 +176,6 @@ export function importInfo(importNode: T.ImportDeclaration, specifier: T.ImportSconst artifactExtensions = new Set([// Frameworks'.vue',- '.svelte',// Images'.jpg', '.jpeg',diff --git a/packages/playwright-ct-svelte/.npmignore b/packages/playwright-ct-svelte/.npmignoredeleted file mode 100644index 62701eb493..0000000000--- a/packages/playwright-ct-svelte/.npmignore+++ /dev/null@@ -1,12 +0,0 @@-**/*--!README.md-!LICENSE-!cli.js-!register.d.ts-!register.mjs-!registerSource.mjs-!index.d.ts-!index.js-!hooks.d.ts-!hooks.mjsdiff --git a/packages/playwright-ct-svelte/README.md b/packages/playwright-ct-svelte/README.mddeleted file mode 100644index 23ae82312d..0000000000--- a/packages/playwright-ct-svelte/README.md+++ /dev/null@@ -1,3 +0,0 @@-> **BEWARE** This package is EXPERIMENTAL and does not respect semver.--Read more at https://playwright.dev/docs/test-componentsdiff --git a/packages/playwright-ct-svelte/cli.js b/packages/playwright-ct-svelte/cli.jsdeleted file mode 100755index 9cc834ee95..0000000000--- a/packages/playwright-ct-svelte/cli.js+++ /dev/null@@ -1,20 +0,0 @@-#!/usr/bin/env node-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--const { program } = require('@playwright/experimental-ct-core/lib/program');--program.parse(process.argv);diff --git a/packages/playwright-ct-svelte/hooks.d.ts b/packages/playwright-ct-svelte/hooks.d.tsdeleted file mode 100644index dfa037c7de..0000000000--- a/packages/playwright-ct-svelte/hooks.d.ts+++ /dev/null@@ -1,30 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ComponentConstructorOptions, SvelteComponent } from 'svelte';--export declare function beforeMount<HooksConfig>(- callback: (params: {- hooksConfig?: HooksConfig,- App: new (options: Partial<ComponentConstructorOptions>) => SvelteComponent- }) => Promise<SvelteComponent | void>-): void;-export declare function afterMount<HooksConfig>(- callback: (params: {- hooksConfig?: HooksConfig;- svelteComponent: SvelteComponent;- }) => Promise<void>-): void;diff --git a/packages/playwright-ct-svelte/hooks.mjs b/packages/playwright-ct-svelte/hooks.mjsdeleted file mode 100644index b7cea242c4..0000000000--- a/packages/playwright-ct-svelte/hooks.mjs+++ /dev/null@@ -1,29 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--const __pw_hooks_before_mount = [];-const __pw_hooks_after_mount = [];--window.__pw_hooks_before_mount = __pw_hooks_before_mount;-window.__pw_hooks_after_mount = __pw_hooks_after_mount;--export const beforeMount = callback => {- __pw_hooks_before_mount.push(callback);-};--export const afterMount = callback => {- __pw_hooks_after_mount.push(callback);-};diff --git a/packages/playwright-ct-svelte/index.d.ts b/packages/playwright-ct-svelte/index.d.tsdeleted file mode 100644index 8f90d4f2cc..0000000000--- a/packages/playwright-ct-svelte/index.d.ts+++ /dev/null@@ -1,51 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import type { ComponentProps, Component, SvelteComponent } from 'svelte';-import type { TestType, Locator } from '@playwright/experimental-ct-core';--type ComponentSlot = Snippet | string;-type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };-type ComponentEvents = Record<string, Function>;--// TODO: Remove after Svelte has removed S4 fallback TypeScript types for `*.svelte` files-type InteropComponent = (new (...args: unknown[]) => SvelteComponent) | Component<any, any, any>;--export interface MountOptions<HooksConfig, Component extends InteropComponent> {- props?: ComponentProps<Component>;- slots?: ComponentSlots;- on?: ComponentEvents;- hooksConfig?: HooksConfig;-}--export interface MountResult<Component extends InteropComponent> extends Locator {- unmount(): Promise<void>;- update(options: {- props?: Partial<ComponentProps<Component>>;- on?: Partial<ComponentEvents>;- }): Promise<void>;-}--export interface ComponentFixtures {- mount<HooksConfig, Component extends InteropComponent = InteropComponent>(- component: Component,- options?: MountOptions<HooksConfig, Component>- ): Promise<MountResult<Component>>;-}--export const test: TestType<ComponentFixtures>;--export { defineConfig, PlaywrightTestConfig, expect, devices } from '@playwright/experimental-ct-core';diff --git a/packages/playwright-ct-svelte/index.js b/packages/playwright-ct-svelte/index.jsdeleted file mode 100644index 841ff852c7..0000000000--- a/packages/playwright-ct-svelte/index.js+++ /dev/null@@ -1,33 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--const { test, expect, devices, defineConfig: originalDefineConfig } = require('@playwright/experimental-ct-core');-const path = require('path');--const defineConfig = (config, ...configs) => {- return originalDefineConfig({- ...config,- '@playwright/test': {- packageJSON: require.resolve('./package.json'),- },- '@playwright/experimental-ct-core': {- registerSourceFile: path.join(__dirname, 'registerSource.mjs'),- frameworkPluginFactory: () => import('@sveltejs/vite-plugin-svelte').then(plugin => plugin.svelte()),- },- }, ...configs);-};--module.exports = { test, expect, devices, defineConfig };diff --git a/packages/playwright-ct-svelte/package.json b/packages/playwright-ct-svelte/package.jsondeleted file mode 100644index 5e5a3c3275..0000000000--- a/packages/playwright-ct-svelte/package.json+++ /dev/null@@ -1,42 +0,0 @@-{- "name": "@playwright/experimental-ct-svelte",- "version": "1.59.0-next",- "description": "Playwright Component Testing for Svelte",- "repository": {- "type": "git",- "url": "git+https://github.com/microsoft/playwright.git"- },- "homepage": "https://playwright.dev",- "engines": {- "node": ">=18"- },- "author": {- "name": "Microsoft Corporation"- },- "license": "Apache-2.0",- "exports": {- ".": {- "types": "./index.d.ts",- "default": "./index.js"- },- "./register": {- "types": "./register.d.ts",- "default": "./register.mjs"- },- "./hooks": {- "types": "./hooks.d.ts",- "default": "./hooks.mjs"- },- "./package.json": "./package.json"- },- "dependencies": {- "@playwright/experimental-ct-core": "1.59.0-next",- "@sveltejs/vite-plugin-svelte": "^5.1.0"- },- "devDependencies": {- "svelte": "^5.37.3"- },- "bin": {- "playwright": "cli.js"- }-}diff --git a/packages/playwright-ct-svelte/register.d.ts b/packages/playwright-ct-svelte/register.d.tsdeleted file mode 100644index 1431000f4b..0000000000--- a/packages/playwright-ct-svelte/register.d.ts+++ /dev/null@@ -1,22 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--export default function(- components: Record<string, any>,- options?: {- window?: Window- }-): void;diff --git a/packages/playwright-ct-svelte/register.mjs b/packages/playwright-ct-svelte/register.mjsdeleted file mode 100644index ca6a6a12d9..0000000000--- a/packages/playwright-ct-svelte/register.mjs+++ /dev/null@@ -1,21 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { pwRegister } from './registerSource.mjs';--export default components => {- pwRegister(components);-};diff --git a/packages/playwright-ct-svelte/registerSource.mjs b/packages/playwright-ct-svelte/registerSource.mjsdeleted file mode 100644index 1d8f068d01..0000000000--- a/packages/playwright-ct-svelte/registerSource.mjs+++ /dev/null@@ -1,105 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--// @ts-check--// This file is injected into the registry as text, no dependencies are allowed.-import { createRawSnippet } from 'svelte';-import { asClassComponent } from 'svelte/legacy';--/** @typedef {import('../playwright-ct-core/types/component').Component} PlaywrightComponent */-/** @typedef {import('../playwright-ct-core/types/component').ObjectComponent} ObjectComponent */-/** @typedef {any} FrameworkComponent */-/** @typedef {import('svelte').SvelteComponent} SvelteComponent */--/**- * @param {any} component- * @returns {component is ObjectComponent}- */-function isObjectComponent(component) {- return typeof component === 'object' && component && component.__pw_type === 'object-component';-}--/** @type {( component: ObjectComponent ) => Record<string, any>} */-function extractProps(component) {- let { props, slots } = component;-- // Svelte 5 dropped support for the old slot implementation in exchange for prop-based "snippets". Continue- // supporting string snippets in Playwright- slots = Object.fromEntries(- Object.entries(slots ?? {}).map(([key, snippet]) => {- if (typeof snippet === "string") {- return [key, createRawSnippet(() => ({ render: () => snippet }))];- }-- return [key, snippet]- })- );-- return { ...props, ...slots };-}--const __pwSvelteComponentKey = Symbol('svelteComponent');--window.playwrightMount = async (component, rootElement, hooksConfig) => {- if (!isObjectComponent(component))- throw new Error('JSX mount notation is not supported');-- const componentCtor = asClassComponent(component.type);- const props = extractProps(component);-- class App extends componentCtor {- constructor(options = {}) {- super({- target: rootElement,- props,- ...options- });- }- }-- /** @type {SvelteComponent | undefined} */- let svelteComponent;- for (const hook of window.__pw_hooks_before_mount || [])- svelteComponent = await hook({ hooksConfig, App });-- if (!svelteComponent)- svelteComponent = new App();-- rootElement[__pwSvelteComponentKey] = svelteComponent;-- for (const hook of window.__pw_hooks_after_mount || [])- await hook({ hooksConfig, svelteComponent });-};--window.playwrightUnmount = async rootElement => {- const svelteComponent = /** @type {SvelteComponent} */ (rootElement[__pwSvelteComponentKey]);- if (!svelteComponent)- throw new Error('Component was not mounted');- svelteComponent.$destroy();- delete rootElement[__pwSvelteComponentKey];-};--window.playwrightUpdate = async (rootElement, component) => {- if (!isObjectComponent(component))- throw new Error('JSX mount notation is not supported');-- const svelteComponent = /** @type {SvelteComponent} */ (rootElement[__pwSvelteComponentKey]);- if (!svelteComponent)- throw new Error('Component was not mounted');-- svelteComponent.$set(extractProps(component));-};diff --git a/tests/components/ct-svelte-vite/.eslintignore b/tests/components/ct-svelte-vite/.eslintignoredeleted file mode 100644index 01b7e33fd4..0000000000--- a/tests/components/ct-svelte-vite/.eslintignore+++ /dev/null@@ -1 +0,0 @@-**/*\ No newline at end of filediff --git a/tests/components/ct-svelte-vite/.gitignore b/tests/components/ct-svelte-vite/.gitignoredeleted file mode 100644index a547bf36d8..0000000000--- a/tests/components/ct-svelte-vite/.gitignore+++ /dev/null@@ -1,24 +0,0 @@-# Logs-logs-*.log-npm-debug.log*-yarn-debug.log*-yarn-error.log*-pnpm-debug.log*-lerna-debug.log*--node_modules-dist-dist-ssr-*.local--# Editor directories and files-.vscode/*-!.vscode/extensions.json-.idea-.DS_Store-*.suo-*.ntvs*-*.njsproj-*.sln-*.sw?diff --git a/tests/components/ct-svelte-vite/README.md b/tests/components/ct-svelte-vite/README.mddeleted file mode 100644index a9d516a32c..0000000000--- a/tests/components/ct-svelte-vite/README.md+++ /dev/null@@ -1,48 +0,0 @@-# Svelte + TS + Vite--This template should help get you started developing with Svelte and TypeScript in Vite.--## Recommended IDE Setup--[VSCode](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).--## Need an official Svelte framework?--Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.--## Technical considerations--**Why use this over SvelteKit?**--- It brings its own routing solution which might not be preferable for some users.-- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.- `vite dev` and `vite build` wouldn't work in a SvelteKit environment, for example.--This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.--Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.--**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**--Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.--**Why include `.vscode/extensions.json`?**--Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.--**Why enable `allowJs` in the TS template?**--While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.--**Why is HMR not preserving my local component state?**--HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).--If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.--```ts-// store.ts-// An extremely simple external store-import { writable } from 'svelte/store'-export default writable(0)-```diff --git a/tests/components/ct-svelte-vite/index.html b/tests/components/ct-svelte-vite/index.htmldeleted file mode 100644index d2f6839bab..0000000000--- a/tests/components/ct-svelte-vite/index.html+++ /dev/null@@ -1,13 +0,0 @@-<!DOCTYPE html>-<html lang="en">- <head>- <meta charset="UTF-8" />- <link rel="icon" href="/favicon.ico" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Svelte + TS + Vite App</title>- </head>- <body>- <div id="app"></div>- <script type="module" src="/src/main.ts"></script>- </body>-</html>diff --git a/tests/components/ct-svelte-vite/package.json b/tests/components/ct-svelte-vite/package.jsondeleted file mode 100644index a82358e11c..0000000000--- a/tests/components/ct-svelte-vite/package.json+++ /dev/null@@ -1,22 +0,0 @@-{- "name": "ct-svelte-vite",- "private": true,- "version": "0.0.0",- "type": "module",- "scripts": {- "dev": "vite",- "build": "vite build",- "preview": "vite preview",- "typecheck": "svelte-check --tsconfig ./tsconfig.json"- },- "devDependencies": {- "@sveltejs/vite-plugin-svelte": "^5.1.0",- "@tsconfig/svelte": "^5.0.4",- "svelte-check": "^4.3.1",- "typescript": "^5.3.3",- "vite": "^6.3.4"- },- "dependencies": {- "svelte": "^5.37.3"- }-}diff --git a/tests/components/ct-svelte-vite/playwright.config.ts b/tests/components/ct-svelte-vite/playwright.config.tsdeleted file mode 100644index 90b547e158..0000000000--- a/tests/components/ct-svelte-vite/playwright.config.ts+++ /dev/null@@ -1,49 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { defineConfig, devices } from '@playwright/experimental-ct-svelte';-import { resolve } from 'path';--export default defineConfig({- testDir: 'tests',- forbidOnly: !!process.env.CI,- retries: process.env.CI ? 2 : 0,- reporter: process.env.CI ? 'html' : 'line',- use: {- trace: 'on-first-retry',- ctViteConfig: {- resolve: {- alias: {- '@': resolve('./src'),- }- }- }- },- projects: [- {- name: 'chromium',- use: { ...devices['Desktop Chrome'] },- },- {- name: 'firefox',- use: { ...devices['Desktop Firefox'] },- },- {- name: 'webkit',- use: { ...devices['Desktop Safari'] },- },- ],-});diff --git a/tests/components/ct-svelte-vite/playwright/index.html b/tests/components/ct-svelte-vite/playwright/index.htmldeleted file mode 100644index b8b1472b91..0000000000--- a/tests/components/ct-svelte-vite/playwright/index.html+++ /dev/null@@ -1,13 +0,0 @@-<!DOCTYPE html>-<html lang="en">- <head>- <meta charset="UTF-8" />- <link rel="icon" href="/favicon.ico" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Svelte + TS + Vite App</title>- </head>- <body>- <div id="root"></div>- <script type="module" src="./index.ts"></script>- </body>-</html>diff --git a/tests/components/ct-svelte-vite/playwright/index.ts b/tests/components/ct-svelte-vite/playwright/index.tsdeleted file mode 100644index dcbcd47225..0000000000--- a/tests/components/ct-svelte-vite/playwright/index.ts+++ /dev/null@@ -1,20 +0,0 @@-import '../src/assets/index.css';-import { beforeMount, afterMount } from '@playwright/experimental-ct-svelte/hooks';--export type HooksConfig = {- context?: string;- route?: string;-}--beforeMount<HooksConfig>(async ({ hooksConfig, App }) => {- console.log(`Before mount: ${JSON.stringify(hooksConfig)}`);- return new App({- context: new Map([- ['context-key', hooksConfig?.context]- ]),- });-});--afterMount<HooksConfig>(async () => {- console.log(`After mount`);-});diff --git a/tests/components/ct-svelte-vite/playwright/svelte.config.js b/tests/components/ct-svelte-vite/playwright/svelte.config.jsdeleted file mode 100644index 09a1bf7a7b..0000000000--- a/tests/components/ct-svelte-vite/playwright/svelte.config.js+++ /dev/null@@ -1,5 +0,0 @@-import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'--export default {- preprocess: vitePreprocess()-}diff --git a/tests/components/ct-svelte-vite/public/favicon.ico b/tests/components/ct-svelte-vite/public/favicon.icodeleted file mode 100644index d75d248ef0..0000000000Binary files a/tests/components/ct-svelte-vite/public/favicon.ico and /dev/null differdiff --git a/tests/components/ct-svelte-vite/src/App.svelte b/tests/components/ct-svelte-vite/src/App.sveltedeleted file mode 100644index 78f04211bd..0000000000--- a/tests/components/ct-svelte-vite/src/App.svelte+++ /dev/null@@ -1,34 +0,0 @@-<script>-import { onMount, onDestroy } from 'svelte';-import LoginPage from './pages/LoginPage.svelte';-import DashboardPage from './pages/DashboardPage.svelte';--let path = '/';-function updatePath() {- path = window.location.pathname;-}-onMount(() => {- updatePath();- window.addEventListener('popstate', updatePath);-});-onDestroy(() => {- window.removeEventListener('popstate', updatePath);-});-/**- * @param newPath {string}- */-function navigate(newPath) {- history.pushState({}, '', newPath);- updatePath();-}-</script>--<header>- <a on:click={(e) => { e.preventDefault(); navigate('/'); }} href='/login'>Login</a>- <a on:click={(e) => { e.preventDefault(); navigate('/dashboard'); }} href='/dashboard'>Dashboard</a>-</header>-{#if path === '/'}- <LoginPage />-{:else if path === '/dashboard'}- <DashboardPage />-{/if}diff --git a/tests/components/ct-svelte-vite/src/assets/index.css b/tests/components/ct-svelte-vite/src/assets/index.cssdeleted file mode 100644index 97495c44b8..0000000000--- a/tests/components/ct-svelte-vite/src/assets/index.css+++ /dev/null@@ -1,20 +0,0 @@-body {- margin: 0;- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',- sans-serif;- -webkit-font-smoothing: antialiased;- -moz-osx-font-smoothing: grayscale;-}--code {- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',- monospace;-}--@media (prefers-color-scheme: light) {- :root {- color: #e3e3e3;- background-color: #1b1b1d;- }-}diff --git a/tests/components/ct-svelte-vite/src/components/Button.svelte b/tests/components/ct-svelte-vite/src/components/Button.sveltedeleted file mode 100644index 2fdaca299b..0000000000--- a/tests/components/ct-svelte-vite/src/components/Button.svelte+++ /dev/null@@ -1,5 +0,0 @@-<script lang="ts">- const { title, onsubmit } = $props();-</script>--<button onclick={() => onsubmit('hello')}>{title}</button>\ No newline at end of filediff --git a/tests/components/ct-svelte-vite/src/components/Context.svelte b/tests/components/ct-svelte-vite/src/components/Context.sveltedeleted file mode 100644index 734c9938ba..0000000000--- a/tests/components/ct-svelte-vite/src/components/Context.svelte+++ /dev/null@@ -1,6 +0,0 @@-<script lang="ts">-import { getContext } from 'svelte';-const contextValue = getContext('context-key');-</script>--<div>{contextValue}</div>diff --git a/tests/components/ct-svelte-vite/src/components/Counter.svelte b/tests/components/ct-svelte-vite/src/components/Counter.sveltedeleted file mode 100644index 284f12cd35..0000000000--- a/tests/components/ct-svelte-vite/src/components/Counter.svelte+++ /dev/null@@ -1,10 +0,0 @@-<script lang="ts">-import { update, remountCount } from '../store'-const { count, onsubmit } = $props();-update();-</script>--<button onclick={() => onsubmit('hello')}>- <span data-testid="props">{count}</span>- <span data-testid="remount-count">{remountCount}</span>-</button>diff --git a/tests/components/ct-svelte-vite/src/components/DefaultSlot.svelte b/tests/components/ct-svelte-vite/src/components/DefaultSlot.sveltedeleted file mode 100644index 7eba923f3b..0000000000--- a/tests/components/ct-svelte-vite/src/components/DefaultSlot.svelte+++ /dev/null@@ -1,13 +0,0 @@-<script>-const { children } = $props()-</script>--<div>- <h1>Welcome!</h1>- <main>- {@render children()}- </main>- <footer>- Thanks for visiting.- </footer>-</div>diff --git a/tests/components/ct-svelte-vite/src/components/Empty.svelte b/tests/components/ct-svelte-vite/src/components/Empty.sveltedeleted file mode 100644index e69de29bb2..0000000000diff --git a/tests/components/ct-svelte-vite/src/components/MultiRoot.svelte b/tests/components/ct-svelte-vite/src/components/MultiRoot.sveltedeleted file mode 100644index 87996d0ce0..0000000000--- a/tests/components/ct-svelte-vite/src/components/MultiRoot.svelte+++ /dev/null@@ -1,2 +0,0 @@-<div>root 1</div>-<div>root 2</div>diff --git a/tests/components/ct-svelte-vite/src/components/NamedSlots.svelte b/tests/components/ct-svelte-vite/src/components/NamedSlots.sveltedeleted file mode 100644index e095a50dcf..0000000000--- a/tests/components/ct-svelte-vite/src/components/NamedSlots.svelte+++ /dev/null@@ -1,15 +0,0 @@-<script>-const { header, main, footer } = $props()-</script>--<div>- <header>- {@render header()}- </header>- <main>- {@render main()}- </main>- <footer>- {@render footer()}- </footer>-</div>diff --git a/tests/components/ct-svelte-vite/src/main.ts b/tests/components/ct-svelte-vite/src/main.tsdeleted file mode 100644index 4e7ad898e9..0000000000--- a/tests/components/ct-svelte-vite/src/main.ts+++ /dev/null@@ -1,8 +0,0 @@-import App from './App.svelte';-import './assets/index.css';--const app = new App({- target: document.getElementById('app')!-});--export default app;diff --git a/tests/components/ct-svelte-vite/src/pages/DashboardPage.svelte b/tests/components/ct-svelte-vite/src/pages/DashboardPage.sveltedeleted file mode 100644index 161f5338e8..0000000000--- a/tests/components/ct-svelte-vite/src/pages/DashboardPage.svelte+++ /dev/null@@ -1 +0,0 @@-<main>Dashboard</main>diff --git a/tests/components/ct-svelte-vite/src/pages/LoginPage.svelte b/tests/components/ct-svelte-vite/src/pages/LoginPage.sveltedeleted file mode 100644index 3c359ab27c..0000000000--- a/tests/components/ct-svelte-vite/src/pages/LoginPage.svelte+++ /dev/null@@ -1 +0,0 @@-<main>Login</main>diff --git a/tests/components/ct-svelte-vite/src/store/index.ts b/tests/components/ct-svelte-vite/src/store/index.tsdeleted file mode 100644index 43d7ee31fc..0000000000--- a/tests/components/ct-svelte-vite/src/store/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export let remountCount = 0;-export function update() {- remountCount++;-}diff --git a/tests/components/ct-svelte-vite/src/vite-env.d.ts b/tests/components/ct-svelte-vite/src/vite-env.d.tsdeleted file mode 100644index 4078e7476a..0000000000--- a/tests/components/ct-svelte-vite/src/vite-env.d.ts+++ /dev/null@@ -1,2 +0,0 @@-/// <reference types="svelte" />-/// <reference types="vite/client" />diff --git a/tests/components/ct-svelte-vite/tests/events.spec.ts b/tests/components/ct-svelte-vite/tests/events.spec.tsdeleted file mode 100644index 002229d6bd..0000000000--- a/tests/components/ct-svelte-vite/tests/events.spec.ts+++ /dev/null@@ -1,14 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Button from '@/components/Button.svelte';--test('emit an submit event when the button is clicked', async ({ mount }) => {- const messages: string[] = [];- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: (data: string) => messages.push(data),- },- });- await component.click();- expect(messages).toEqual(['hello']);-});diff --git a/tests/components/ct-svelte-vite/tests/render.spec.ts b/tests/components/ct-svelte-vite/tests/render.spec.tsdeleted file mode 100644index c28618a666..0000000000--- a/tests/components/ct-svelte-vite/tests/render.spec.ts+++ /dev/null@@ -1,31 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import type { HooksConfig } from '../playwright';-import Button from '@/components/Button.svelte';-import Empty from '@/components/Empty.svelte';-import Context from '@/components/Context.svelte';--test('render props', async ({ mount }) => {- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await expect(component).toContainText('Submit');-});--test('get textContent of the empty component', async ({ mount }) => {- const component = await mount(Empty);- expect(await component.allTextContents()).toEqual(['']);- expect(await component.textContent()).toBe('');- await expect(component).toHaveText('');-});--test('render context', async ({ mount }) => {- const component = await mount<HooksConfig>(Context, {- hooksConfig: {- context: 'context-value',- }- });- await expect(component).toContainText('context-value');-});diff --git a/tests/components/ct-svelte-vite/tests/router.spec.ts b/tests/components/ct-svelte-vite/tests/router.spec.tsdeleted file mode 100644index 127620b3c9..0000000000--- a/tests/components/ct-svelte-vite/tests/router.spec.ts+++ /dev/null@@ -1,11 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import App from '@/App.svelte';--test('navigate to a page by clicking a link', async ({ page, mount }) => {- const component = await mount(App);- await expect(component.getByRole('main')).toHaveText('Login');- await expect(page).toHaveURL('/');- await component.getByRole('link', { name: 'Dashboard' }).click();- await expect(component.getByRole('main')).toHaveText('Dashboard');- await expect(page).toHaveURL('/dashboard');-});diff --git a/tests/components/ct-svelte-vite/tests/slots.spec.ts b/tests/components/ct-svelte-vite/tests/slots.spec.tsdeleted file mode 100644index 949a51e747..0000000000--- a/tests/components/ct-svelte-vite/tests/slots.spec.ts+++ /dev/null@@ -1,25 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import DefaultSlot from '@/components/DefaultSlot.svelte';-import NamedSlots from '@/components/NamedSlots.svelte';--test('render main children slot', async ({ mount }) => {- const component = await mount(DefaultSlot, {- slots: {- children: 'Main Content',- },- });- await expect(component).toContainText('Main Content');-});--test('render a component with a named slot', async ({ mount }) => {- const component = await mount(NamedSlots, {- slots: {- header: 'Header',- main: 'Main Content',- footer: 'Footer',- },- });- await expect(component).toContainText('Header');- await expect(component).toContainText('Main Content');- await expect(component).toContainText('Footer');-});diff --git a/tests/components/ct-svelte-vite/tests/unmount.spec.ts b/tests/components/ct-svelte-vite/tests/unmount.spec.tsdeleted file mode 100644index a3ec17c04b..0000000000--- a/tests/components/ct-svelte-vite/tests/unmount.spec.ts+++ /dev/null@@ -1,52 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Button from '@/components/Button.svelte';-import MultiRoot from '@/components/MultiRoot.svelte';--test('unmount', async ({ page, mount }) => {- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await expect(page.locator('#root')).toContainText('Submit');- await component.unmount();- await expect(page.locator('#root')).not.toContainText('Submit');-});--test('unmount a multi root component', async ({ mount, page }) => {- const component = await mount(MultiRoot);- await expect(page.locator('#root')).toContainText('root 1');- await expect(page.locator('#root')).toContainText('root 2');- await component.unmount();- await expect(page.locator('#root')).not.toContainText('root 1');- await expect(page.locator('#root')).not.toContainText('root 2');-});--test('unmount twice throws an error', async ({ mount }) => {- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await component.unmount();- await expect(component.unmount()).rejects.toThrowError('Component was not mounted');-});--test('mount then unmount then mount', async ({ mount }) => {- let component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await component.unmount();- component = await mount(Button, {- props: {- title: 'Save',- onsubmit: () => {},- },- });- await expect(component).toContainText('Save');-});diff --git a/tests/components/ct-svelte-vite/tests/update.spec.ts b/tests/components/ct-svelte-vite/tests/update.spec.tsdeleted file mode 100644index 96bfb37915..0000000000--- a/tests/components/ct-svelte-vite/tests/update.spec.ts+++ /dev/null@@ -1,37 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Counter from '@/components/Counter.svelte';--test('update props without remounting', async ({ mount }) => {- const component = await mount(Counter, {- props: {- count: 9001,- onsubmit: () => {},- },- });- await expect(component.getByTestId('props')).toContainText('9001');-- await component.update({- props: {- count: 1337,- },- });- await expect(component).not.toContainText('9001');- await expect(component.getByTestId('props')).toContainText('1337');-- await expect(component.getByTestId('remount-count')).toContainText('1');-});--test('update event listeners without remounting', async ({ mount }) => {- const component = await mount(Counter);-- const messages: string[] = [];- await component.update({- props: {- onsubmit: (data: string) => messages.push(data),- }- });- await component.click();- expect(messages).toEqual(['hello']);-- await expect(component.getByTestId('remount-count')).toContainText('1');-});diff --git a/tests/components/ct-svelte-vite/tsconfig.json b/tests/components/ct-svelte-vite/tsconfig.jsondeleted file mode 100644index 4dc15b75b0..0000000000--- a/tests/components/ct-svelte-vite/tsconfig.json+++ /dev/null@@ -1,26 +0,0 @@-{- "extends": "@tsconfig/svelte/tsconfig.json",- "compilerOptions": {- "target": "esnext",- "useDefineForClassFields": true,- "module": "esnext",- "resolveJsonModule": true,- /**- * Typecheck JS in `.svelte` and `.js` files by default.- * Disable checkJs if you'd like to use dynamic types in JS.- * Note that setting allowJs false does not prevent the use- * of JS in `.svelte` files.- */- "allowJs": true,- "checkJs": true,- "skipLibCheck": true,- "strict": true,- "baseUrl": ".",- "paths": {- "@/*": ["./src/*"],- "*": ["_"],- }- },- "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte", "src/**/*.spec.*/*", "tests/**/*.ts"],- "references": [{ "path": "./tsconfig.node.json" }]-}diff --git a/tests/components/ct-svelte-vite/tsconfig.node.json b/tests/components/ct-svelte-vite/tsconfig.node.jsondeleted file mode 100644index e993792cb1..0000000000--- a/tests/components/ct-svelte-vite/tsconfig.node.json+++ /dev/null@@ -1,8 +0,0 @@-{- "compilerOptions": {- "composite": true,- "module": "esnext",- "moduleResolution": "node"- },- "include": ["vite.config.ts"]-}diff --git a/tests/components/ct-svelte-vite/vite.config.ts b/tests/components/ct-svelte-vite/vite.config.tsdeleted file mode 100644index 401b4d4bd6..0000000000--- a/tests/components/ct-svelte-vite/vite.config.ts+++ /dev/null@@ -1,7 +0,0 @@-import { defineConfig } from 'vite'-import { svelte } from '@sveltejs/vite-plugin-svelte'--// https://vitejs.dev/config/-export default defineConfig({- plugins: [svelte()]-})diff --git a/tests/components/ct-svelte/.gitignore b/tests/components/ct-svelte/.gitignoredeleted file mode 100644index 2347f3ca3b..0000000000--- a/tests/components/ct-svelte/.gitignore+++ /dev/null@@ -1,5 +0,0 @@-/node_modules/-/public/build/-/public/tests/--.DS_Storediff --git a/tests/components/ct-svelte/README.md b/tests/components/ct-svelte/README.mddeleted file mode 100644index 8ca4fcaff9..0000000000--- a/tests/components/ct-svelte/README.md+++ /dev/null@@ -1,109 +0,0 @@-*Psst — looking for a more complete solution? Check out [SvelteKit](https://kit.svelte.dev), the official framework for building web applications of all sizes, with a beautiful development experience and flexible filesystem-based routing.*--*Looking for a shareable component template instead? You can [use SvelteKit for that as well](https://kit.svelte.dev/docs#packaging) or the older [sveltejs/component-template](https://github.com/sveltejs/component-template)*-------# svelte app--This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.--To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):--```bash-npx degit sveltejs/template svelte-app-cd svelte-app-```--*Note that you will need to have [Node.js](https://nodejs.org) installed.*---## Get started--Install the dependencies...--```bash-cd svelte-app-npm install-```--...then start [Rollup](https://rollupjs.org):--```bash-npm run dev-```--Navigate to [localhost:8080](http://localhost:8080). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.--By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.--If you're using [Visual Studio Code](https://code.visualstudio.com/) we recommend installing the official extension [Svelte for VS Code](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode). If you are using other editors you may need to install a plugin in order to get syntax highlighting and intellisense.--## Building and running in production mode--To create an optimised version of the app:--```bash-npm run build-```--You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com).---## Single-page app mode--By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.--If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json:--```js-"start": "sirv public --single"-```--## Using TypeScript--This template comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with:--```bash-node scripts/setupTypeScript.js-```--Or remove the script via:--```bash-rm scripts/setupTypeScript.js-```--If you want to use `baseUrl` or `path` aliases within your `tsconfig`, you need to set up `@rollup/plugin-alias` to tell Rollup to resolve the aliases. For more info, see [this StackOverflow question](https://stackoverflow.com/questions/63427935/setup-tsconfig-path-in-svelte).--## Deploying to the web--### With [Vercel](https://vercel.com)--Install `vercel` if you haven't already:--```bash-npm install -g vercel-```--Then, from within your project folder:--```bash-cd public-vercel deploy --name my-project-```--### With [surge](https://surge.sh/)--Install `surge` if you haven't already:--```bash-npm install -g surge-```--Then, from within your project folder:--```bash-npm run build-surge public my-project.surge.sh-```diff --git a/tests/components/ct-svelte/package.json b/tests/components/ct-svelte/package.jsondeleted file mode 100644index fc2e677986..0000000000--- a/tests/components/ct-svelte/package.json+++ /dev/null@@ -1,24 +0,0 @@-{- "name": "ct-svelte",- "version": "1.0.0",- "private": true,- "scripts": {- "build": "rollup -c",- "dev": "rollup -c -w",- "start": "sirv public --no-clear",- "typecheck": "tsc --noEmit"- },- "devDependencies": {- "@rollup/plugin-commonjs": "^17.0.0",- "@rollup/plugin-node-resolve": "^11.0.0",- "rollup": "^2.3.4",- "rollup-plugin-css-only": "^3.1.0",- "rollup-plugin-livereload": "^2.0.0",- "rollup-plugin-svelte": "^7.0.0",- "rollup-plugin-terser": "^7.0.0",- "sirv-cli": "^2.0.0"- },- "dependencies": {- "svelte": "^5.37.3"- }-}diff --git a/tests/components/ct-svelte/playwright.config.ts b/tests/components/ct-svelte/playwright.config.tsdeleted file mode 100644index e26caad736..0000000000--- a/tests/components/ct-svelte/playwright.config.ts+++ /dev/null@@ -1,49 +0,0 @@-/**- * Copyright (c) Microsoft Corporation.- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import { defineConfig, devices } from '@playwright/experimental-ct-svelte';-import { resolve } from 'path';--export default defineConfig({- testDir: 'tests',- forbidOnly: !!process.env.CI,- retries: process.env.CI ? 2 : 0,- reporter: process.env.CI ? 'html' : 'line',- use: {- trace: 'on-first-retry',- ctViteConfig: {- resolve: {- alias: {- '@': resolve(__dirname, './src'),- }- }- }- },- projects: [- {- name: 'chromium',- use: { ...devices['Desktop Chrome'] },- },- {- name: 'firefox',- use: { ...devices['Desktop Firefox'] },- },- {- name: 'webkit',- use: { ...devices['Desktop Safari'] },- },- ],-});diff --git a/tests/components/ct-svelte/playwright/index.html b/tests/components/ct-svelte/playwright/index.htmldeleted file mode 100644index 43136a165e..0000000000--- a/tests/components/ct-svelte/playwright/index.html+++ /dev/null@@ -1,13 +0,0 @@-<!DOCTYPE html>-<html lang="en">- <head>- <meta charset="UTF-8" />- <link rel="icon" href="/favicon.ico" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Svelte Test</title>- </head>- <body>- <div id="root"></div>- <script type="module" src="./index.ts"></script>- </body>-</html>diff --git a/tests/components/ct-svelte/playwright/index.ts b/tests/components/ct-svelte/playwright/index.tsdeleted file mode 100644index fe89c98e10..0000000000--- a/tests/components/ct-svelte/playwright/index.ts+++ /dev/null@@ -1,15 +0,0 @@-// @ts-check-import '../src/assets/index.css';-import { beforeMount, afterMount } from '@playwright/experimental-ct-svelte/hooks';--export type HooksConfig = {- route: string;-}--beforeMount<HooksConfig>(async ({ hooksConfig }) => {- console.log(`Before mount: ${JSON.stringify(hooksConfig)}`);-});--afterMount<HooksConfig>(async () => {- console.log(`After mount`);-});diff --git a/tests/components/ct-svelte/public/favicon.png b/tests/components/ct-svelte/public/favicon.pngdeleted file mode 100644index 7e6f5eb5a2..0000000000Binary files a/tests/components/ct-svelte/public/favicon.png and /dev/null differdiff --git a/tests/components/ct-svelte/public/index.html b/tests/components/ct-svelte/public/index.htmldeleted file mode 100644index 74558940d0..0000000000--- a/tests/components/ct-svelte/public/index.html+++ /dev/null@@ -1,17 +0,0 @@-<!DOCTYPE html>-<html lang="en">-<head>- <meta charset='utf-8'>- <meta name='viewport' content='width=device-width,initial-scale=1'>-- <title>Svelte app</title>-- <link rel='icon' type='image/png' href='/favicon.png'>- <link rel='stylesheet' href='/build/bundle.css'>-- <script defer src='/build/bundle.js'></script>-</head>--<body>-</body>-</html>diff --git a/tests/components/ct-svelte/rollup.config.js b/tests/components/ct-svelte/rollup.config.jsdeleted file mode 100644index 10b425f1fb..0000000000--- a/tests/components/ct-svelte/rollup.config.js+++ /dev/null@@ -1,121 +0,0 @@-import svelte from 'rollup-plugin-svelte';-import commonjs from '@rollup/plugin-commonjs';-import resolve from '@rollup/plugin-node-resolve';-import livereload from 'rollup-plugin-livereload';-import { terser } from 'rollup-plugin-terser';-import css from 'rollup-plugin-css-only';--const production = !process.env.ROLLUP_WATCH;--function serve() {- let server;-- function toExit() {- if (server) server.kill(0);- }-- return {- writeBundle() {- if (server) return;- server = require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {- stdio: ['ignore', 'inherit', 'inherit'],- shell: true- });-- process.on('SIGTERM', toExit);- process.on('exit', toExit);- }- };-}--const prod = {- input: 'src/main.js',- output: {- sourcemap: true,- format: 'iife',- name: 'app',- file: 'public/build/bundle.js'- },- plugins: [- svelte({- compilerOptions: {- // enable run-time checks when not in production- dev: !production- }- }),- // we'll extract any component CSS out into- // a separate file - better for performance- css({ output: 'bundle.css' }),-- // If you have external dependencies installed from- // npm, you'll most likely need these plugins. In- // some cases you'll need additional configuration -- // consult the documentation for details:- // https://github.com/rollup/plugins/tree/master/packages/commonjs- resolve({- browser: true,- dedupe: ['svelte']- }),- commonjs(),-- // In dev mode, call `npm run start` once- // the bundle has been generated- !production && serve(),-- // Watch the `public` directory and refresh the- // browser on changes when not in production- !production && livereload('public'),-- // If we're building for production (npm run build- // instead of npm run dev), minify- production && terser()- ],- watch: {- clearScreen: false- }-};--const test = {- input: 'src/tests.js',- output: {- sourcemap: true,- format: 'iife',- name: 'app',- file: 'public/tests/bundle.js'- },- plugins: [- svelte({- compilerOptions: {- // enable run-time checks when not in production- dev: !production- }- }),- // we'll extract any component CSS out into- // a separate file - better for performance- css({ output: 'bundle.css' }),-- // If you have external dependencies installed from- // npm, you'll most likely need these plugins. In- // some cases you'll need additional configuration -- // consult the documentation for details:- // https://github.com/rollup/plugins/tree/master/packages/commonjs- resolve({- browser: true,- dedupe: ['svelte']- }),- commonjs(),-- // Watch the `public` directory and refresh the- // browser on changes when not in production- !production && livereload('public'),-- // If we're building for production (npm run build- // instead of npm run dev), minify- production && terser()- ],- watch: {- clearScreen: false- },-};--export default [ prod, test ];diff --git a/tests/components/ct-svelte/scripts/setupTypeScript.js b/tests/components/ct-svelte/scripts/setupTypeScript.jsdeleted file mode 100644index e6184aa223..0000000000--- a/tests/components/ct-svelte/scripts/setupTypeScript.js+++ /dev/null@@ -1,121 +0,0 @@-// @ts-check--/** This script modifies the project to support TS code in .svelte files like:-- <script lang="ts">- export let name: string;- </script>-- As well as validating the code for CI.- */--/** To work on this script:- rm -rf test-template template && git clone sveltejs/template test-template && node scripts/setupTypeScript.js test-template-*/--const fs = require("fs")-const path = require("path")-const { argv } = require("process")--const projectRoot = argv[2] || path.join(__dirname, "..")--// Add deps to pkg.json-const packageJSON = JSON.parse(fs.readFileSync(path.join(projectRoot, "package.json"), "utf8"))-packageJSON.devDependencies = Object.assign(packageJSON.devDependencies, {- "svelte-check": "^2.0.0",- "svelte-preprocess": "^4.0.0",- "@rollup/plugin-typescript": "^8.0.0",- "typescript": "^4.0.0",- "tslib": "^2.0.0",- "@tsconfig/svelte": "^2.0.0"-})--// Add script for checking-packageJSON.scripts = Object.assign(packageJSON.scripts, {- "check": "svelte-check --tsconfig ./tsconfig.json"-})--// Write the package JSON-fs.writeFileSync(path.join(projectRoot, "package.json"), JSON.stringify(packageJSON, null, " "))--// mv src/main.js to main.ts - note, we need to edit rollup.config.js for this too-const beforeMainJSPath = path.join(projectRoot, "src", "main.js")-const afterMainTSPath = path.join(projectRoot, "src", "main.ts")-fs.renameSync(beforeMainJSPath, afterMainTSPath)--// Switch the app.svelte file to use TS-const appSveltePath = path.join(projectRoot, "src", "App.svelte")-let appFile = fs.readFileSync(appSveltePath, "utf8")-appFile = appFile.replace("<script>", '<script lang="ts">')-appFile = appFile.replace("export let name;", 'export let name: string;')-fs.writeFileSync(appSveltePath, appFile)--// Edit rollup config-const rollupConfigPath = path.join(projectRoot, "rollup.config.js")-let rollupConfig = fs.readFileSync(rollupConfigPath, "utf8")--// Edit imports-rollupConfig = rollupConfig.replace(`'rollup-plugin-terser';`, `'rollup-plugin-terser';-import sveltePreprocess from 'svelte-preprocess';-import typescript from '@rollup/plugin-typescript';`)--// Replace name of entry point-rollupConfig = rollupConfig.replace(`'src/main.js'`, `'src/main.ts'`)--// Add preprocessor-rollupConfig = rollupConfig.replace(- 'compilerOptions:',- 'preprocess: sveltePreprocess({ sourceMap: !production }),\n\t\t\tcompilerOptions:'-);--// Add TypeScript-rollupConfig = rollupConfig.replace(- 'commonjs(),',- 'commonjs(),\n\t\ttypescript({\n\t\t\tsourceMap: !production,\n\t\t\tinlineSources: !production\n\t\t}),'-);-fs.writeFileSync(rollupConfigPath, rollupConfig)--// Add TSConfig-const tsconfig = `{- "extends": "@tsconfig/svelte/tsconfig.json",-- "include": ["src/**/*"],- "exclude": ["node_modules/*", "__sapper__/*", "public/*"]-}`-const tsconfigPath = path.join(projectRoot, "tsconfig.json")-fs.writeFileSync(tsconfigPath, tsconfig)--// Add global.d.ts-const dtsPath = path.join(projectRoot, "src", "global.d.ts")-fs.writeFileSync(dtsPath, `/// <reference types="svelte" />`)--// Delete this script, but not during testing-if (!argv[2]) {- // Remove the script- fs.unlinkSync(path.join(__filename))-- // Check for Mac's DS_store file, and if it's the only one left remove it- const remainingFiles = fs.readdirSync(path.join(__dirname))- if (remainingFiles.length === 1 && remainingFiles[0] === '.DS_store') {- fs.unlinkSync(path.join(__dirname, '.DS_store'))- }-- // Check if the scripts folder is empty- if (fs.readdirSync(path.join(__dirname)).length === 0) {- // Remove the scripts folder- fs.rmdirSync(path.join(__dirname))- }-}--// Adds the extension recommendation-fs.mkdirSync(path.join(projectRoot, ".vscode"), { recursive: true })-fs.writeFileSync(path.join(projectRoot, ".vscode", "extensions.json"), `{- "recommendations": ["svelte.svelte-vscode"]-}-`)--console.log("Converted to TypeScript.")--if (fs.existsSync(path.join(projectRoot, "node_modules"))) {- console.log("\nYou will need to re-run your dependency manager to get started.")-}diff --git a/tests/components/ct-svelte/src/App.svelte b/tests/components/ct-svelte/src/App.sveltedeleted file mode 100644index 78f04211bd..0000000000--- a/tests/components/ct-svelte/src/App.svelte+++ /dev/null@@ -1,34 +0,0 @@-<script>-import { onMount, onDestroy } from 'svelte';-import LoginPage from './pages/LoginPage.svelte';-import DashboardPage from './pages/DashboardPage.svelte';--let path = '/';-function updatePath() {- path = window.location.pathname;-}-onMount(() => {- updatePath();- window.addEventListener('popstate', updatePath);-});-onDestroy(() => {- window.removeEventListener('popstate', updatePath);-});-/**- * @param newPath {string}- */-function navigate(newPath) {- history.pushState({}, '', newPath);- updatePath();-}-</script>--<header>- <a on:click={(e) => { e.preventDefault(); navigate('/'); }} href='/login'>Login</a>- <a on:click={(e) => { e.preventDefault(); navigate('/dashboard'); }} href='/dashboard'>Dashboard</a>-</header>-{#if path === '/'}- <LoginPage />-{:else if path === '/dashboard'}- <DashboardPage />-{/if}diff --git a/tests/components/ct-svelte/src/assets/index.css b/tests/components/ct-svelte/src/assets/index.cssdeleted file mode 100644index 97495c44b8..0000000000--- a/tests/components/ct-svelte/src/assets/index.css+++ /dev/null@@ -1,20 +0,0 @@-body {- margin: 0;- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',- sans-serif;- -webkit-font-smoothing: antialiased;- -moz-osx-font-smoothing: grayscale;-}--code {- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',- monospace;-}--@media (prefers-color-scheme: light) {- :root {- color: #e3e3e3;- background-color: #1b1b1d;- }-}diff --git a/tests/components/ct-svelte/src/components/Button.svelte b/tests/components/ct-svelte/src/components/Button.sveltedeleted file mode 100644index 2fdaca299b..0000000000--- a/tests/components/ct-svelte/src/components/Button.svelte+++ /dev/null@@ -1,5 +0,0 @@-<script lang="ts">- const { title, onsubmit } = $props();-</script>--<button onclick={() => onsubmit('hello')}>{title}</button>\ No newline at end of filediff --git a/tests/components/ct-svelte/src/components/Component.svelte b/tests/components/ct-svelte/src/components/Component.sveltedeleted file mode 100644index 179f993315..0000000000--- a/tests/components/ct-svelte/src/components/Component.svelte+++ /dev/null@@ -1 +0,0 @@-<div>test</div>diff --git a/tests/components/ct-svelte/src/components/Counter.svelte b/tests/components/ct-svelte/src/components/Counter.sveltedeleted file mode 100644index 284f12cd35..0000000000--- a/tests/components/ct-svelte/src/components/Counter.svelte+++ /dev/null@@ -1,10 +0,0 @@-<script lang="ts">-import { update, remountCount } from '../store'-const { count, onsubmit } = $props();-update();-</script>--<button onclick={() => onsubmit('hello')}>- <span data-testid="props">{count}</span>- <span data-testid="remount-count">{remountCount}</span>-</button>diff --git a/tests/components/ct-svelte/src/components/DefaultSlot.svelte b/tests/components/ct-svelte/src/components/DefaultSlot.sveltedeleted file mode 100644index 7eba923f3b..0000000000--- a/tests/components/ct-svelte/src/components/DefaultSlot.svelte+++ /dev/null@@ -1,13 +0,0 @@-<script>-const { children } = $props()-</script>--<div>- <h1>Welcome!</h1>- <main>- {@render children()}- </main>- <footer>- Thanks for visiting.- </footer>-</div>diff --git a/tests/components/ct-svelte/src/components/Empty.svelte b/tests/components/ct-svelte/src/components/Empty.sveltedeleted file mode 100644index e69de29bb2..0000000000diff --git a/tests/components/ct-svelte/src/components/MultiRoot.svelte b/tests/components/ct-svelte/src/components/MultiRoot.sveltedeleted file mode 100644index 87996d0ce0..0000000000--- a/tests/components/ct-svelte/src/components/MultiRoot.svelte+++ /dev/null@@ -1,2 +0,0 @@-<div>root 1</div>-<div>root 2</div>diff --git a/tests/components/ct-svelte/src/components/NamedSlots.svelte b/tests/components/ct-svelte/src/components/NamedSlots.sveltedeleted file mode 100644index e095a50dcf..0000000000--- a/tests/components/ct-svelte/src/components/NamedSlots.svelte+++ /dev/null@@ -1,15 +0,0 @@-<script>-const { header, main, footer } = $props()-</script>--<div>- <header>- {@render header()}- </header>- <main>- {@render main()}- </main>- <footer>- {@render footer()}- </footer>-</div>diff --git a/tests/components/ct-svelte/src/main.js b/tests/components/ct-svelte/src/main.jsdeleted file mode 100644index e081023688..0000000000--- a/tests/components/ct-svelte/src/main.js+++ /dev/null@@ -1,8 +0,0 @@-import App from './App.svelte';-import './assets/index.css';--const app = new App({- target: document.body,-});--export default app;diff --git a/tests/components/ct-svelte/src/pages/DashboardPage.svelte b/tests/components/ct-svelte/src/pages/DashboardPage.sveltedeleted file mode 100644index 161f5338e8..0000000000--- a/tests/components/ct-svelte/src/pages/DashboardPage.svelte+++ /dev/null@@ -1 +0,0 @@-<main>Dashboard</main>diff --git a/tests/components/ct-svelte/src/pages/LoginPage.svelte b/tests/components/ct-svelte/src/pages/LoginPage.sveltedeleted file mode 100644index 3c359ab27c..0000000000--- a/tests/components/ct-svelte/src/pages/LoginPage.svelte+++ /dev/null@@ -1 +0,0 @@-<main>Login</main>diff --git a/tests/components/ct-svelte/src/store/index.ts b/tests/components/ct-svelte/src/store/index.tsdeleted file mode 100644index 43d7ee31fc..0000000000--- a/tests/components/ct-svelte/src/store/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export let remountCount = 0;-export function update() {- remountCount++;-}diff --git a/tests/components/ct-svelte/tests/events.spec.ts b/tests/components/ct-svelte/tests/events.spec.tsdeleted file mode 100644index 002229d6bd..0000000000--- a/tests/components/ct-svelte/tests/events.spec.ts+++ /dev/null@@ -1,14 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Button from '@/components/Button.svelte';--test('emit an submit event when the button is clicked', async ({ mount }) => {- const messages: string[] = [];- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: (data: string) => messages.push(data),- },- });- await component.click();- expect(messages).toEqual(['hello']);-});diff --git a/tests/components/ct-svelte/tests/render.spec.ts b/tests/components/ct-svelte/tests/render.spec.tsdeleted file mode 100644index e1d9939e25..0000000000--- a/tests/components/ct-svelte/tests/render.spec.ts+++ /dev/null@@ -1,20 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Button from '@/components/Button.svelte';-import Empty from '@/components/Empty.svelte';--test('render props', async ({ mount }) => {- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await expect(component).toContainText('Submit');-});--test('get textContent of the empty component', async ({ mount }) => {- const component = await mount(Empty);- expect(await component.allTextContents()).toEqual(['']);- expect(await component.textContent()).toBe('');- await expect(component).toHaveText('');-});diff --git a/tests/components/ct-svelte/tests/router.spec.ts b/tests/components/ct-svelte/tests/router.spec.tsdeleted file mode 100644index 127620b3c9..0000000000--- a/tests/components/ct-svelte/tests/router.spec.ts+++ /dev/null@@ -1,11 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import App from '@/App.svelte';--test('navigate to a page by clicking a link', async ({ page, mount }) => {- const component = await mount(App);- await expect(component.getByRole('main')).toHaveText('Login');- await expect(page).toHaveURL('/');- await component.getByRole('link', { name: 'Dashboard' }).click();- await expect(component.getByRole('main')).toHaveText('Dashboard');- await expect(page).toHaveURL('/dashboard');-});diff --git a/tests/components/ct-svelte/tests/slots.spec.ts b/tests/components/ct-svelte/tests/slots.spec.tsdeleted file mode 100644index 949a51e747..0000000000--- a/tests/components/ct-svelte/tests/slots.spec.ts+++ /dev/null@@ -1,25 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import DefaultSlot from '@/components/DefaultSlot.svelte';-import NamedSlots from '@/components/NamedSlots.svelte';--test('render main children slot', async ({ mount }) => {- const component = await mount(DefaultSlot, {- slots: {- children: 'Main Content',- },- });- await expect(component).toContainText('Main Content');-});--test('render a component with a named slot', async ({ mount }) => {- const component = await mount(NamedSlots, {- slots: {- header: 'Header',- main: 'Main Content',- footer: 'Footer',- },- });- await expect(component).toContainText('Header');- await expect(component).toContainText('Main Content');- await expect(component).toContainText('Footer');-});diff --git a/tests/components/ct-svelte/tests/unmount.spec.ts b/tests/components/ct-svelte/tests/unmount.spec.tsdeleted file mode 100644index 391a72ecc5..0000000000--- a/tests/components/ct-svelte/tests/unmount.spec.ts+++ /dev/null@@ -1,35 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Button from '@/components/Button.svelte';-import MultiRoot from '@/components/MultiRoot.svelte';--test('unmount', async ({ page, mount }) => {- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await expect(page.locator('#root')).toContainText('Submit');- await component.unmount();- await expect(page.locator('#root')).not.toContainText('Submit');-});--test('unmount a multi root component', async ({ page, mount }) => {- const component = await mount(MultiRoot);- await expect(page.locator('#root')).toContainText('root 1');- await expect(page.locator('#root')).toContainText('root 2');- await component.unmount();- await expect(page.locator('#root')).not.toContainText('root 1');- await expect(page.locator('#root')).not.toContainText('root 2');-});--test('unmount twice throws an error', async ({ mount }) => {- const component = await mount(Button, {- props: {- title: 'Submit',- onsubmit: () => {},- },- });- await component.unmount();- await expect(component.unmount()).rejects.toThrowError('Component was not mounted');-});diff --git a/tests/components/ct-svelte/tests/update.spec.ts b/tests/components/ct-svelte/tests/update.spec.tsdeleted file mode 100644index 96bfb37915..0000000000--- a/tests/components/ct-svelte/tests/update.spec.ts+++ /dev/null@@ -1,37 +0,0 @@-import { test, expect } from '@playwright/experimental-ct-svelte';-import Counter from '@/components/Counter.svelte';--test('update props without remounting', async ({ mount }) => {- const component = await mount(Counter, {- props: {- count: 9001,- onsubmit: () => {},- },- });- await expect(component.getByTestId('props')).toContainText('9001');-- await component.update({- props: {- count: 1337,- },- });- await expect(component).not.toContainText('9001');- await expect(component.getByTestId('props')).toContainText('1337');-- await expect(component.getByTestId('remount-count')).toContainText('1');-});--test('update event listeners without remounting', async ({ mount }) => {- const component = await mount(Counter);-- const messages: string[] = [];- await component.update({- props: {- onsubmit: (data: string) => messages.push(data),- }- });- await component.click();- expect(messages).toEqual(['hello']);-- await expect(component.getByTestId('remount-count')).toContainText('1');-});diff --git a/tests/components/ct-svelte/tsconfig.json b/tests/components/ct-svelte/tsconfig.jsondeleted file mode 100644index 4ce7ec19bf..0000000000--- a/tests/components/ct-svelte/tsconfig.json+++ /dev/null@@ -1,16 +0,0 @@-{- "compilerOptions": {- "target": "ESNext",- "module": "ESNext",- "esModuleInterop": true,- "forceConsistentCasingInFileNames": true,- "strict": true,- "skipLibCheck": true,- "moduleResolution": "node",- "baseUrl": ".",- "paths": {- "@/*": ["./src/*"],- "*": ["_"],- }- }-}diff --git a/utils/workspace.js b/utils/workspace.jsindex 5331dc3335..2f98fc2f3e 100755--- a/utils/workspace.js+++ b/utils/workspace.js@@ -209,11 +209,6 @@ const workspace = new Workspace(ROOT_PATH, [path: path.join(ROOT_PATH, 'packages', 'playwright-ct-react17'),files: ['LICENSE'],}),- new PWPackage({- name: '@playwright/experimental-ct-svelte',- path: path.join(ROOT_PATH, 'packages', 'playwright-ct-svelte'),- files: ['LICENSE'],- }),new PWPackage({name: '@playwright/experimental-ct-vue',path: path.join(ROOT_PATH, 'packages', 'playwright-ct-vue'),