mirror of
https://github.com/zadam/trilium.git
synced 2025-11-22 00:24:24 +01:00
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
import App from "../support/app";
|
|
|
|
const NOTE_TITLE = "Trilium Integration Test DB";
|
|
|
|
test("Opens and activate a note from launcher Bar", async ({ page, context }) => {
|
|
const app = new App(page, context);
|
|
await app.goto();
|
|
await app.closeAllTabs();
|
|
|
|
const mapButton = app.launcherBar.locator(".launcher-button.bx-search.visible");
|
|
await expect(mapButton).toBeVisible();
|
|
|
|
await page.keyboard.down('Control');
|
|
await page.keyboard.down('Shift');
|
|
|
|
await mapButton.click();
|
|
|
|
await page.keyboard.up('Control');
|
|
await page.keyboard.up('Shift');
|
|
|
|
const tabs = app.tabBar.locator(".note-tab");
|
|
await expect(tabs).toHaveCount(2);
|
|
|
|
const secondTab = tabs.nth(1);
|
|
await expect(secondTab).toHaveAttribute('active', '');
|
|
});
|
|
|
|
test("Opens and activate a note from note tree", async ({ page, context }) => {
|
|
const app = new App(page, context);
|
|
await app.goto();
|
|
await app.closeAllTabs();
|
|
|
|
await page.keyboard.down('Control');
|
|
await page.keyboard.down('Shift');
|
|
|
|
await app.clickNoteOnNoteTreeByTitle(NOTE_TITLE);
|
|
|
|
await page.keyboard.up('Control');
|
|
await page.keyboard.up('Shift');
|
|
|
|
const tabs = app.tabBar.locator(".note-tab");
|
|
await expect(tabs).toHaveCount(2);
|
|
|
|
const secondTab = tabs.nth(1);
|
|
await expect(secondTab).toHaveAttribute('active', '');
|
|
}); |