test(editor): Stabilize workflow history open and close in canvas page object (no-changelog) (#39086)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
João Almeida 2026-09-23 09:47:41 +00:00 committed by GitHub
parent 57d654f972
commit 346989eda1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1186,15 +1186,16 @@ export class CanvasPage extends BasePage {
await this.clickByTestId('workflow-menu-item-version-history');
await this.page.waitForURL(/\/history(?:\/|$)/);
await expect(this.getWorkflowHistoryCloseButton()).toBeVisible();
// The history list loads asynchronously. Wait for it to settle so a later
// close click is not dropped by the re-render when loading finishes.
await expect(this.page.getByTestId('workflow-history-list-item').first()).toBeVisible();
}
async closeWorkflowHistory(): Promise<void> {
await this.getWorkflowHistoryCloseButton().click();
// History still shows the workflow canvas, so canvas-ready is not enough
// to know we are back on the editor.
await this.page.waitForURL((url) => !/\/history(?:\/|$)/.test(url.pathname), {
timeout: 30_000,
});
// Don't wait on the URL here (as openWorkflowHistory does): this close is a
// client-side route change and waitForURL races the SPA router. Wait on the
// editor UI instead.
await expect(this.getWorkflowHistoryCloseButton()).toBeHidden();
await expect(this.page.getByTestId('workflow-menu')).toBeVisible();
}