Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
tools: Fix message-screenshot.js failing to take screenshot.
Dinesh7229088b6cd3
diff --git a/tools/message-screenshot.js b/tools/message-screenshot.jsindex 502372c6e85..384d20d6c2c 100644--- a/tools/message-screenshot.js+++ b/tools/message-screenshot.js@@ -36,9 +36,14 @@ async function run() {// deviceScaleFactor:2 gives better quality screenshots (higher pixel density)await page.setViewport({ width: 1280, height: 1024, deviceScaleFactor: 2 });await page.goto('http://' + host);- // wait for devlogin admin button and click on it- await page.waitForSelector('.btn-admin');- await page.click('.btn-admin');+ // wait for Iago devlogin button and click on it.+ await page.waitForSelector('[value="[email protected]"]');++ // By waiting till DOMContentLoaded we're confirming that Iago is logged in.+ await Promise.all([+ page.waitForNavigation({ waitUntil: 'domcontentloaded' }),+ page.click('[value="[email protected]"]'),+ ]);// Navigate to message and capture screenshotawait page.goto(`http://${host}/#narrow/near/${options.messageId}`);