forked from aggamsingh/ClassM8
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
21 lines (15 loc) · 636 Bytes
/
Copy pathtest.ts
File metadata and controls
21 lines (15 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
page.on('console', msg => console.log('BROWSER CONSOLE:', msg.type(), msg.text()));
await page.goto('http://localhost:5173');
await page.waitForTimeout(1000);
// Click the first suggestion
await page.click('button:has-text("What is a redox reaction?")');
await page.waitForTimeout(2000);
const html = await page.content();
// check if fallback text is there
console.log("Has fallback?", html.includes("I couldn't find information"));
await browser.close();
})();