mirror of
https://github.com/zulip/zulip.git
synced 2025-10-26 17:43:58 +00:00
puppeteer_lib: Use class fields.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
42f4156b36
commit
8dec7b9270
@@ -12,11 +12,10 @@ const root_dir = path.resolve(__dirname, "../../");
|
||||
const puppeteer_dir = path.join(root_dir, "var/puppeteer");
|
||||
|
||||
class CommonUtils {
|
||||
constructor() {
|
||||
this.browser = null;
|
||||
this.screenshot_id = 0;
|
||||
this.realm_url = "http://zulip.zulipdev.com:9981/";
|
||||
this.pm_recipient = {
|
||||
browser = null;
|
||||
screenshot_id = 0;
|
||||
realm_url = "http://zulip.zulipdev.com:9981/";
|
||||
pm_recipient = {
|
||||
async set(page, recipient) {
|
||||
// Without using the delay option here there seems to be
|
||||
// a flake where the typeahead doesn't show up.
|
||||
@@ -47,17 +46,16 @@ class CommonUtils {
|
||||
},
|
||||
};
|
||||
|
||||
this.fullname = {
|
||||
fullname = {
|
||||
cordelia: "Cordelia Lear",
|
||||
othello: "Othello, the Moor of Venice",
|
||||
hamlet: "King Hamlet",
|
||||
};
|
||||
|
||||
this.window_size = {
|
||||
window_size = {
|
||||
width: 1400,
|
||||
height: 1024,
|
||||
};
|
||||
}
|
||||
|
||||
async ensure_browser() {
|
||||
if (this.browser === null) {
|
||||
|
||||
Reference in New Issue
Block a user