From 5136b3b3b1314216bd70fb1b9056aa5bc623a599 Mon Sep 17 00:00:00 2001 From: Gabriel Weyer Date: Mon, 18 Sep 2023 07:57:58 +1000 Subject: [PATCH] Dismiss nudge popup --- parser/out/.gitkeep | 0 parser/src/app.ts | 2 ++ parser/src/azurePortalExtensions.ts | 8 ++++++++ 3 files changed, 10 insertions(+) delete mode 100644 parser/out/.gitkeep diff --git a/parser/out/.gitkeep b/parser/out/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/parser/src/app.ts b/parser/src/app.ts index 099cf61..f0562c0 100644 --- a/parser/src/app.ts +++ b/parser/src/app.ts @@ -218,6 +218,8 @@ function timeEvent(eventName: string): void { await portal.selectHourlyPricing(); timeEvent('hourlyPricingSelectionCompletedAt'); + await portal.dismissNudgePopupIfPresent(); + console.log(); timeEvent('parsePricingStartedAt'); diff --git a/parser/src/azurePortalExtensions.ts b/parser/src/azurePortalExtensions.ts index d66444e..5b23260 100644 --- a/parser/src/azurePortalExtensions.ts +++ b/parser/src/azurePortalExtensions.ts @@ -49,6 +49,14 @@ export class AzurePortal { await setSelect(this.p, selector, 'hour'); } + async dismissNudgePopupIfPresent(): Promise { + const closeButton = await this.p.$('[data-testid="nudge-popup-close-btn"]'); + + if (closeButton !== null) { + closeButton.click(); + } + } + async selectReservedInstances(): Promise { console.log('Selecting reserved instances'); const selector = '[name="pricingModel"]';