-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
34 lines (28 loc) · 832 Bytes
/
test.js
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
const puppeteer = require("puppeteer");
const URL = "https://vscode.dev";
const selectors = [
`body div[role="application"] > div.monaco-grid-view`,
`.split-view-view > .editor-group-container`,
`.split-view-view > .part.sidebar`,
`.split-view-view > .part.auxiliarybar`,
`.split-view-view > .part.panel`,
];
(async () => {
const browser = await puppeteer.launch({
args: ["--headless=old"]
});
const page = await browser.newPage();
await page.goto(URL);
let failed = false;
for(const s of selectors){
try{
await page.waitForSelector(s, { timeout: 5000 });
console.info('✅', s);
}catch(e){
console.error('❌', s);
failed = true;
}
}
await browser.close();
failed && process.exit(1);
})();