From 6d0f7aac2855f980b265088e12ff2b5f2d3b79b6 Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 26 Sep 2024 16:39:59 -0400 Subject: [PATCH] Fixes --- integration-tests/utils/integration-utils.js | 21 +++++--------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/integration-tests/utils/integration-utils.js b/integration-tests/utils/integration-utils.js index a4af808574..c13d383aa2 100644 --- a/integration-tests/utils/integration-utils.js +++ b/integration-tests/utils/integration-utils.js @@ -282,7 +282,11 @@ const dismissNPSSurvey = async (page) => { try { console.log('dismissing NPS survey'); const iframe = await element.contentFrame(); - const [closeButton] = await iframe.$$('.//*[normalize-space(.)="Ask Me Later"]'); + const elements = await iframe.$$('div'); + const closeButton = elements.find(async (element) => { + const text = await (await element.getProperty('textContent')).jsonValue(); + return text.trim() === 'Ask Me Later'; + }); await closeButton.evaluate((button) => button.click()); await delay(500); // delayed for survey to animate off } catch (e) { @@ -314,13 +318,6 @@ const findElement = (page, xpath, options) => { return page.waitForSelector(`xpath/${xpath}`, defaultToVisibleTrue(options)); }; -const findErrorPopup = (page, options) => { - return page.waitForSelector( - '(xpath///a | xpath///*[@role="button"] | xpath///button)[contains(@aria-label,"Dismiss")][contains(@aria-label,"error")]', - options - ); -}; - const heading = ({ level, text, textContains, isDescendant = false }) => { const tag = `h${level}`; const aria = `*[@role="heading" and @aria-level=${level}]`; @@ -367,12 +364,6 @@ const findInDataTableRow = (page, entityName, text) => { return findElement(page, elementInDataTableRow(entityName, text)); }; -const findButtonInDialogByAriaLabel = (page, ariaLabelText) => { - return page.waitForSelector(`xpath///*[@role="dialog" and @aria-hidden="false"]//*[@role="button" and contains(@aria-label,"${ariaLabelText}")]`, { - visible: true, - }); -}; - /** Waits for a menu element to expand (or collapse if isExpanded=false) */ const waitForMenu = (page, { labelContains, isExpanded = true, ...options }) => { const labelContainsSelector = `[aria-label*="${labelContains}"], [id="${labelContains}"], [aria-labelledby*="${labelContains}"]`; @@ -616,9 +607,7 @@ module.exports = { enablePageLogging, fillIn, fillInReplace, - findButtonInDialogByAriaLabel, findElement, - findErrorPopup, findHeading, findIframe, findInDataTableRow,