test screenshot

This commit is contained in:
joseph le 2023-09-15 13:22:27 +07:00
parent 6fc1c90c7e
commit 13b4f6f7f6
2 changed files with 24 additions and 24 deletions

View File

@ -1,27 +1,27 @@
// const puppeteer = require("puppeteer"); const puppeteer = require("puppeteer");
// (async () => { (async () => {
// // Launch a headless browser // Launch a headless browser
// const browser = await puppeteer.launch(); const browser = await puppeteer.launch();
// // Open a new page // Open a new page
// const page = await browser.newPage(); const page = await browser.newPage();
// await page.goto( await page.goto(
// "http://localhost:3000/screenShot/20230913-TEST01-Session.Port4-6-172.16.20.7.log" "https://logs.danielvu.com/screenShot/20230913-TEST01-Session.Port4-6-172.16.20.7.log"
// ); );
// const bodyHandle = await page.$('body'); const bodyHandle = await page.$('body');
// const { height } = await bodyHandle.boundingBox(); const { height } = await bodyHandle.boundingBox();
// await bodyHandle.dispose(); await bodyHandle.dispose();
// await page.setViewport({ width: 1920, height: 500 }); await page.setViewport({ width: 1920, height: 500 });
// setTimeout(async () => { setTimeout(async () => {
// await page.screenshot({ path: "screenshot.png" }); await page.screenshot({ path: "screenshot.png" });
// await browser.close(); await browser.close();
// }, 5000); }, 5000);
// // } else { // } else {
// // console.error(`Element with class name '${className}' not found.`); // console.error(`Element with class name '${className}' not found.`);
// // } // }
// // Close the browser // Close the browser
// })(); })();
// const zulip = require("zulip-js"); // const zulip = require("zulip-js");
@ -101,8 +101,8 @@
// Usage example // Usage example
const filePath = __dirname+'\\screenshot.png'; // const filePath = __dirname+'\\screenshot.png';
uploadFileToZulip(filePath); // uploadFileToZulip(filePath);
// const zulip = require('zulip-js'); // const zulip = require('zulip-js');

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB