tools: Add support for generating integration screenshots remotely.

I have added support for generating integration screenshots remotely by
adding a `realm_uri` parameter to `tools/message-screenshot.js` which we
then pass `realm.uri` to from within
`tools/generate-integration-docs-screenshot`.
This commit is contained in:
Adam Birds
2021-04-15 22:06:18 +00:00
committed by Tim Abbott
parent 14b01343d9
commit 3b974d9ef7
2 changed files with 7 additions and 6 deletions

View File

@@ -187,12 +187,13 @@ def send_bot_payload_message(
def capture_last_message_screenshot(bot: UserProfile, image_path: str) -> None:
message = Message.objects.filter(sender=bot).last()
realm = get_realm("zulip")
if message is None:
print(f"No message found for {bot.full_name}")
return
message_id = str(message.id)
screenshot_script = os.path.join(TOOLS_DIR, "message-screenshot.js")
subprocess.check_call(["node", screenshot_script, message_id, image_path])
subprocess.check_call(["node", screenshot_script, message_id, image_path, realm.uri])
def generate_screenshot_from_config(