Skip to content

Commit

Permalink
fix(e2e-tests): close the focus-mode modal COMPASS-8820 (#6615)
Browse files Browse the repository at this point in the history
* close the modal

* close modal using close button

* remove unused stuff
  • Loading branch information
mabaasit authored Jan 16, 2025
1 parent 74472a0 commit 0a65dbe
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 });
});
Expand Down

0 comments on commit 0a65dbe

Please sign in to comment.