From b376f090d873ae821a127c9e0b8787ee3da170be Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 17 Jan 2025 22:57:56 +0200 Subject: [PATCH] fix(e2e): bring back help link tests --- e2e/help.spec.ts | 27 +++++++++++++++++++++++++++ integration-tests/help.spec.ts | 23 ----------------------- 2 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 e2e/help.spec.ts delete mode 100644 integration-tests/help.spec.ts diff --git a/e2e/help.spec.ts b/e2e/help.spec.ts new file mode 100644 index 000000000..19f52d750 --- /dev/null +++ b/e2e/help.spec.ts @@ -0,0 +1,27 @@ +import { test, expect, Page } from "@playwright/test"; +import App from "./support/app"; + +test("Help popup", async ({ page, context }) => { + page.setDefaultTimeout(15_000); + + const app = new App(page, context); + await app.goto(); + + const popupPromise = page.waitForEvent("popup"); + await app.currentNoteSplit.press("F1"); + await page.getByRole("link", { name: "online↗" }).click(); + const popup = await popupPromise; + expect(popup.url()).toBe("https://triliumnext.github.io/Docs/"); +}); + +test("Complete help in search", async ({ page, context }) => { + const app = new App(page, context); + await app.goto(); + + await app.launcherBar.locator(".bx-search").first().click(); + await app.currentNoteSplit.locator(".search-settings .bx-help-circle").click(); + const popupPromise = page.waitForEvent("popup"); + await page.getByRole("link", { name: "complete help on search syntax" }).click(); + const popup = await popupPromise; + expect(popup.url()).toBe("https://triliumnext.github.io/Docs/Wiki/search.html"); +}); diff --git a/integration-tests/help.spec.ts b/integration-tests/help.spec.ts deleted file mode 100644 index bf12d9978..000000000 --- a/integration-tests/help.spec.ts +++ /dev/null @@ -1,23 +0,0 @@ -import test, { expect } from "@playwright/test"; - -test("Help popup", async ({ page }) => { - await page.goto("http://localhost:8082"); - await page.getByText("Trilium Integration Test DB").click(); - - await page.locator("body").press("F1"); - await page.getByRole("link", { name: "online↗" }).click(); - expect((await page.waitForEvent("popup")).url()).toBe("https://triliumnext.github.io/Docs/"); -}); - -test("Complete help in search", async ({ page }) => { - await page.goto("http://localhost:8082"); - - // Clear all tabs - await page.locator(".note-tab:first-of-type").locator("div").nth(1).click({ button: "right" }); - await page.getByText("Close all tabs").click(); - - await page.locator("#launcher-container").getByRole("button", { name: "" }).first().click(); - await page.getByRole("cell", { name: " " }).locator("span").first().click(); - await page.getByRole("button", { name: "complete help on search syntax" }).click(); - expect((await page.waitForEvent("popup")).url()).toBe("https://triliumnext.github.io/Docs/Wiki/search.html"); -});