diff --git a/cypress/e2e/24-ndv-paired-item.cy.ts b/cypress/e2e/24-ndv-paired-item.cy.ts index 133cc808bb626..05f5dd8581a71 100644 --- a/cypress/e2e/24-ndv-paired-item.cy.ts +++ b/cypress/e2e/24-ndv-paired-item.cy.ts @@ -103,20 +103,33 @@ describe('NDV', () => { ndv.actions.switchInputMode('Table'); ndv.actions.switchOutputMode('Table'); - cy.wait(50); ndv.getters.backToCanvas().realHover(); // reset to default hover ndv.getters.outputHoveringItem().should('not.exist'); ndv.getters.parameterExpressionPreview('value').should('include.text', '1111'); ndv.actions.selectInputNode('Set1'); - ndv.getters.inputHoveringItem().should('have.text', '1000').realHover(); + ndv.getters.backToCanvas().realHover(); // reset to default hover + + ndv.getters.inputTableRow(1) + .should('have.text', '1000') + .invoke('attr', 'data-test-id') + .should('equal', 'hovering-item'); + ndv.getters.inputTableRow(1).realHover(); + cy.wait(50); ndv.getters.outputHoveringItem().should('have.text', '1000'); ndv.getters.parameterExpressionPreview('value').should('include.text', '1000'); ndv.actions.selectInputNode('Item Lists'); ndv.actions.changeOutputRunSelector('1 of 2 (6 items)'); - ndv.getters.inputHoveringItem().should('have.text', '1111').realHover(); + ndv.getters.backToCanvas().realHover(); // reset to default hover + + ndv.getters.inputTableRow(1) + .should('have.text', '1111') + .invoke('attr', 'data-test-id') + .should('equal', 'hovering-item'); + ndv.getters.inputTableRow(1).realHover(); + cy.wait(50); ndv.getters.outputHoveringItem().should('have.text', '1111'); ndv.getters.parameterExpressionPreview('value').should('include.text', '1111'); }); @@ -200,7 +213,11 @@ describe('NDV', () => { ndv.actions.switchOutputMode('Table'); ndv.getters.backToCanvas().realHover(); // reset to default hover - ndv.getters.inputHoveringItem().should('have.text', '1111').realHover(); + ndv.getters.inputTableRow(1) + .should('have.text', '1111') + .invoke('attr', 'data-test-id') + .should('equal', 'hovering-item'); + ndv.getters.inputTableRow(1).realHover(); ndv.getters.outputHoveringItem().should('not.exist'); ndv.getters.parameterExpressionPreview('value').should('include.text', '1111'); diff --git a/cypress/e2e/5-ndv.cy.ts b/cypress/e2e/5-ndv.cy.ts index c9c82e50fac11..749fb4434e506 100644 --- a/cypress/e2e/5-ndv.cy.ts +++ b/cypress/e2e/5-ndv.cy.ts @@ -163,5 +163,68 @@ describe('NDV', () => { ndv.getters.outputPanel().find('[class*=_pagination]').should('not.exist'); ndv.getters.outputPanel().find('[data-test-id=run-data-schema-item] [data-test-id=run-data-schema-item]').should('have.length', 20); }) - }) + }); + + it('can link and unlink run selectors between input and output', () => { + cy.createFixtureWorkflow('Test_workflow_5.json', 'Test'); + workflowPage.actions.zoomToFit(); + workflowPage.actions.executeWorkflow(); + workflowPage.actions.openNode('Set3'); + + ndv.getters.inputRunSelector() + .should('exist') + .find('input') + .should('include.value', '2 of 2 (6 items)'); + ndv.getters.outputRunSelector() + .should('exist') + .find('input') + .should('include.value', '2 of 2 (6 items)'); + + ndv.actions.switchInputMode('Table'); + ndv.actions.switchOutputMode('Table'); + + ndv.actions.changeOutputRunSelector('1 of 2 (6 items)'); + ndv.getters.inputRunSelector() + .find('input') + .should('include.value', '1 of 2 (6 items)'); + ndv.getters.inputTbodyCell(1, 0).should('have.text', '1111'); + ndv.getters.outputTbodyCell(1, 0).should('have.text', '1111'); + + ndv.getters.inputTbodyCell(1, 0).click(); // remove tooltip + ndv.actions.changeInputRunSelector('2 of 2 (6 items)'); + ndv.getters.outputRunSelector() + .find('input') + .should('include.value', '2 of 2 (6 items)'); + + // unlink + ndv.actions.toggleOutputRunLinking(); + ndv.getters.inputTbodyCell(1, 0).click(); // remove tooltip + ndv.actions.changeOutputRunSelector('1 of 2 (6 items)'); + ndv.getters.inputRunSelector() + .should('exist') + .find('input') + .should('include.value', '2 of 2 (6 items)'); + + // link again + ndv.actions.toggleOutputRunLinking(); + ndv.getters.inputTbodyCell(1, 0).click(); // remove tooltip + ndv.getters.inputRunSelector() + .find('input') + .should('include.value', '1 of 2 (6 items)'); + + // unlink again + ndv.actions.toggleInputRunLinking(); + ndv.getters.inputTbodyCell(1, 0).click(); // remove tooltip + ndv.actions.changeInputRunSelector('2 of 2 (6 items)'); + ndv.getters.outputRunSelector() + .find('input') + .should('include.value', '1 of 2 (6 items)'); + + // link again + ndv.actions.toggleInputRunLinking(); + ndv.getters.inputTbodyCell(1, 0).click(); // remove tooltip + ndv.getters.outputRunSelector() + .find('input') + .should('include.value', '2 of 2 (6 items)'); + }); });