mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
Add e2e: open and activate notes from the launch pane and tree
This commit is contained in:
parent
9b1ddd970c
commit
52d6d05159
49
apps/server-e2e/src/layout/open_note_and_activate.spec.ts
Normal file
49
apps/server-e2e/src/layout/open_note_and_activate.spec.ts
Normal file
@ -0,0 +1,49 @@
|
||||
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();
|
||||
await app.goToNoteInNewTab(NOTE_TITLE);
|
||||
|
||||
const calendarButton = app.launcherBar.locator(".launcher-button.bx-calendar-star.visible");
|
||||
await expect(calendarButton).toBeVisible();
|
||||
|
||||
await page.keyboard.down('Control');
|
||||
await page.keyboard.down('Shift');
|
||||
|
||||
await calendarButton.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 app.goToNoteInNewTab(NOTE_TITLE);
|
||||
|
||||
await page.keyboard.down('Control');
|
||||
await page.keyboard.down('Shift');
|
||||
|
||||
await app.noteTreeActiveNote.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', '');
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user