mirror of https://github.com/zulip/zulip.git
tools: Fix message-screenshot.js failing to take screenshot.
To take screenshots, we log in as Desdemonia who doesn't seem to have permissions to the streams where we capture screenshots. This commit fixes it by logging in as Iago. Also added a waitForNavigation until DOMContentLoaded to avoid flakes that could occur because of us going to another URL before Iago gets logged in.
This commit is contained in:
parent
a92b31db05
commit
7229088b6c
|
@ -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="iago@zulip.com"]');
|
||||
|
||||
// By waiting till DOMContentLoaded we're confirming that Iago is logged in.
|
||||
await Promise.all([
|
||||
page.waitForNavigation({ waitUntil: 'domcontentloaded' }),
|
||||
page.click('[value="iago@zulip.com"]'),
|
||||
]);
|
||||
|
||||
// Navigate to message and capture screenshot
|
||||
await page.goto(`http://${host}/#narrow/near/${options.messageId}`);
|
||||
|
|
Loading…
Reference in New Issue