diff --git a/test/helpers.js b/test/helpers.js index f118a818f7..0aabdd3c7c 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -324,7 +324,7 @@ export function mkdirp(dir) { } } -export function prettyPrintPuppeteerAssertionError(message) { +export function prettyPrintBrowserAssertionError(message) { const match = /Error: Expected "(.+)" to equal "(.+)"/.exec(message); if (match) { diff --git a/test/runtime-puppeteer/assert.js b/test/runtime-playwright/assert.js similarity index 94% rename from test/runtime-puppeteer/assert.js rename to test/runtime-playwright/assert.js index 32e14b6830..55058d2057 100644 --- a/test/runtime-puppeteer/assert.js +++ b/test/runtime-playwright/assert.js @@ -44,7 +44,7 @@ function normalizeHtml(window, html) { .replace(/>[\s\r\n]+<') .trim(); - cleanStyle(node); + normalizeStyles(node); return node.innerHTML.replace(/<\/?noscript\/?>/g, ''); } catch (err) { @@ -52,14 +52,14 @@ function normalizeHtml(window, html) { } } -function cleanStyle(node) { +function normalizeStyles(node) { if (node.nodeType === 1) { if (node.hasAttribute('style')) { node.style = node.style.cssText; } for (const child of node.childNodes) { - cleanStyle(child); + normalizeStyles(child); } } } diff --git a/test/runtime-puppeteer/index.js b/test/runtime-playwright/index.js similarity index 97% rename from test/runtime-puppeteer/index.js rename to test/runtime-playwright/index.js index da47fca4ad..03b64023ed 100644 --- a/test/runtime-puppeteer/index.js +++ b/test/runtime-playwright/index.js @@ -5,7 +5,7 @@ import { rollup } from 'rollup'; import { chromium } from '@playwright/test'; import { deepStrictEqual } from 'assert'; -import { loadConfig, loadSvelte, mkdirp, prettyPrintPuppeteerAssertionError } from '../helpers'; +import { loadConfig, loadSvelte, mkdirp, prettyPrintBrowserAssertionError } from '../helpers'; const internal = path.resolve('internal/index.mjs'); const index = path.resolve('index.mjs'); @@ -214,7 +214,7 @@ describe('runtime (playwright)', () => { await page.close(); } catch (err) { failed.add(dir); - prettyPrintPuppeteerAssertionError(err.message); + prettyPrintBrowserAssertionError(err.message); assertWarnings(); throw err; } diff --git a/test/runtime-puppeteer/samples/binding-width-height-initialize/_config.js b/test/runtime-playwright/samples/binding-width-height-initialize/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/binding-width-height-initialize/_config.js rename to test/runtime-playwright/samples/binding-width-height-initialize/_config.js diff --git a/test/runtime-puppeteer/samples/binding-width-height-initialize/main.svelte b/test/runtime-playwright/samples/binding-width-height-initialize/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/binding-width-height-initialize/main.svelte rename to test/runtime-playwright/samples/binding-width-height-initialize/main.svelte diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic-svg/Svg.svelte b/test/runtime-playwright/samples/component-css-custom-properties-dynamic-svg/Svg.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties-dynamic-svg/Svg.svelte rename to test/runtime-playwright/samples/component-css-custom-properties-dynamic-svg/Svg.svelte diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic-svg/_config.js b/test/runtime-playwright/samples/component-css-custom-properties-dynamic-svg/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties-dynamic-svg/_config.js rename to test/runtime-playwright/samples/component-css-custom-properties-dynamic-svg/_config.js diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic-svg/main.svelte b/test/runtime-playwright/samples/component-css-custom-properties-dynamic-svg/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties-dynamic-svg/main.svelte rename to test/runtime-playwright/samples/component-css-custom-properties-dynamic-svg/main.svelte diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte b/test/runtime-playwright/samples/component-css-custom-properties-dynamic/Slider.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/Slider.svelte rename to test/runtime-playwright/samples/component-css-custom-properties-dynamic/Slider.svelte diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js b/test/runtime-playwright/samples/component-css-custom-properties-dynamic/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/_config.js rename to test/runtime-playwright/samples/component-css-custom-properties-dynamic/_config.js diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte b/test/runtime-playwright/samples/component-css-custom-properties-dynamic/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties-dynamic/main.svelte rename to test/runtime-playwright/samples/component-css-custom-properties-dynamic/main.svelte diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte b/test/runtime-playwright/samples/component-css-custom-properties/Slider.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties/Slider.svelte rename to test/runtime-playwright/samples/component-css-custom-properties/Slider.svelte diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/_config.js b/test/runtime-playwright/samples/component-css-custom-properties/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties/_config.js rename to test/runtime-playwright/samples/component-css-custom-properties/_config.js diff --git a/test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte b/test/runtime-playwright/samples/component-css-custom-properties/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-css-custom-properties/main.svelte rename to test/runtime-playwright/samples/component-css-custom-properties/main.svelte diff --git a/test/runtime-puppeteer/samples/component-event-handler-contenteditable-false/_config.js b/test/runtime-playwright/samples/component-event-handler-contenteditable-false/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/component-event-handler-contenteditable-false/_config.js rename to test/runtime-playwright/samples/component-event-handler-contenteditable-false/_config.js diff --git a/test/runtime-puppeteer/samples/component-event-handler-contenteditable-false/main.svelte b/test/runtime-playwright/samples/component-event-handler-contenteditable-false/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-event-handler-contenteditable-false/main.svelte rename to test/runtime-playwright/samples/component-event-handler-contenteditable-false/main.svelte diff --git a/test/runtime-puppeteer/samples/component-event-handler-contenteditable-spread/_config.js b/test/runtime-playwright/samples/component-event-handler-contenteditable-spread/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/component-event-handler-contenteditable-spread/_config.js rename to test/runtime-playwright/samples/component-event-handler-contenteditable-spread/_config.js diff --git a/test/runtime-puppeteer/samples/component-event-handler-contenteditable-spread/main.svelte b/test/runtime-playwright/samples/component-event-handler-contenteditable-spread/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-event-handler-contenteditable-spread/main.svelte rename to test/runtime-playwright/samples/component-event-handler-contenteditable-spread/main.svelte diff --git a/test/runtime-puppeteer/samples/component-event-handler-contenteditable/_config.js b/test/runtime-playwright/samples/component-event-handler-contenteditable/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/component-event-handler-contenteditable/_config.js rename to test/runtime-playwright/samples/component-event-handler-contenteditable/_config.js diff --git a/test/runtime-puppeteer/samples/component-event-handler-contenteditable/main.svelte b/test/runtime-playwright/samples/component-event-handler-contenteditable/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/component-event-handler-contenteditable/main.svelte rename to test/runtime-playwright/samples/component-event-handler-contenteditable/main.svelte diff --git a/test/runtime-puppeteer/samples/dynamic-element-custom-element/_config.js b/test/runtime-playwright/samples/dynamic-element-custom-element/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/dynamic-element-custom-element/_config.js rename to test/runtime-playwright/samples/dynamic-element-custom-element/_config.js diff --git a/test/runtime-puppeteer/samples/dynamic-element-custom-element/main.svelte b/test/runtime-playwright/samples/dynamic-element-custom-element/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/dynamic-element-custom-element/main.svelte rename to test/runtime-playwright/samples/dynamic-element-custom-element/main.svelte diff --git a/test/runtime-puppeteer/samples/inline-style-directive-important/_config.js b/test/runtime-playwright/samples/inline-style-directive-important/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/inline-style-directive-important/_config.js rename to test/runtime-playwright/samples/inline-style-directive-important/_config.js diff --git a/test/runtime-puppeteer/samples/inline-style-directive-important/main.svelte b/test/runtime-playwright/samples/inline-style-directive-important/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/inline-style-directive-important/main.svelte rename to test/runtime-playwright/samples/inline-style-directive-important/main.svelte diff --git a/test/runtime-puppeteer/samples/inline-style-directive-precedence/_config.js b/test/runtime-playwright/samples/inline-style-directive-precedence/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/inline-style-directive-precedence/_config.js rename to test/runtime-playwright/samples/inline-style-directive-precedence/_config.js diff --git a/test/runtime-puppeteer/samples/inline-style-directive-precedence/main.svelte b/test/runtime-playwright/samples/inline-style-directive-precedence/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/inline-style-directive-precedence/main.svelte rename to test/runtime-playwright/samples/inline-style-directive-precedence/main.svelte diff --git a/test/runtime-puppeteer/samples/inline-style-directive-update-with-spread/_config.js b/test/runtime-playwright/samples/inline-style-directive-update-with-spread/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/inline-style-directive-update-with-spread/_config.js rename to test/runtime-playwright/samples/inline-style-directive-update-with-spread/_config.js diff --git a/test/runtime-puppeteer/samples/inline-style-directive-update-with-spread/main.svelte b/test/runtime-playwright/samples/inline-style-directive-update-with-spread/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/inline-style-directive-update-with-spread/main.svelte rename to test/runtime-playwright/samples/inline-style-directive-update-with-spread/main.svelte diff --git a/test/runtime-puppeteer/samples/style_manager-cleanup/_config.js b/test/runtime-playwright/samples/style_manager-cleanup/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/style_manager-cleanup/_config.js rename to test/runtime-playwright/samples/style_manager-cleanup/_config.js diff --git a/test/runtime-puppeteer/samples/style_manager-cleanup/main.svelte b/test/runtime-playwright/samples/style_manager-cleanup/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/style_manager-cleanup/main.svelte rename to test/runtime-playwright/samples/style_manager-cleanup/main.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties-dynamic/Slider.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties-dynamic/Slider.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties-dynamic/Slider.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties-dynamic/Slider.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties-dynamic/_config.js b/test/runtime-playwright/samples/svelte-component-css-custom-properties-dynamic/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties-dynamic/_config.js rename to test/runtime-playwright/samples/svelte-component-css-custom-properties-dynamic/_config.js diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties-dynamic/main.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties-dynamic/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties-dynamic/main.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties-dynamic/main.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties/Slider1.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties/Slider1.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties/Slider1.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties/Slider1.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties/Slider2.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties/Slider2.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties/Slider2.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties/Slider2.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties/_config.js b/test/runtime-playwright/samples/svelte-component-css-custom-properties/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties/_config.js rename to test/runtime-playwright/samples/svelte-component-css-custom-properties/_config.js diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties/main.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties/main.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties/main.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/Slider1.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties2/Slider1.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/Slider1.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties2/Slider1.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/Slider2.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties2/Slider2.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/Slider2.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties2/Slider2.svelte diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/_config.js b/test/runtime-playwright/samples/svelte-component-css-custom-properties2/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/_config.js rename to test/runtime-playwright/samples/svelte-component-css-custom-properties2/_config.js diff --git a/test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/main.svelte b/test/runtime-playwright/samples/svelte-component-css-custom-properties2/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-component-css-custom-properties2/main.svelte rename to test/runtime-playwright/samples/svelte-component-css-custom-properties2/main.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties-dynamic/Slider.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties-dynamic/Slider.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties-dynamic/Slider.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties-dynamic/Slider.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties-dynamic/_config.js b/test/runtime-playwright/samples/svelte-self-css-custom-properties-dynamic/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties-dynamic/_config.js rename to test/runtime-playwright/samples/svelte-self-css-custom-properties-dynamic/_config.js diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties-dynamic/main.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties-dynamic/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties-dynamic/main.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties-dynamic/main.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties/Slider1.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties/Slider1.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties/Slider1.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties/Slider1.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties/Slider2.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties/Slider2.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties/Slider2.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties/Slider2.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties/_config.js b/test/runtime-playwright/samples/svelte-self-css-custom-properties/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties/_config.js rename to test/runtime-playwright/samples/svelte-self-css-custom-properties/_config.js diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties/main.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties/main.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties/main.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/Slider1.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties2/Slider1.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/Slider1.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties2/Slider1.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/Slider2.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties2/Slider2.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/Slider2.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties2/Slider2.svelte diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/_config.js b/test/runtime-playwright/samples/svelte-self-css-custom-properties2/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/_config.js rename to test/runtime-playwright/samples/svelte-self-css-custom-properties2/_config.js diff --git a/test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/main.svelte b/test/runtime-playwright/samples/svelte-self-css-custom-properties2/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/svelte-self-css-custom-properties2/main.svelte rename to test/runtime-playwright/samples/svelte-self-css-custom-properties2/main.svelte diff --git a/test/runtime-puppeteer/samples/transition-css-out-in/_config.js b/test/runtime-playwright/samples/transition-css-out-in/_config.js similarity index 100% rename from test/runtime-puppeteer/samples/transition-css-out-in/_config.js rename to test/runtime-playwright/samples/transition-css-out-in/_config.js diff --git a/test/runtime-puppeteer/samples/transition-css-out-in/main.svelte b/test/runtime-playwright/samples/transition-css-out-in/main.svelte similarity index 100% rename from test/runtime-puppeteer/samples/transition-css-out-in/main.svelte rename to test/runtime-playwright/samples/transition-css-out-in/main.svelte diff --git a/test/server-side-rendering/index.js b/test/server-side-rendering/index.js index 6bc8660e59..21c9b471eb 100644 --- a/test/server-side-rendering/index.js +++ b/test/server-side-rendering/index.js @@ -141,7 +141,7 @@ describe('ssr', () => { // duplicate client-side tests, as far as possible runRuntimeSamples('runtime'); - runRuntimeSamples('runtime-puppeteer'); + runRuntimeSamples('runtime-playwright'); function runRuntimeSamples(suite) { fs.readdirSync(`test/${suite}/samples`).forEach((dir) => {