This repository was archived by the owner on Jun 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathopen_note_and_activate.spec.ts
More file actions
47 lines (33 loc) · 1.37 KB
/
open_note_and_activate.spec.ts
File metadata and controls
47 lines (33 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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', '');
});