From ec29772cae066de3c45a14d2d5d44fc68e135360 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Sat, 1 Apr 2023 19:15:19 +0200 Subject: [PATCH] reverse lastName and firstName --- src/workers/CommandorPage.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index d5b303b..3547d7f 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -123,7 +123,8 @@ class CommandorPage { const intervalTask = setInterval(() => { if (this.isTerminated) { log(this.device.model() + ":request terminated, will close device"); - this.context.close(); + if (this.context !== undefined) + this.context.close(); // this.page.close() // this.device.close() clearInterval(intervalTask) @@ -201,10 +202,10 @@ class CommandorPage { if (!this.isNameInput) { await page.locator(LAST_NAME).focus() await delay(getRandomWaitTime()) - await page.locator(LAST_NAME).fill(this.contact.firstName) + await page.locator(LAST_NAME).fill(this.contact.lastName) await page.locator(FIRST_NAME).focus() await delay(getRandomWaitTime()) - await page.locator(FIRST_NAME).fill(this.contact.lastName) + await page.locator(FIRST_NAME).fill(this.contact.firstName) this.isNameInput = true } }