-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright_social.js
More file actions
36 lines (30 loc) · 1.01 KB
/
Copy pathplaywright_social.js
File metadata and controls
36 lines (30 loc) · 1.01 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
import { chromium } from "playwright";
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
// Set window size
await page.setViewportSize({ width: 1280, height: 720 });
try {
console.log("Visiting Apps page...");
const response = await page.goto("http://localhost:8080/apps");
if (!response || response.status() >= 400) {
throw new Error(
`Failed to load Apps page: ${response?.status() || "No response"}`,
);
}
await page.waitForTimeout(2000);
console.log("Visiting User Profile page...");
const profileResponse = await page.goto(
"http://localhost:8080/users/testuser",
);
if (!profileResponse || profileResponse.status() >= 400) {
throw new Error(`Profile page status: ${profileResponse.status()}`);
}
await page.waitForTimeout(2000);
console.log("Verification successful");
} catch (e) {
console.error("Error during verification:", e);
process.exit(1);
}
await browser.close();
})();