Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(ct): svelte-kit is being a moving target, remove tests for now (#16589)

Pavel Feldman93b4fa35378f
diff --git a/tests/components/ct-svelte-kit/.gitignore b/tests/components/ct-svelte-kit/.gitignore
deleted file mode 100644
index f4401a32d2..0000000000
--- a/tests/components/ct-svelte-kit/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-.DS_Store
-node_modules
-/build
-/.svelte-kit
-/package
-.env
-.env.*
-!.env.example
diff --git a/tests/components/ct-svelte-kit/.npmrc b/tests/components/ct-svelte-kit/.npmrc
deleted file mode 100644
index b6f27f1359..0000000000
--- a/tests/components/ct-svelte-kit/.npmrc
+++ /dev/null
@@ -1 +0,0 @@
-engine-strict=true
diff --git a/tests/components/ct-svelte-kit/README.md b/tests/components/ct-svelte-kit/README.md
deleted file mode 100644
index 94a48f5ff8..0000000000
--- a/tests/components/ct-svelte-kit/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# create-svelte
-
-Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
-
-## Creating a project
-
-If you're seeing this, you've probably already done this step. Congrats!
-
-```bash
-# create a new project in the current directory
-npm init svelte@next
-
-# create a new project in my-app
-npm init svelte@next my-app
-```
-
-> Note: the `@next` is temporary
-
-## Developing
-
-Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
-
-```bash
-npm run dev
-
-# or start the server and open the app in a new browser tab
-npm run dev -- --open
-```
-
-## Building
-
-To create a production version of your app:
-
-```bash
-npm run build
-```
-
-You can preview the production build with `npm run preview`.
-
-> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
diff --git a/tests/components/ct-svelte-kit/jsconfig.json b/tests/components/ct-svelte-kit/jsconfig.json
deleted file mode 100644
index d1deb76043..0000000000
--- a/tests/components/ct-svelte-kit/jsconfig.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "./.svelte-kit/tsconfig.json"
-}
diff --git a/tests/components/ct-svelte-kit/package.json b/tests/components/ct-svelte-kit/package.json
deleted file mode 100644
index 5923ef872a..0000000000
--- a/tests/components/ct-svelte-kit/package.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "ct-svelte-kit",
- "version": "0.0.1",
- "scripts": {
- "dev": "svelte-kit dev",
- "build": "svelte-kit build",
- "package": "svelte-kit package",
- "preview": "svelte-kit preview",
- "prepare": "svelte-kit sync"
- },
- "devDependencies": {
- "@sveltejs/adapter-auto": "next",
- "@sveltejs/kit": "next",
- "svelte": "^3.44.0"
- },
- "@standaloneDevDependencies": {
- "@playwright/experimental-ct-svelte": "^1.22.2",
- "@playwright/test": "^1.22.2"
- },
- "type": "module"
-}
\ No newline at end of file
diff --git a/tests/components/ct-svelte-kit/playwright.config.ts b/tests/components/ct-svelte-kit/playwright.config.ts
deleted file mode 100644
index ce93c2efee..0000000000
--- a/tests/components/ct-svelte-kit/playwright.config.ts
+++ /dev/null
@@ -1,44 +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 { PlaywrightTestConfig } from '@playwright/experimental-ct-svelte';
-import { devices } from '@playwright/test';
-
-const config: PlaywrightTestConfig = {
- testDir: 'src',
- forbidOnly: !!process.env.CI,
- retries: process.env.CI ? 2 : 0,
- reporter: 'html',
- use: {
- trace: 'on-first-retry',
- },
- projects: [
- {
- name: 'chromium',
- use: { ...devices['Desktop Chrome'] },
- },
- {
- name: 'firefox',
- use: { ...devices['Desktop Firefox'] },
- },
- {
- name: 'webkit',
- use: { ...devices['Desktop Safari'] },
- },
- ],
-};
-
-export default config;
diff --git a/tests/components/ct-svelte-kit/playwright/index.html b/tests/components/ct-svelte-kit/playwright/index.html
deleted file mode 100644
index 9f3d2a65b9..0000000000
--- a/tests/components/ct-svelte-kit/playwright/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="UTF-8" />
- <link rel="icon" href="/favicon.ico" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Svelte Test</title>
- </head>
- <body>
- <div id="root"></div>
- <script type="module" src="/playwright/index.ts"></script>
- </body>
-</html>
diff --git a/tests/components/ct-svelte-kit/playwright/index.ts b/tests/components/ct-svelte-kit/playwright/index.ts
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/tests/components/ct-svelte-kit/src/app.html b/tests/components/ct-svelte-kit/src/app.html
deleted file mode 100644
index 79e0b2916f..0000000000
--- a/tests/components/ct-svelte-kit/src/app.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta name="description" content="" />
- <link rel="icon" href="%svelte.assets%/favicon.png" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- %svelte.head%
- </head>
- <body>
- <div>%svelte.body%</div>
- </body>
-</html>
diff --git a/tests/components/ct-svelte-kit/src/lib/Counter.spec.ts b/tests/components/ct-svelte-kit/src/lib/Counter.spec.ts
deleted file mode 100644
index 1e863cd250..0000000000
--- a/tests/components/ct-svelte-kit/src/lib/Counter.spec.ts
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Copyright (c) Microsoft Corporation. All rights reserved.
- *
- * 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 { test, expect } from '@playwright/experimental-ct-svelte';
-import Counter from './Counter.svelte';
-
-test.use({ viewport: { width: 500, height: 500 } });
-
-test('should work', async ({ mount }) => {
- const changes = [];
-
- const component = await mount(Counter, {
- props: {
- units: 's',
- },
- on: {
- changed: c => changes.push(c)
- }
- });
-
- const increment = component.locator('button[aria-label*=Increase]');
- const decrement = component.locator('button[aria-label*=Decrease]');
- await expect(component).toContainText('0s');
-
- await increment.click();
- await expect(component).toContainText('1s');
- expect(changes).toEqual([{ count: 1 }]);
-
- await increment.click();
- await expect(component).toContainText('2s');
- expect(changes).toEqual([{ count: 1 }, { count: 2 }]);
-
- await decrement.click();
- await expect(component).toContainText('1s');
- expect(changes).toEqual([{ count: 1 }, { count: 2 }, { count: 1 }]);
-});
diff --git a/tests/components/ct-svelte-kit/src/lib/Counter.svelte b/tests/components/ct-svelte-kit/src/lib/Counter.svelte
deleted file mode 100644
index 9caff6c61d..0000000000
--- a/tests/components/ct-svelte-kit/src/lib/Counter.svelte
+++ /dev/null
@@ -1,113 +0,0 @@
-<script>
- import { spring } from 'svelte/motion';
- import { createEventDispatcher } from 'svelte';
-
- export let units = '';
- let count = 0;
- const dispatch = createEventDispatcher();
- const increment = () => {
- ++count;
- dispatch('changed', { count });
- };
- const decrement = () => {
- --count;
- dispatch('changed', { count });
- };
-
- const displayed_count = spring();
- $: displayed_count.set(count);
- $: offset = modulo($displayed_count, 1);
-
- function modulo(n, m) {
- // handle negative numbers
- return ((n % m) + m) % m;
- }
-</script>
-
-<div class="counter">
- <button on:click={() => decrement()} aria-label="Decrease the counter by one">
- <svg aria-hidden="true" viewBox="0 0 1 1">
- <path d="M0,0.5 L1,0.5" />
- </svg>
- </button>
-
- <div class="counter-viewport">
- <div class="counter-digits" style="transform: translate(0, {100 * offset}%)">
- <strong class="hidden" aria-hidden="true">{Math.floor($displayed_count + 1)}{units}</strong>
- <strong>{Math.floor($displayed_count)}{units}</strong>
- </div>
- </div>
-
- <button on:click={() => increment()} aria-label="Increase the counter by one">
- <svg aria-hidden="true" viewBox="0 0 1 1">
- <path d="M0,0.5 L1,0.5 M0.5,0 L0.5,1" />
- </svg>
- </button>
-</div>
-
-<style>
- .counter {
- display: flex;
- border-top: 1px solid rgba(0, 0, 0, 0.1);
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- margin: 1rem 0;
- }
-
- .counter button {
- width: 2em;
- padding: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- border: 0;
- background-color: transparent;
- color: var(--text-color);
- font-size: 2rem;
- }
-
- .counter button:hover {
- background-color: var(--secondary-color);
- }
-
- svg {
- width: 25%;
- height: 25%;
- }
-
- path {
- vector-effect: non-scaling-stroke;
- stroke-width: 2px;
- stroke: var(--text-color);
- }
-
- .counter-viewport {
- width: 8em;
- height: 4em;
- overflow: hidden;
- text-align: center;
- position: relative;
- }
-
- .counter-viewport strong {
- position: absolute;
- display: flex;
- width: 100%;
- height: 100%;
- font-weight: 400;
- color: var(--accent-color);
- font-size: 4rem;
- align-items: center;
- justify-content: center;
- }
-
- .counter-digits {
- position: absolute;
- width: 100%;
- height: 100%;
- }
-
- .hidden {
- top: -100%;
- user-select: none;
- }
-</style>
diff --git a/tests/components/ct-svelte-kit/src/routes/index.svelte b/tests/components/ct-svelte-kit/src/routes/index.svelte
deleted file mode 100644
index 5982b0ae37..0000000000
--- a/tests/components/ct-svelte-kit/src/routes/index.svelte
+++ /dev/null
@@ -1,2 +0,0 @@
-<h1>Welcome to SvelteKit</h1>
-<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
diff --git a/tests/components/ct-svelte-kit/static/favicon.png b/tests/components/ct-svelte-kit/static/favicon.png
deleted file mode 100644
index 825b9e65af..0000000000
Binary files a/tests/components/ct-svelte-kit/static/favicon.png and /dev/null differ
diff --git a/tests/components/ct-svelte-kit/svelte.config.js b/tests/components/ct-svelte-kit/svelte.config.js
deleted file mode 100644
index b42b17beb2..0000000000
--- a/tests/components/ct-svelte-kit/svelte.config.js
+++ /dev/null
@@ -1,10 +0,0 @@
-import adapter from '@sveltejs/adapter-auto';
-
-/** @type {import('@sveltejs/kit').Config} */
-const config = {
- kit: {
- adapter: adapter()
- }
-};
-
-export default config;