Skip to content

Commit

Permalink
chore(e2e): update create index helper to wait for index creation bas…
Browse files Browse the repository at this point in the history
…ed on badge in the table
  • Loading branch information
gribnoysup committed Sep 25, 2024
1 parent 47608d1 commit e184f98
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/compass-e2e-tests/helpers/commands/create-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions packages/compass-e2e-tests/helpers/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ const PropertyField: React.FunctionComponent<PropertyFieldProps> = ({
/>
)}
{extra.status === 'inprogress' && (
<Badge variant={BadgeVariant.Blue}>In Progress ...</Badge>
<Badge data-testid="index-in-progress" variant={BadgeVariant.Blue}>
In Progress ...
</Badge>
)}
{extra.status === 'failed' && (
<ErrorBadgeWithTooltip
Expand Down

0 comments on commit e184f98

Please sign in to comment.