mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +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 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 {
|
class CommonUtils {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.browser = null;
|
this.browser = null;
|
||||||
@@ -86,8 +89,7 @@ class CommonUtils {
|
|||||||
this.screenshot_id += 1;
|
this.screenshot_id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const root_dir = path.resolve(__dirname, "../../");
|
const screenshot_path = path.join(puppeteer_dir, `${name}.png`);
|
||||||
const screenshot_path = path.join(root_dir, "var/puppeteer", `${name}.png`);
|
|
||||||
await page.screenshot({
|
await page.screenshot({
|
||||||
path: screenshot_path,
|
path: screenshot_path,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user