From 85529c2f508841eb19b5376cf60abac16fa499eb Mon Sep 17 00:00:00 2001 From: Matthias Rolke Date: Sun, 8 Oct 2023 20:28:36 +0200 Subject: [PATCH] fix: make enabling HighVelocitySales more robust --- src/plugins/high-velocity-sales-settings/page.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/high-velocity-sales-settings/page.ts b/src/plugins/high-velocity-sales-settings/page.ts index eae47701..28055d70 100644 --- a/src/plugins/high-velocity-sales-settings/page.ts +++ b/src/plugins/high-velocity-sales-settings/page.ts @@ -16,10 +16,14 @@ export class HighVelocitySalesSetupPage { } public async setUpAndEnable(): Promise { - await this.page.waitForSelector(SET_UP_AND_ENABLE_HVS_BUTTON); - await this.page.click(SET_UP_AND_ENABLE_HVS_BUTTON); + await this.page.waitForSelector(SET_UP_AND_ENABLE_HVS_BUTTON, { + visible: true + }); + await Promise.all([ + this.page.waitForSelector(ENABLE_TOGGLE, { timeout: 60_000 }), + await this.page.click(SET_UP_AND_ENABLE_HVS_BUTTON) + ]); await throwPageErrors(this.page); - await this.page.waitForSelector(ENABLE_TOGGLE); await this.page.close(); } }