test: De-flake NDV run selector linking across input and output (#39087)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
João Almeida 2026-09-23 09:47:46 +00:00 committed by GitHub
parent 346989eda1
commit 24d54e4db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 17 deletions

View File

@ -550,24 +550,26 @@ export class NodeDetailsViewPage extends BasePage {
const selector = this.inputPanel.getRunSelector();
await selector.click();
await this.getVisiblePopoverOption(value).click();
await expect(this.inputPanel.getRunSelectorInput()).toHaveValue(containsValue(value));
await this.expectInputRunSelectorValue(value);
}
async changeOutputRunSelector(value: string) {
const selector = this.outputPanel.getRunSelector();
await selector.click();
await this.getVisiblePopoverOption(value).click();
await this.expectOutputRunSelectorValue(value);
}
// Run-selector updates can land asynchronously (notably cross-panel via
// run-linking), so assert with a retrying matcher rather than reading once.
async expectInputRunSelectorValue(value: string) {
await expect(this.inputPanel.getRunSelectorInput()).toHaveValue(containsValue(value));
}
async expectOutputRunSelectorValue(value: string) {
await expect(this.outputPanel.getRunSelectorInput()).toHaveValue(containsValue(value));
}
async getInputRunSelectorValue() {
return await this.inputPanel.getRunSelectorInput().inputValue();
}
async getOutputRunSelectorValue() {
return await this.outputPanel.getRunSelectorInput().inputValue();
}
getExecuteNodeButton() {
return this.container.getByTestId('node-execute-button');
}

View File

@ -167,35 +167,35 @@ test.describe(
await n8n.ndv.ensureOutputRunLinking(true);
await n8n.ndv.inputPanel.getTbodyCell(0, 0).click();
expect(await n8n.ndv.getInputRunSelectorValue()).toContain('2 of 2 (6 items)');
expect(await n8n.ndv.getOutputRunSelectorValue()).toContain('2 of 2 (6 items)');
await n8n.ndv.expectInputRunSelectorValue('2 of 2 (6 items)');
await n8n.ndv.expectOutputRunSelectorValue('2 of 2 (6 items)');
await n8n.ndv.changeOutputRunSelector('1 of 2 (6 items)');
expect(await n8n.ndv.getInputRunSelectorValue()).toContain('1 of 2 (6 items)');
await n8n.ndv.expectInputRunSelectorValue('1 of 2 (6 items)');
await expect(n8n.ndv.inputPanel.getTbodyCell(0, 0)).toHaveText('1111');
await expect(n8n.ndv.outputPanel.getTbodyCell(0, 0)).toHaveText('1111');
await n8n.ndv.inputPanel.getTbodyCell(0, 0).click();
await n8n.ndv.changeInputRunSelector('2 of 2 (6 items)');
expect(await n8n.ndv.getOutputRunSelectorValue()).toContain('2 of 2 (6 items)');
await n8n.ndv.expectOutputRunSelectorValue('2 of 2 (6 items)');
await n8n.ndv.outputPanel.getLinkRun().click();
await n8n.ndv.inputPanel.getTbodyCell(0, 0).click();
await n8n.ndv.changeOutputRunSelector('1 of 2 (6 items)');
expect(await n8n.ndv.getInputRunSelectorValue()).toContain('2 of 2 (6 items)');
await n8n.ndv.expectInputRunSelectorValue('2 of 2 (6 items)');
await n8n.ndv.outputPanel.getLinkRun().click();
await n8n.ndv.inputPanel.getTbodyCell(0, 0).click();
expect(await n8n.ndv.getInputRunSelectorValue()).toContain('1 of 2 (6 items)');
await n8n.ndv.expectInputRunSelectorValue('1 of 2 (6 items)');
await n8n.ndv.inputPanel.toggleInputRunLinking();
await n8n.ndv.inputPanel.getTbodyCell(0, 0).click();
await n8n.ndv.changeInputRunSelector('2 of 2 (6 items)');
expect(await n8n.ndv.getOutputRunSelectorValue()).toContain('1 of 2 (6 items)');
await n8n.ndv.expectOutputRunSelectorValue('1 of 2 (6 items)');
await n8n.ndv.inputPanel.toggleInputRunLinking();
await n8n.ndv.inputPanel.getTbodyCell(0, 0).click();
expect(await n8n.ndv.getOutputRunSelectorValue()).toContain('2 of 2 (6 items)');
await n8n.ndv.expectOutputRunSelectorValue('2 of 2 (6 items)');
});
});