From fd37b50e1d379545deb04bac1b12358132db5767 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 9 Dec 2022 13:48:04 +0100 Subject: [PATCH] check cguCheck --- src/workers/CommandorPage.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index 3dbe5cc..79d1a67 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -68,6 +68,7 @@ class CommandorPage { this.isTerminated = false; this.audioAnalyse = audioAnalyse; this.alertBeep = alertBeep; + this.cguChecked = false; } @@ -208,11 +209,14 @@ class CommandorPage { async checkCGU(page) { try { if (!page.isClosed()) { - await page.locator(CGU_ID).focus() - await page.locator(CGU_ID).click() - await delay(getRandomWaitTime()) - await page.locator(PROCESSING_ID).focus() - await page.locator(PROCESSING_ID).click() + if (!this.cguChecked) { + await page.locator(CGU_ID).focus() + await page.locator(CGU_ID).click() + await delay(getRandomWaitTime()) + await page.locator(PROCESSING_ID).focus() + await page.locator(PROCESSING_ID).click() + this.cguChecked = true; + } } } catch (e) { log(e);