-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.spec.ts
More file actions
31 lines (26 loc) · 901 Bytes
/
index.spec.ts
File metadata and controls
31 lines (26 loc) · 901 Bytes
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
import { test, expect } from '@playwright/test';
import path from 'path';
import { fileURLToPath } from 'url';
import { runDevCommand, killProcess } from '../../e2e/utils.ts';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
test.describe('rspress-plugin-katex', () => {
let devProcess: any;
let url: string;
test.beforeAll(async () => {
const result = await runDevCommand(__dirname);
devProcess = result.process;
url = result.url;
});
test.afterAll(async () => {
if (devProcess) {
await killProcess(devProcess);
}
});
test('should render katex math', async ({ page }) => {
await page.goto(url, { waitUntil: 'networkidle' });
// Check if katex-html element exists, which is generated by katex
const katexElement = page.locator('.katex-html');
await expect(katexElement).toBeVisible();
});
});