From 0a65dbeb8388e823e0bb4d285026b88600f45740 Mon Sep 17 00:00:00 2001 From: Basit <1305718+mabaasit@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:24:36 +0100 Subject: [PATCH] fix(e2e-tests): close the focus-mode modal COMPASS-8820 (#6615) * close the modal * close modal using close button * remove unused stuff --- .../tests/collection-aggregations-tab.test.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts b/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts index fd325a63cdc..1bd2be6dea7 100644 --- a/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts +++ b/packages/compass-e2e-tests/tests/collection-aggregations-tab.test.ts @@ -17,16 +17,11 @@ import { createNumbersCollection, } from '../helpers/insert-data'; import { saveAggregationPipeline } from '../helpers/commands/save-aggregation-pipeline'; -import { Key } from 'webdriverio'; import type { ChainablePromiseElement } from 'webdriverio'; import { switchPipelineMode } from '../helpers/commands/switch-pipeline-mode'; const { expect } = chai; -function sleep(ms: number) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} - const OUT_STAGE_PREVIEW_TEXT = 'The $out operator will cause the pipeline to persist the results to the specified location (collection, S3, or Atlas). If the collection exists it will be replaced.'; const MERGE_STAGE_PREVIEW_TEXT = @@ -1332,13 +1327,7 @@ describe('Collection aggregations tab', function () { }); await browser.waitForAriaDisabled(previousButton, true); - // previousButton has a tooltip, to close it we press Escape - // and wait a bit (for the debounced close to kick in) - await browser.keys([Key.Escape]); - await sleep(50); - - // the next Escape is for the modal to close - await browser.keys([Key.Escape]); + await browser.clickVisible(Selectors.FocusModeCloseModalButton); await modal.waitForDisplayed({ reverse: true }); });