diff --git a/docs/src/release-notes-js.md b/docs/src/release-notes-js.md index 5218a69edd399..f501b50bec558 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 features of Playwright Test (such as parallelization, emulation & debugging) while running components in real browsers. diff --git a/docs/src/test-components-js.md b/docs/src/test-components-js.md index 73115bfad969c..12d8b33f98c9a 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'; - - -```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'); -}); -``` - - - ### 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 }) => { }); ``` - - - -```js title="component.spec.ts" -import { test } from '@playwright/experimental-ct-svelte'; - -test('props', async ({ mount }) => { - const component = await mount(Component, { props: { msg: 'greetings' } }); -}); -``` - @@ -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 }) => { }); ``` - - - -```js title="component.spec.ts" -import { test } from '@playwright/experimental-ct-svelte'; - -test('event', async ({ mount }) => { - const component = await mount(Component, { on: { click() {} } }); -}); -``` - @@ -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 }) => { }); ``` - - - -```js title="component.spec.ts" -import { test } from '@playwright/experimental-ct-svelte'; - -test('slot', async ({ mount }) => { - const component = await mount(Component, { slots: { default: 'Slot' } }); -}); -``` - @@ -550,7 +499,6 @@ Unmount the mounted component from the DOM. This is useful for testing the compo defaultValue="react" values={[ {label: 'React', value: 'react'}, - {label: 'Svelte', value: 'svelte'}, {label: 'Vue', value: 'vue'}, ] }> @@ -566,18 +514,6 @@ test('unmount', async ({ mount }) => { }); ``` - - - -```js title="component.spec.ts" -import { test } from '@playwright/experimental-ct-svelte'; - -test('unmount', async ({ mount }) => { - const component = await mount(Component); - await component.unmount(); -}); -``` - @@ -612,7 +548,6 @@ Update props, slots/children, and/or events/callbacks of a mounted component. Th defaultValue="react" values={[ {label: 'React', value: 'react'}, - {label: 'Svelte', value: 'svelte'}, {label: 'Vue', value: 'vue'}, ] }> @@ -630,22 +565,6 @@ test('update', async ({ mount }) => { }); ``` - - - -```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' } - }); -}); -``` - @@ -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}`? ```js test('…', 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`: @@ -772,26 +690,6 @@ test('should work', async ({ mount }) => { - - -```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'); -}); -``` - - - 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.md index bff0eb61623eb..c3f3e8f58d913 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). :::note If 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 }) => { // 2 Migration 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.json index 4980057315871..c9d404b8c8c4d 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-core/src/server/bidi/bidiBrowser.ts b/packages/playwright-core/src/server/bidi/bidiBrowser.ts index 071db4381b80d..f1d806332f5b2 100644 --- a/packages/playwright-core/src/server/bidi/bidiBrowser.ts +++ b/packages/playwright-core/src/server/bidi/bidiBrowser.ts @@ -464,7 +464,7 @@ export class BidiBrowserContext extends BrowserContext { userContexts: [this._userContextId()], })); promises.push(...this._bidiPages().map(page => { - const realms = [...page._realmToContext].filter(([realm, context]) => context.world === 'main').map(([realm, context]) => realm); + const realms = [...page._contextIdToContext].filter(([realm, context]) => context.world === 'main').map(([realm, context]) => realm); return Promise.all(realms.map(realm => { return page._session.send('script.callFunction', { functionDeclaration, diff --git a/packages/playwright-core/src/server/bidi/bidiPage.ts b/packages/playwright-core/src/server/bidi/bidiPage.ts index 990c41fc2e1c7..237650d4b7dc6 100644 --- a/packages/playwright-core/src/server/bidi/bidiPage.ts +++ b/packages/playwright-core/src/server/bidi/bidiPage.ts @@ -46,7 +46,7 @@ export class BidiPage implements PageDelegate { readonly _page: Page; readonly _session: BidiSession; readonly _opener: BidiPage | null; - readonly _realmToContext: Map; + readonly _contextIdToContext: Map; private _realmToWorkerContext = new Map(); private _sessionListeners: RegisteredListener[] = []; readonly _browserContext: BidiBrowserContext; @@ -61,7 +61,7 @@ export class BidiPage implements PageDelegate { this.rawKeyboard = new RawKeyboardImpl(bidiSession); this.rawMouse = new RawMouseImpl(bidiSession); this.rawTouchscreen = new RawTouchscreenImpl(bidiSession); - this._realmToContext = new Map(); + this._contextIdToContext = new Map(); this._page = new Page(this, browserContext); this._browserContext = browserContext; this._networkManager = new BidiNetworkManager(this._session, this._page); @@ -114,9 +114,9 @@ export class BidiPage implements PageDelegate { } private _removeContextsForFrame(frame: frames.Frame, notifyFrame: boolean) { - for (const [contextId, context] of this._realmToContext) { + for (const [contextId, context] of this._contextIdToContext) { if (context.frame === frame) { - this._realmToContext.delete(contextId); + this._contextIdToContext.delete(contextId); if (notifyFrame) frame._contextDestroyed(context); } @@ -132,7 +132,7 @@ export class BidiPage implements PageDelegate { this._page.addWorker(realmInfo.realm, worker); return; } - if (this._realmToContext.has(realmInfo.realm)) + if (this._contextIdToContext.has(realmInfo.realm)) return; if (realmInfo.type !== 'window') return; @@ -152,7 +152,7 @@ export class BidiPage implements PageDelegate { const delegate = new BidiExecutionContext(this._session, realmInfo); const context = new dom.FrameExecutionContext(delegate, frame, worldName); frame._contextCreated(worldName, context); - this._realmToContext.set(realmInfo.realm, context); + this._contextIdToContext.set(realmInfo.realm, context); } private async _touchUtilityWorld(context: bidi.BrowsingContext.BrowsingContext) { @@ -172,9 +172,9 @@ export class BidiPage implements PageDelegate { } _onRealmDestroyed(params: bidi.Script.RealmDestroyedParameters): boolean { - const context = this._realmToContext.get(params.realm); + const context = this._contextIdToContext.get(params.realm); if (context) { - this._realmToContext.delete(params.realm); + this._contextIdToContext.delete(params.realm); context.frame._contextDestroyed(context); return true; } @@ -286,7 +286,7 @@ export class BidiPage implements PageDelegate { if (params.type !== 'console') return; const entry: bidi.Log.ConsoleLogEntry = params as bidi.Log.ConsoleLogEntry; - const context = this._realmToContext.get(params.source.realm) ?? this._realmToWorkerContext.get(params.source.realm); + const context = this._contextIdToContext.get(params.source.realm) ?? this._realmToWorkerContext.get(params.source.realm); if (!context) return; @@ -425,7 +425,7 @@ export class BidiPage implements PageDelegate { const pageOrError = await this._page.waitForInitializedOrError(); if (pageOrError instanceof Error) return; - const context = this._realmToContext.get(event.source.realm); + const context = this._contextIdToContext.get(event.source.realm); if (!context) return; if (event.data.type !== 'string') diff --git a/packages/playwright-ct-core/src/tsxTransform.ts b/packages/playwright-ct-core/src/tsxTransform.ts index fbf3d0cc182cb..09355b51af21d 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.ImportS const artifactExtensions = new Set([ // Frameworks '.vue', - '.svelte', // Images '.jpg', '.jpeg', diff --git a/packages/playwright-ct-svelte/.npmignore b/packages/playwright-ct-svelte/.npmignore deleted file mode 100644 index 62701eb493652..0000000000000 --- 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.mjs diff --git a/packages/playwright-ct-svelte/README.md b/packages/playwright-ct-svelte/README.md deleted file mode 100644 index 23ae82312d5c6..0000000000000 --- 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-components diff --git a/packages/playwright-ct-svelte/cli.js b/packages/playwright-ct-svelte/cli.js deleted file mode 100755 index 9cc834ee95e85..0000000000000 --- 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.ts deleted file mode 100644 index dfa037c7de771..0000000000000 --- 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( - callback: (params: { - hooksConfig?: HooksConfig, - App: new (options: Partial) => SvelteComponent - }) => Promise -): void; -export declare function afterMount( - callback: (params: { - hooksConfig?: HooksConfig; - svelteComponent: SvelteComponent; - }) => Promise -): void; diff --git a/packages/playwright-ct-svelte/hooks.mjs b/packages/playwright-ct-svelte/hooks.mjs deleted file mode 100644 index b7cea242c41e0..0000000000000 --- 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.ts deleted file mode 100644 index 8f90d4f2cc89c..0000000000000 --- 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 & { default?: ComponentSlot }; -type ComponentEvents = Record; - -// TODO: Remove after Svelte has removed S4 fallback TypeScript types for `*.svelte` files -type InteropComponent = (new (...args: unknown[]) => SvelteComponent) | Component; - -export interface MountOptions { - props?: ComponentProps; - slots?: ComponentSlots; - on?: ComponentEvents; - hooksConfig?: HooksConfig; -} - -export interface MountResult extends Locator { - unmount(): Promise; - update(options: { - props?: Partial>; - on?: Partial; - }): Promise; -} - -export interface ComponentFixtures { - mount( - component: Component, - options?: MountOptions - ): Promise>; -} - -export const test: TestType; - -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.js deleted file mode 100644 index 841ff852c73e9..0000000000000 --- 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.json deleted file mode 100644 index 5e5a3c3275fda..0000000000000 --- 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.ts deleted file mode 100644 index 1431000f4ba7c..0000000000000 --- 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, - options?: { - window?: Window - } -): void; diff --git a/packages/playwright-ct-svelte/register.mjs b/packages/playwright-ct-svelte/register.mjs deleted file mode 100644 index ca6a6a12d9933..0000000000000 --- 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.mjs deleted file mode 100644 index 1d8f068d0151d..0000000000000 --- 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} */ -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/packages/playwright/src/cli/client/program.ts b/packages/playwright/src/cli/client/program.ts index 1db729dc538db..780578f46dbeb 100644 --- a/packages/playwright/src/cli/client/program.ts +++ b/packages/playwright/src/cli/client/program.ts @@ -180,6 +180,9 @@ async function program() { case 'install': await install(args); return; + case 'install-browser': + await installBrowser(); + return; case 'show': { const daemonScript = path.join(__dirname, 'devtoolsApp.js'); const child = spawn(process.execPath, [daemonScript], { @@ -227,8 +230,7 @@ async function install(args: MinimistArgs) { console.log(`✅ Skills installed to \`${path.relative(cwd, skillDestDir)}\`.`); } - if (!args.config) - await ensureConfiguredBrowserInstalled(); + await ensureConfiguredBrowserInstalled(); } async function ensureConfiguredBrowserInstalled() { @@ -251,6 +253,12 @@ async function ensureConfiguredBrowserInstalled() { } } +async function installBrowser() { + const { program } = require('playwright-core/lib/cli/program'); + const argv = process.argv.map(arg => arg === 'install-browser' ? 'install' : arg); + program.parse(argv); +} + async function createDefaultConfig(channel: string) { const config: Config = { browser: { diff --git a/packages/playwright/src/cli/daemon/commands.ts b/packages/playwright/src/cli/daemon/commands.ts index 4259e24072b55..6fc435c7b157e 100644 --- a/packages/playwright/src/cli/daemon/commands.ts +++ b/packages/playwright/src/cli/daemon/commands.ts @@ -844,8 +844,16 @@ const installBrowser = declareCommand({ name: 'install-browser', description: 'Install browser', category: 'install', + args: z.object({ + browser: z.string().optional().describe('Browser to install'), + }), options: z.object({ - browser: z.string().optional().describe('Browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge'), + ['with-deps']: z.boolean().optional().describe('Install system dependencies for browsers'), + ['dry-run']: z.boolean().optional().describe('Do not execute installation, only print information'), + list: z.boolean().optional().describe('Prints list of browsers from all Playwright installations'), + force: z.boolean().optional().describe('Force reinstall of already installed browsers'), + ['only-shell']: z.boolean().optional().describe('Only install headless shell when installing Chromium'), + ['no-shell']: z.boolean().optional().describe('Do not install Chromium headless shell'), }), toolName: 'browser_install', toolParams: () => ({}), diff --git a/packages/playwright/src/mcp/browser/response.ts b/packages/playwright/src/mcp/browser/response.ts index 19cc3e3755313..9ede782e3df12 100644 --- a/packages/playwright/src/mcp/browser/response.ts +++ b/packages/playwright/src/mcp/browser/response.ts @@ -190,7 +190,7 @@ export class Response { if (this._includeSnapshot !== 'none' || tabHeaders.some(header => header.changed)) { if (tabHeaders.length !== 1) addSection('Open tabs', renderTabsMarkdown(tabHeaders)); - addSection('Page', renderTabMarkdown(tabHeaders[0])); + addSection('Page', renderTabMarkdown(tabHeaders.find(h => h.current) ?? tabHeaders[0])); } // Handle modal states. diff --git a/tests/bidi/expectations/moz-firefox-nightly-library.txt b/tests/bidi/expectations/moz-firefox-nightly-library.txt index 7e9c386290a69..fe9e7e6ea751f 100644 --- a/tests/bidi/expectations/moz-firefox-nightly-library.txt +++ b/tests/bidi/expectations/moz-firefox-nightly-library.txt @@ -173,12 +173,9 @@ library/permissions.spec.ts › permissions › should isolate permissions betwe library/permissions.spec.ts › permissions › should trigger permission onchange [fail] library/permissions.spec.ts › should support clipboard read [fail] library/popup.spec.ts › BrowserContext.addInitScript should apply to a cross-process popup [flaky] -library/popup.spec.ts › BrowserContext.addInitScript should apply to an in-process popup [fail] library/popup.spec.ts › should expose function from browser context [fail] library/popup.spec.ts › should inherit offline from browser context [fail] library/popup.spec.ts › should inherit touch support from browser context [fail] -library/popup.spec.ts › should inherit user agent from browser context @smoke [fail] -library/popup.spec.ts › should inherit viewport size from browser context [fail] library/popup.spec.ts › should not dispatch binding on a closed page [fail] library/popup.spec.ts › should not throw when click closes popup [timeout] library/popup.spec.ts › should use viewport size from window features [timeout] diff --git a/tests/bidi/expectations/moz-firefox-nightly-page.txt b/tests/bidi/expectations/moz-firefox-nightly-page.txt index 354aff25a27b3..751f1cd01f748 100644 --- a/tests/bidi/expectations/moz-firefox-nightly-page.txt +++ b/tests/bidi/expectations/moz-firefox-nightly-page.txt @@ -12,8 +12,6 @@ page/elementhandle-scroll-into-view.spec.ts › should wait for nested display:n page/elementhandle-scroll-into-view.spec.ts › should work @smoke [fail] page/expect-misc.spec.ts › strict mode violation error format [fail] page/frame-evaluate.spec.ts › should allow cross-frame element handles [fail] -page/frame-evaluate.spec.ts › should dispose context on cross-origin navigation [fail] -page/frame-evaluate.spec.ts › should dispose context on navigation [fail] page/frame-evaluate.spec.ts › should not allow cross-frame element handles when frames do not script each other [fail] page/frame-goto.spec.ts › should continue after client redirect [flaky] page/frame-hierarchy.spec.ts › should support framesets [fail] diff --git a/tests/components/ct-svelte-vite/.eslintignore b/tests/components/ct-svelte-vite/.eslintignore deleted file mode 100644 index 01b7e33fd4707..0000000000000 --- a/tests/components/ct-svelte-vite/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/* \ No newline at end of file diff --git a/tests/components/ct-svelte-vite/.gitignore b/tests/components/ct-svelte-vite/.gitignore deleted file mode 100644 index a547bf36d8d11..0000000000000 --- 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.md deleted file mode 100644 index a9d516a32c682..0000000000000 --- 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.html deleted file mode 100644 index d2f6839bab176..0000000000000 --- a/tests/components/ct-svelte-vite/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Svelte + TS + Vite App - - -
- - - diff --git a/tests/components/ct-svelte-vite/package.json b/tests/components/ct-svelte-vite/package.json deleted file mode 100644 index a82358e11cfb7..0000000000000 --- 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.ts deleted file mode 100644 index 90b547e158361..0000000000000 --- 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.html deleted file mode 100644 index b8b1472b91ca9..0000000000000 --- a/tests/components/ct-svelte-vite/playwright/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Svelte + TS + Vite App - - -
- - - diff --git a/tests/components/ct-svelte-vite/playwright/index.ts b/tests/components/ct-svelte-vite/playwright/index.ts deleted file mode 100644 index dcbcd47225bd0..0000000000000 --- 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(async ({ hooksConfig, App }) => { - console.log(`Before mount: ${JSON.stringify(hooksConfig)}`); - return new App({ - context: new Map([ - ['context-key', hooksConfig?.context] - ]), - }); -}); - -afterMount(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.js deleted file mode 100644 index 09a1bf7a7b225..0000000000000 --- 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.ico deleted file mode 100644 index d75d248ef0b15..0000000000000 Binary files a/tests/components/ct-svelte-vite/public/favicon.ico and /dev/null differ diff --git a/tests/components/ct-svelte-vite/src/App.svelte b/tests/components/ct-svelte-vite/src/App.svelte deleted file mode 100644 index 78f04211bd2bb..0000000000000 --- a/tests/components/ct-svelte-vite/src/App.svelte +++ /dev/null @@ -1,34 +0,0 @@ - - -
- { e.preventDefault(); navigate('/'); }} href='/login'>Login - { e.preventDefault(); navigate('/dashboard'); }} href='/dashboard'>Dashboard -
-{#if path === '/'} - -{:else if path === '/dashboard'} - -{/if} diff --git a/tests/components/ct-svelte-vite/src/assets/index.css b/tests/components/ct-svelte-vite/src/assets/index.css deleted file mode 100644 index 97495c44b8634..0000000000000 --- 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.svelte deleted file mode 100644 index 2fdaca299befd..0000000000000 --- a/tests/components/ct-svelte-vite/src/components/Button.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/components/ct-svelte-vite/src/components/Context.svelte b/tests/components/ct-svelte-vite/src/components/Context.svelte deleted file mode 100644 index 734c9938ba128..0000000000000 --- a/tests/components/ct-svelte-vite/src/components/Context.svelte +++ /dev/null @@ -1,6 +0,0 @@ - - -
{contextValue}
diff --git a/tests/components/ct-svelte-vite/src/components/Counter.svelte b/tests/components/ct-svelte-vite/src/components/Counter.svelte deleted file mode 100644 index 284f12cd35d80..0000000000000 --- a/tests/components/ct-svelte-vite/src/components/Counter.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/tests/components/ct-svelte-vite/src/components/DefaultSlot.svelte b/tests/components/ct-svelte-vite/src/components/DefaultSlot.svelte deleted file mode 100644 index 7eba923f3b70a..0000000000000 --- a/tests/components/ct-svelte-vite/src/components/DefaultSlot.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - -
-

Welcome!

-
- {@render children()} -
-
- Thanks for visiting. -
-
diff --git a/tests/components/ct-svelte-vite/src/components/Empty.svelte b/tests/components/ct-svelte-vite/src/components/Empty.svelte deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/tests/components/ct-svelte-vite/src/components/MultiRoot.svelte b/tests/components/ct-svelte-vite/src/components/MultiRoot.svelte deleted file mode 100644 index 87996d0ce0062..0000000000000 --- a/tests/components/ct-svelte-vite/src/components/MultiRoot.svelte +++ /dev/null @@ -1,2 +0,0 @@ -
root 1
-
root 2
diff --git a/tests/components/ct-svelte-vite/src/components/NamedSlots.svelte b/tests/components/ct-svelte-vite/src/components/NamedSlots.svelte deleted file mode 100644 index e095a50dcf1b0..0000000000000 --- a/tests/components/ct-svelte-vite/src/components/NamedSlots.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
- {@render header()} -
-
- {@render main()} -
-
- {@render footer()} -
-
diff --git a/tests/components/ct-svelte-vite/src/main.ts b/tests/components/ct-svelte-vite/src/main.ts deleted file mode 100644 index 4e7ad898e91d7..0000000000000 --- 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.svelte deleted file mode 100644 index 161f5338e8871..0000000000000 --- a/tests/components/ct-svelte-vite/src/pages/DashboardPage.svelte +++ /dev/null @@ -1 +0,0 @@ -
Dashboard
diff --git a/tests/components/ct-svelte-vite/src/pages/LoginPage.svelte b/tests/components/ct-svelte-vite/src/pages/LoginPage.svelte deleted file mode 100644 index 3c359ab27c9ad..0000000000000 --- a/tests/components/ct-svelte-vite/src/pages/LoginPage.svelte +++ /dev/null @@ -1 +0,0 @@ -
Login
diff --git a/tests/components/ct-svelte-vite/src/store/index.ts b/tests/components/ct-svelte-vite/src/store/index.ts deleted file mode 100644 index 43d7ee31fc435..0000000000000 --- 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.ts deleted file mode 100644 index 4078e7476a2ea..0000000000000 --- a/tests/components/ct-svelte-vite/src/vite-env.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/// -/// diff --git a/tests/components/ct-svelte-vite/tests/events.spec.ts b/tests/components/ct-svelte-vite/tests/events.spec.ts deleted file mode 100644 index 002229d6bde63..0000000000000 --- 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.ts deleted file mode 100644 index c28618a666ff0..0000000000000 --- 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(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.ts deleted file mode 100644 index 127620b3c9fb5..0000000000000 --- 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.ts deleted file mode 100644 index 949a51e74761b..0000000000000 --- 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.ts deleted file mode 100644 index a3ec17c04b3f4..0000000000000 --- 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.ts deleted file mode 100644 index 96bfb37915958..0000000000000 --- 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.json deleted file mode 100644 index 4dc15b75b04c0..0000000000000 --- 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.json deleted file mode 100644 index e993792cb12c9..0000000000000 --- 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.ts deleted file mode 100644 index 401b4d4bd6b14..0000000000000 --- 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/.gitignore deleted file mode 100644 index 2347f3ca3be94..0000000000000 --- a/tests/components/ct-svelte/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/node_modules/ -/public/build/ -/public/tests/ - -.DS_Store diff --git a/tests/components/ct-svelte/README.md b/tests/components/ct-svelte/README.md deleted file mode 100644 index 8ca4fcaff9912..0000000000000 --- 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.json deleted file mode 100644 index fc2e6779861a7..0000000000000 --- 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.ts deleted file mode 100644 index e26caad73687b..0000000000000 --- 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.html deleted file mode 100644 index 43136a165e2a7..0000000000000 --- a/tests/components/ct-svelte/playwright/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - Svelte Test - - -
- - - diff --git a/tests/components/ct-svelte/playwright/index.ts b/tests/components/ct-svelte/playwright/index.ts deleted file mode 100644 index fe89c98e10d87..0000000000000 --- 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(async ({ hooksConfig }) => { - console.log(`Before mount: ${JSON.stringify(hooksConfig)}`); -}); - -afterMount(async () => { - console.log(`After mount`); -}); diff --git a/tests/components/ct-svelte/public/favicon.png b/tests/components/ct-svelte/public/favicon.png deleted file mode 100644 index 7e6f5eb5a2f1f..0000000000000 Binary files a/tests/components/ct-svelte/public/favicon.png and /dev/null differ diff --git a/tests/components/ct-svelte/public/index.html b/tests/components/ct-svelte/public/index.html deleted file mode 100644 index 74558940d085b..0000000000000 --- a/tests/components/ct-svelte/public/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - Svelte app - - - - - - - - - - diff --git a/tests/components/ct-svelte/rollup.config.js b/tests/components/ct-svelte/rollup.config.js deleted file mode 100644 index 10b425f1fb9d1..0000000000000 --- 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.js deleted file mode 100644 index e6184aa223822..0000000000000 --- 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: - - - - 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(" - -
- { e.preventDefault(); navigate('/'); }} href='/login'>Login - { e.preventDefault(); navigate('/dashboard'); }} href='/dashboard'>Dashboard -
-{#if path === '/'} - -{:else if path === '/dashboard'} - -{/if} diff --git a/tests/components/ct-svelte/src/assets/index.css b/tests/components/ct-svelte/src/assets/index.css deleted file mode 100644 index 97495c44b8634..0000000000000 --- 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.svelte deleted file mode 100644 index 2fdaca299befd..0000000000000 --- a/tests/components/ct-svelte/src/components/Button.svelte +++ /dev/null @@ -1,5 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/components/ct-svelte/src/components/Component.svelte b/tests/components/ct-svelte/src/components/Component.svelte deleted file mode 100644 index 179f993315f43..0000000000000 --- a/tests/components/ct-svelte/src/components/Component.svelte +++ /dev/null @@ -1 +0,0 @@ -
test
diff --git a/tests/components/ct-svelte/src/components/Counter.svelte b/tests/components/ct-svelte/src/components/Counter.svelte deleted file mode 100644 index 284f12cd35d80..0000000000000 --- a/tests/components/ct-svelte/src/components/Counter.svelte +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/tests/components/ct-svelte/src/components/DefaultSlot.svelte b/tests/components/ct-svelte/src/components/DefaultSlot.svelte deleted file mode 100644 index 7eba923f3b70a..0000000000000 --- a/tests/components/ct-svelte/src/components/DefaultSlot.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - -
-

Welcome!

-
- {@render children()} -
-
- Thanks for visiting. -
-
diff --git a/tests/components/ct-svelte/src/components/Empty.svelte b/tests/components/ct-svelte/src/components/Empty.svelte deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/tests/components/ct-svelte/src/components/MultiRoot.svelte b/tests/components/ct-svelte/src/components/MultiRoot.svelte deleted file mode 100644 index 87996d0ce0062..0000000000000 --- a/tests/components/ct-svelte/src/components/MultiRoot.svelte +++ /dev/null @@ -1,2 +0,0 @@ -
root 1
-
root 2
diff --git a/tests/components/ct-svelte/src/components/NamedSlots.svelte b/tests/components/ct-svelte/src/components/NamedSlots.svelte deleted file mode 100644 index e095a50dcf1b0..0000000000000 --- a/tests/components/ct-svelte/src/components/NamedSlots.svelte +++ /dev/null @@ -1,15 +0,0 @@ - - -
-
- {@render header()} -
-
- {@render main()} -
-
- {@render footer()} -
-
diff --git a/tests/components/ct-svelte/src/main.js b/tests/components/ct-svelte/src/main.js deleted file mode 100644 index e08102368814c..0000000000000 --- 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.svelte deleted file mode 100644 index 161f5338e8871..0000000000000 --- a/tests/components/ct-svelte/src/pages/DashboardPage.svelte +++ /dev/null @@ -1 +0,0 @@ -
Dashboard
diff --git a/tests/components/ct-svelte/src/pages/LoginPage.svelte b/tests/components/ct-svelte/src/pages/LoginPage.svelte deleted file mode 100644 index 3c359ab27c9ad..0000000000000 --- a/tests/components/ct-svelte/src/pages/LoginPage.svelte +++ /dev/null @@ -1 +0,0 @@ -
Login
diff --git a/tests/components/ct-svelte/src/store/index.ts b/tests/components/ct-svelte/src/store/index.ts deleted file mode 100644 index 43d7ee31fc435..0000000000000 --- 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.ts deleted file mode 100644 index 002229d6bde63..0000000000000 --- 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.ts deleted file mode 100644 index e1d9939e25bf0..0000000000000 --- 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.ts deleted file mode 100644 index 127620b3c9fb5..0000000000000 --- 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.ts deleted file mode 100644 index 949a51e74761b..0000000000000 --- 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.ts deleted file mode 100644 index 391a72ecc5eb9..0000000000000 --- 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.ts deleted file mode 100644 index 96bfb37915958..0000000000000 --- 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.json deleted file mode 100644 index 4ce7ec19bfd6f..0000000000000 --- 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/tests/mcp/cli-misc.spec.ts b/tests/mcp/cli-misc.spec.ts index 1b20c49e4a0bc..96d43dbf78989 100644 --- a/tests/mcp/cli-misc.spec.ts +++ b/tests/mcp/cli-misc.spec.ts @@ -29,9 +29,8 @@ test('daemon shuts down on browser launch failure', async ({ cli, server }) => { test('install-browser', async ({ cli, server, mcpBrowser }) => { test.skip(mcpBrowser !== 'chromium', 'Test only chromium'); - await cli('open', server.HELLO_WORLD); - const { output } = await cli('install-browser'); - expect(output).toContain(`Browser ${mcpBrowser} installed.`); + const { output } = await cli('install-browser', '--list'); + expect(output).toMatch(/chromium-\d+/); }); test('install workspace', async ({ cli }, testInfo) => { diff --git a/tests/mcp/tabs.spec.ts b/tests/mcp/tabs.spec.ts index cf10d0dca8389..69e386d91bfd4 100644 --- a/tests/mcp/tabs.spec.ts +++ b/tests/mcp/tabs.spec.ts @@ -74,6 +74,12 @@ test('create new tab', async ({ client }) => { - generic [active] [ref=e1]: Body two \`\`\``, }); + expect(await client.callTool({ + name: 'browser_snapshot', + arguments: {}, + })).toHaveResponse({ + page: expect.stringContaining('Page URL: data:text/html,Tab twoBody two'), + }); }); test('select tab', async ({ client }) => { diff --git a/tests/playwright-test/stable-test-runner/package-lock.json b/tests/playwright-test/stable-test-runner/package-lock.json index c52da10fe0695..35be7eb1560a8 100644 --- a/tests/playwright-test/stable-test-runner/package-lock.json +++ b/tests/playwright-test/stable-test-runner/package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "dependencies": { - "@playwright/test": "^1.59.0-alpha-2026-02-09" + "@playwright/test": "^1.59.0-alpha-2026-02-16" } }, "node_modules/@playwright/test": { - "version": "1.59.0-alpha-2026-02-09", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.0-alpha-2026-02-09.tgz", - "integrity": "sha512-3aZUIF61ddUnsiQhOZywYFVK4kpJjXxVGsPJZUBVjIrHsZT/LXxW9aG7fhRwyaMjpqAzmb2njJFdLj4XIrhf2A==", + "version": "1.59.0-alpha-2026-02-16", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.0-alpha-2026-02-16.tgz", + "integrity": "sha512-5Ra7AAWLTGDmZNWdyW47cbXtRxHteKZdf/xZDsGsxySB4DrNGJ6zS3Aw5UXt5Hn6/iYeO4y52dCNaLQMfif+wA==", "license": "Apache-2.0", "dependencies": { - "playwright": "1.59.0-alpha-2026-02-09" + "playwright": "1.59.0-alpha-2026-02-16" }, "bin": { "playwright": "cli.js" @@ -38,12 +38,12 @@ } }, "node_modules/playwright": { - "version": "1.59.0-alpha-2026-02-09", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.0-alpha-2026-02-09.tgz", - "integrity": "sha512-yyOXu0vpIfNnBG6M0JkUDkxDyvZUDieqoXMxNoNbcVV+DROrJB1oDmkgTNojkxXhpsAHwG56TH2tE/Rqju86sA==", + "version": "1.59.0-alpha-2026-02-16", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.59.0-alpha-2026-02-16.tgz", + "integrity": "sha512-POKLwmkERahJOitYcaRz/LvVbME/dUxIBclBK7OtcuKBjdnvItmRpyFB6ODNAW8AAw1AFUgKRNFV3Bjbaajfuw==", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.59.0-alpha-2026-02-09" + "playwright-core": "1.59.0-alpha-2026-02-16" }, "bin": { "playwright": "cli.js" @@ -56,9 +56,9 @@ } }, "node_modules/playwright-core": { - "version": "1.59.0-alpha-2026-02-09", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.0-alpha-2026-02-09.tgz", - "integrity": "sha512-O4Ugl6oq68hWeGIti4U3pNa/I7vEwn8PdzG/mZgcTkou+0IBNWAVH4WWk0+BJoufqaGBHmH0H7pVSjmlCusoYA==", + "version": "1.59.0-alpha-2026-02-16", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.59.0-alpha-2026-02-16.tgz", + "integrity": "sha512-+QJV/isy/bXD9UsHghHFo1iQJUYgmv/EC0oi6Vl86gP4zSuBHZo/D4YMS3lWPLZpEkEUnd6u5gpiMzd1SSzfcw==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" diff --git a/tests/playwright-test/stable-test-runner/package.json b/tests/playwright-test/stable-test-runner/package.json index 7f14505e68ec4..f1a57d1f13e36 100644 --- a/tests/playwright-test/stable-test-runner/package.json +++ b/tests/playwright-test/stable-test-runner/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "@playwright/test": "^1.59.0-alpha-2026-02-09" + "@playwright/test": "^1.59.0-alpha-2026-02-16" } } diff --git a/utils/workspace.js b/utils/workspace.js index 5331dc3335ef7..2f98fc2f3ecf5 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'),