mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -12,11 +12,11 @@ const puppeteer = require("puppeteer");
 | 
				
			|||||||
const options = {};
 | 
					const options = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
program
 | 
					program
 | 
				
			||||||
    .arguments("<message_id> <image_path> <realm_uri")
 | 
					    .arguments("<message_id> <image_path> <realm_url>")
 | 
				
			||||||
    .action((messageId, imagePath, realmUri) => {
 | 
					    .action((messageId, imagePath, realmUrl) => {
 | 
				
			||||||
        options.messageId = messageId;
 | 
					        options.messageId = messageId;
 | 
				
			||||||
        options.imagePath = imagePath;
 | 
					        options.imagePath = imagePath;
 | 
				
			||||||
        options.realmUri = realmUri;
 | 
					        options.realmUrl = realmUrl;
 | 
				
			||||||
        console.log(`Capturing screenshot for message ${messageId} to ${imagePath}`);
 | 
					        console.log(`Capturing screenshot for message ${messageId} to ${imagePath}`);
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .parse(process.argv);
 | 
					    .parse(process.argv);
 | 
				
			||||||
@@ -43,7 +43,7 @@ async function run() {
 | 
				
			|||||||
        const page = await browser.newPage();
 | 
					        const page = await browser.newPage();
 | 
				
			||||||
        // deviceScaleFactor:2 gives better quality screenshots (higher pixel density)
 | 
					        // deviceScaleFactor:2 gives better quality screenshots (higher pixel density)
 | 
				
			||||||
        await page.setViewport({width: 1280, height: 1024, deviceScaleFactor: 2});
 | 
					        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.
 | 
					        // wait for Iago devlogin button and click on it.
 | 
				
			||||||
        await page.waitForSelector('[value="iago@zulip.com"]');
 | 
					        await page.waitForSelector('[value="iago@zulip.com"]');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -54,7 +54,7 @@ async function run() {
 | 
				
			|||||||
        ]);
 | 
					        ]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Navigate to message and capture screenshot
 | 
					        // 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",
 | 
					            waitUntil: "networkidle2",
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        // eslint-disable-next-line no-undef
 | 
					        // eslint-disable-next-line no-undef
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,13 +12,13 @@ const puppeteer = require("puppeteer");
 | 
				
			|||||||
const options = {};
 | 
					const options = {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
program
 | 
					program
 | 
				
			||||||
    .arguments("<narrow_uri> <narrow> <unread_msg_id> <image_path> <realm_uri")
 | 
					    .arguments("<narrow_uri> <narrow> <unread_msg_id> <image_path> <realm_url>")
 | 
				
			||||||
    .action((narrow_uri, narrow, unread_msg_id, imagePath, realmUri) => {
 | 
					    .action((narrow_uri, narrow, unread_msg_id, imagePath, realmUrl) => {
 | 
				
			||||||
        options.narrowUri = narrow_uri;
 | 
					        options.narrowUri = narrow_uri;
 | 
				
			||||||
        options.narrow = narrow;
 | 
					        options.narrow = narrow;
 | 
				
			||||||
        options.messageId = unread_msg_id;
 | 
					        options.messageId = unread_msg_id;
 | 
				
			||||||
        options.imagePath = imagePath;
 | 
					        options.imagePath = imagePath;
 | 
				
			||||||
        options.realmUri = realmUri;
 | 
					        options.realmUrl = realmUrl;
 | 
				
			||||||
        console.log(`Capturing screenshot for ${narrow} to ${imagePath}`);
 | 
					        console.log(`Capturing screenshot for ${narrow} to ${imagePath}`);
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
    .parse(process.argv);
 | 
					    .parse(process.argv);
 | 
				
			||||||
@@ -45,7 +45,7 @@ async function run() {
 | 
				
			|||||||
        const page = await browser.newPage();
 | 
					        const page = await browser.newPage();
 | 
				
			||||||
        // deviceScaleFactor:2 gives better quality screenshots (higher pixel density)
 | 
					        // deviceScaleFactor:2 gives better quality screenshots (higher pixel density)
 | 
				
			||||||
        await page.setViewport({width: 1280, height: 1024, deviceScaleFactor: 2});
 | 
					        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.
 | 
					        // wait for Iago devlogin button and click on it.
 | 
				
			||||||
        await page.waitForSelector('[value="iago@zulip.com"]');
 | 
					        await page.waitForSelector('[value="iago@zulip.com"]');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user