mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
refactor: Extract out out root_dir and puppeteer_dir.
The puppeteer_dir will use used for passing in the path to save the recording.
This commit is contained in:
committed by
Tim Abbott
parent
3ab603e3a2
commit
cb1020abd4
@@ -7,6 +7,9 @@ const puppeteer = require("puppeteer");
|
||||
|
||||
const test_credentials = require("../../var/puppeteer/test_credentials.js").test_credentials;
|
||||
|
||||
const root_dir = path.resolve(__dirname, "../../");
|
||||
const puppeteer_dir = path.join(root_dir, "var/puppeteer");
|
||||
|
||||
class CommonUtils {
|
||||
constructor() {
|
||||
this.browser = null;
|
||||
@@ -86,8 +89,7 @@ class CommonUtils {
|
||||
this.screenshot_id += 1;
|
||||
}
|
||||
|
||||
const root_dir = path.resolve(__dirname, "../../");
|
||||
const screenshot_path = path.join(root_dir, "var/puppeteer", `${name}.png`);
|
||||
const screenshot_path = path.join(puppeteer_dir, `${name}.png`);
|
||||
await page.screenshot({
|
||||
path: screenshot_path,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user