From 3ab603e3a200c18d2374d296f70de5fefbae2749 Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Wed, 29 Jul 2020 23:34:37 +0000 Subject: [PATCH] refactor: Extract window size into a object. This will be passed to the function that will start the recording. --- frontend_tests/puppeteer_lib/common.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend_tests/puppeteer_lib/common.js b/frontend_tests/puppeteer_lib/common.js index 8193c22519..bad203dcdd 100644 --- a/frontend_tests/puppeteer_lib/common.js +++ b/frontend_tests/puppeteer_lib/common.js @@ -41,17 +41,28 @@ class CommonUtils { assert.equal(actual_recipients, expected); }, }; + this.fullname = { cordelia: "Cordelia Lear", othello: "Othello, the Moor of Venice", hamlet: "King Hamlet", }; + + this.window_size = { + width: 1400, + height: 1024, + }; } async ensure_browser() { if (this.browser === null) { + const {window_size} = this; this.browser = await puppeteer.launch({ - args: ["--window-size=1400,1024", "--no-sandbox", "--disable-setuid-sandbox"], + args: [ + `--window-size=${window_size.width},${window_size.height}`, + "--no-sandbox", + "--disable-setuid-sandbox", + ], defaultViewport: {width: 1280, height: 1024}, headless: true, });