puppeteer_lib: Use class fields.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-19 23:34:39 -08:00
committed by Tim Abbott
parent 42f4156b36
commit 8dec7b9270

View File

@@ -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) {