Skip to content

Commit 510217f

Browse files
authored
chore(e2e-tests): wait for aggregation name to reduce flakes COMPASS-9143 (#6808)
1 parent 6dd93f7 commit 510217f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/compass-e2e-tests/helpers/commands/save-aggregation-pipeline.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@ export async function saveAggregationPipeline(
5050

5151
// wait for the modal to disappear
5252
await savePipelineModal.waitForDisplayed({ reverse: true });
53+
54+
// Wait for the aggregation's name to be displayed.
55+
await browser.waitForAnimations(Selectors.AggregationPipelineName);
56+
await browser.waitUntil(async () => {
57+
const text = await browser.$(Selectors.AggregationPipelineName).getText();
58+
return text === aggregationName;
59+
});
5360
}

packages/compass-e2e-tests/helpers/selectors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,7 @@ export const AggregationWriteOperationConfirmationModalDescription = `${Aggregat
824824

825825
export const AggregationSettingsButton =
826826
'[data-testid="pipeline-toolbar-settings-button"]';
827+
export const AggregationPipelineName = '[data-testid="pipeline-name"]';
827828
export const AggregationCommentModeCheckbox = '#aggregation-comment-mode';
828829
export const AggregationSampleSizeInput = '#aggregation-sample-size';
829830
export const AggregationSettingsApplyButton = '#aggregation-settings-apply';

0 commit comments

Comments
 (0)