From 7a2e059f2711acfcb80bf932911011baec0f7145 Mon Sep 17 00:00:00 2001 From: Arnar Freyr Date: Thu, 14 Dec 2023 20:08:37 +0100 Subject: [PATCH] Playwright for firefox and webkit (#160) * i try fix * Fix popover compat issue * Remove global config * Fix lint * remove unused * Fixed typos * Skipping popover dependent tests in firefox and webkit * Attempt to fix flaky fill * Attempt to fix other flaky tests Co-Authored-By: Nyby <45389841+NybyDK@users.noreply.github.com> * Disabling concurrent tests Co-Authored-By: Nyby <45389841+NybyDK@users.noreply.github.com> * Removed comment Co-Authored-By: Nyby <45389841+NybyDK@users.noreply.github.com> --------- Co-authored-by: Anton Co-authored-by: BaBrixx Co-authored-by: Bastian Brix <90306530+BaBrixx@users.noreply.github.com> Co-authored-by: Nyby <45389841+NybyDK@users.noreply.github.com> Co-authored-by: Nyby --- playwright.config.ts | 16 +++ src/lib/classes/automaton/IdMap.ts | 2 +- src/lib/components/buttons/SvgButton.svelte | 2 +- .../components/overlayMenu/OverlayMenu.svelte | 11 ++- src/lib/components/project/ProjectItem.svelte | 98 ++++++++++--------- .../project/ProjectItemDropDownMenu.svelte | 6 +- .../GlobalDeclaration.svelte | 6 +- src/routes/+layout.svelte | 13 +++ tests/lib/components/project/project.test.ts | 72 +++++++++++--- tests/lib/components/query/query.test.ts | 36 ++++++- .../components/settings/colorSettings.test.ts | 14 +++ .../components/settings/fontSettings.test.ts | 4 + .../lib/components/settings/settings.test.ts | 4 + .../components/sidePanel/sidePanel.test.ts | 4 + 14 files changed, 217 insertions(+), 71 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index 29515670..8234c0d8 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -1,6 +1,8 @@ import type { PlaywrightTestConfig } from "@playwright/test"; +import { devices } from "@playwright/test"; const config: PlaywrightTestConfig = { + workers: 1, webServer: { command: "yarn build && yarn preview", port: 4173, @@ -8,6 +10,20 @@ const config: PlaywrightTestConfig = { }, testDir: "tests", testMatch: /(.+\.)?(test|spec)\.[jt]s/, + 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/src/lib/classes/automaton/IdMap.ts b/src/lib/classes/automaton/IdMap.ts index c19dd912..0995042c 100644 --- a/src/lib/classes/automaton/IdMap.ts +++ b/src/lib/classes/automaton/IdMap.ts @@ -171,7 +171,7 @@ export abstract class IdMap< const storedMember = this.get(id); if (storedMember && storedMember.id !== id) { throw new TypeError( - `This map uses a different Id (${storedMember.id.rawId}) that is uniqely comparable to ${id.rawId}. You cannot use both in the same map.`, + `This map uses a different Id (${storedMember.id.rawId}) that is uniquely comparable to ${id.rawId}. You cannot use both in the same map.`, ); } } diff --git a/src/lib/components/buttons/SvgButton.svelte b/src/lib/components/buttons/SvgButton.svelte index 552d5668..4103cef3 100644 --- a/src/lib/components/buttons/SvgButton.svelte +++ b/src/lib/components/buttons/SvgButton.svelte @@ -15,13 +15,13 @@
+
+ {#if itemType === "component"} + + {:else} + + {/if} +
+