test screenshot
This commit is contained in:
parent
6fc1c90c7e
commit
13b4f6f7f6
|
|
@ -1,27 +1,27 @@
|
|||
// const puppeteer = require("puppeteer");
|
||||
const puppeteer = require("puppeteer");
|
||||
|
||||
// (async () => {
|
||||
// // Launch a headless browser
|
||||
// const browser = await puppeteer.launch();
|
||||
(async () => {
|
||||
// Launch a headless browser
|
||||
const browser = await puppeteer.launch();
|
||||
|
||||
// // Open a new page
|
||||
// const page = await browser.newPage();
|
||||
// await page.goto(
|
||||
// "http://localhost:3000/screenShot/20230913-TEST01-Session.Port4-6-172.16.20.7.log"
|
||||
// );
|
||||
// const bodyHandle = await page.$('body');
|
||||
// const { height } = await bodyHandle.boundingBox();
|
||||
// await bodyHandle.dispose();
|
||||
// await page.setViewport({ width: 1920, height: 500 });
|
||||
// setTimeout(async () => {
|
||||
// await page.screenshot({ path: "screenshot.png" });
|
||||
// await browser.close();
|
||||
// }, 5000);
|
||||
// // } else {
|
||||
// // console.error(`Element with class name '${className}' not found.`);
|
||||
// // }
|
||||
// // Close the browser
|
||||
// })();
|
||||
// Open a new page
|
||||
const page = await browser.newPage();
|
||||
await page.goto(
|
||||
"https://logs.danielvu.com/screenShot/20230913-TEST01-Session.Port4-6-172.16.20.7.log"
|
||||
);
|
||||
const bodyHandle = await page.$('body');
|
||||
const { height } = await bodyHandle.boundingBox();
|
||||
await bodyHandle.dispose();
|
||||
await page.setViewport({ width: 1920, height: 500 });
|
||||
setTimeout(async () => {
|
||||
await page.screenshot({ path: "screenshot.png" });
|
||||
await browser.close();
|
||||
}, 5000);
|
||||
// } else {
|
||||
// console.error(`Element with class name '${className}' not found.`);
|
||||
// }
|
||||
// Close the browser
|
||||
})();
|
||||
|
||||
// const zulip = require("zulip-js");
|
||||
|
||||
|
|
@ -101,8 +101,8 @@
|
|||
|
||||
|
||||
// Usage example
|
||||
const filePath = __dirname+'\\screenshot.png';
|
||||
uploadFileToZulip(filePath);
|
||||
// const filePath = __dirname+'\\screenshot.png';
|
||||
// uploadFileToZulip(filePath);
|
||||
|
||||
// const zulip = require('zulip-js');
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Loading…
Reference in New Issue