-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_click.mjs
More file actions
32 lines (25 loc) · 1.12 KB
/
test_click.mjs
File metadata and controls
32 lines (25 loc) · 1.12 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
import { chromium } from 'playwright';
import fs from 'fs/promises';
import path from 'path';
(async () => {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('http://127.0.0.1:5175/?fs=mock');
await page.waitForSelector('.landing-panel');
await page.click('button.primary-button');
await page.waitForSelector('.sidebar-item');
await page.click(`text=DATA_CORRECTNESS_VERIFICATION.md`);
await page.waitForTimeout(2000);
const contentBefore = await page.content();
const hasBlockNote = contentBefore.includes('bn-container');
console.log('Has BlockNote before click?', hasBlockNote);
await page.click('button:has-text("Open source")');
await page.waitForTimeout(2000);
const contentAfter = await page.content();
const hasCodeMirror = contentAfter.includes('cm-editor');
const hasBlockNoteAfter = contentAfter.includes('bn-container');
console.log('Has CodeMirror after click?', hasCodeMirror);
console.log('Has BlockNote after click?', hasBlockNoteAfter);
await browser.close();
})();