Skip to content

Commit

Permalink
Fix the retry logic in the editLogPoint test helper (#10533)
Browse files Browse the repository at this point in the history
  • Loading branch information
hbenl authored May 16, 2024
1 parent aeea3bd commit 32cc456
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions packages/e2e-tests/helpers/source-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,24 +337,21 @@ export async function editLogPoint(
// The typeahead popup sometimes sticks around and overlaps the save button.
// Sometimes, it will show up after we check the first time (PRO-238) so we
// retry a couple times to ensure that we can clear it and move forward.
await waitFor(
async () => {
await hideTypeAheadSuggestions(page, {
sourceLineNumber: lineNumber,
type: "log-point-condition",
});
await hideTypeAheadSuggestions(page, {
sourceLineNumber: lineNumber,
type: "log-point-content",
});

const saveButton = line.locator('[data-test-name="PointPanel-SaveButton"]');
await expect(saveButton).toBeEnabled();
await saveButton.click();
await saveButton.waitFor({ state: "detached" });
},
{ timeout: 2_000 }
);
await waitFor(async () => {
await hideTypeAheadSuggestions(page, {
sourceLineNumber: lineNumber,
type: "log-point-condition",
});
await hideTypeAheadSuggestions(page, {
sourceLineNumber: lineNumber,
type: "log-point-content",
});

const saveButton = line.locator('[data-test-name="PointPanel-SaveButton"]');
await expect(saveButton).toBeEnabled();
await saveButton.click({ timeout: 1_000 });
await saveButton.waitFor({ state: "detached" });
});
}
}

Expand Down

0 comments on commit 32cc456

Please sign in to comment.