mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 13:39:44 +02:00
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:
parent
57d654f972
commit
346989eda1
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user