diff --git a/packages/compass-e2e-tests/helpers/commands/create-index.ts b/packages/compass-e2e-tests/helpers/commands/create-index.ts index ea0a4c23fd6..a62d69cd1af 100644 --- a/packages/compass-e2e-tests/helpers/commands/create-index.ts +++ b/packages/compass-e2e-tests/helpers/commands/create-index.ts @@ -108,5 +108,11 @@ export async function createIndex( const indexComponent = await browser.$(indexComponentSelector); await indexComponent.waitForDisplayed(); + // Wait for index to get ready before proceeding + await browser + .$(indexComponentSelector) + .$(Selectors.IndexPropertyInProgress) + .waitForDisplayed({ reverse: true }); + return indexName; } diff --git a/packages/compass-e2e-tests/helpers/selectors.ts b/packages/compass-e2e-tests/helpers/selectors.ts index eac0d4f5f43..5760e945347 100644 --- a/packages/compass-e2e-tests/helpers/selectors.ts +++ b/packages/compass-e2e-tests/helpers/selectors.ts @@ -1088,6 +1088,7 @@ export const indexComponent = (name: string): string => { }; export const IndexFieldName = '[data-testid="indexes-name-field"]'; export const IndexFieldType = '[data-testid="indexes-type-field"]'; +export const IndexPropertyInProgress = '[data-testid="index-in-progress"]'; export const IndexToggleOptions = '[data-testid="create-index-modal-toggle-options"]'; export const indexToggleOption = (fieldName: string) => { diff --git a/packages/compass-indexes/src/components/regular-indexes-table/property-field.tsx b/packages/compass-indexes/src/components/regular-indexes-table/property-field.tsx index ffcfd89f6fd..fe29fa9197c 100644 --- a/packages/compass-indexes/src/components/regular-indexes-table/property-field.tsx +++ b/packages/compass-indexes/src/components/regular-indexes-table/property-field.tsx @@ -109,7 +109,9 @@ const PropertyField: React.FunctionComponent = ({ /> )} {extra.status === 'inprogress' && ( - In Progress ... + + In Progress ... + )} {extra.status === 'failed' && (