From 8d4c42d4604fb5113a48e38b4cd5d4aac3681591 Mon Sep 17 00:00:00 2001 From: Vector73 Date: Mon, 3 Jun 2024 14:22:19 +0530 Subject: [PATCH] tools: Replace `realm_uri` with `realm_url`. Replaces `realm_uri` with `realm_url` in "message-screenshot" and "thread-screenshot". Adds a missing `>` in both files. --- tools/screenshots/message-screenshot.js | 10 +++++----- tools/screenshots/thread-screenshot.js | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/screenshots/message-screenshot.js b/tools/screenshots/message-screenshot.js index 09fa9ed317..d42859eddf 100644 --- a/tools/screenshots/message-screenshot.js +++ b/tools/screenshots/message-screenshot.js @@ -12,11 +12,11 @@ const puppeteer = require("puppeteer"); const options = {}; program - .arguments(" { + .arguments(" ") + .action((messageId, imagePath, realmUrl) => { options.messageId = messageId; options.imagePath = imagePath; - options.realmUri = realmUri; + options.realmUrl = realmUrl; console.log(`Capturing screenshot for message ${messageId} to ${imagePath}`); }) .parse(process.argv); @@ -43,7 +43,7 @@ async function run() { const page = await browser.newPage(); // deviceScaleFactor:2 gives better quality screenshots (higher pixel density) await page.setViewport({width: 1280, height: 1024, deviceScaleFactor: 2}); - await page.goto(`${options.realmUri}/devlogin`); + await page.goto(`${options.realmUrl}/devlogin`); // wait for Iago devlogin button and click on it. await page.waitForSelector('[value="iago@zulip.com"]'); @@ -54,7 +54,7 @@ async function run() { ]); // Navigate to message and capture screenshot - await page.goto(`${options.realmUri}/#narrow/id/${options.messageId}`, { + await page.goto(`${options.realmUrl}/#narrow/id/${options.messageId}`, { waitUntil: "networkidle2", }); // eslint-disable-next-line no-undef diff --git a/tools/screenshots/thread-screenshot.js b/tools/screenshots/thread-screenshot.js index 74e12dce6b..84a56f3329 100644 --- a/tools/screenshots/thread-screenshot.js +++ b/tools/screenshots/thread-screenshot.js @@ -12,13 +12,13 @@ const puppeteer = require("puppeteer"); const options = {}; program - .arguments(" { + .arguments(" ") + .action((narrow_uri, narrow, unread_msg_id, imagePath, realmUrl) => { options.narrowUri = narrow_uri; options.narrow = narrow; options.messageId = unread_msg_id; options.imagePath = imagePath; - options.realmUri = realmUri; + options.realmUrl = realmUrl; console.log(`Capturing screenshot for ${narrow} to ${imagePath}`); }) .parse(process.argv); @@ -45,7 +45,7 @@ async function run() { const page = await browser.newPage(); // deviceScaleFactor:2 gives better quality screenshots (higher pixel density) await page.setViewport({width: 1280, height: 1024, deviceScaleFactor: 2}); - await page.goto(`${options.realmUri}/devlogin`); + await page.goto(`${options.realmUrl}/devlogin`); // wait for Iago devlogin button and click on it. await page.waitForSelector('[value="iago@zulip.com"]');