fix(editor): Testing flaky resource mapper feature in e2e tests (#7165)

This commit is contained in:
Milorad FIlipović
2023-09-14 10:54:25 +02:00
committed by GitHub
parent 0c6169ee22
commit aaf87c3edd
7 changed files with 86 additions and 58 deletions

View File

@@ -17,7 +17,7 @@ describe('Resource Mapper', () => {
.resourceMapperFieldsContainer()
.should('be.visible')
.findChildByTestId('parameter-input')
.should('have.length', 2);
.should('have.length', 3);
ndv.actions.setInvalidExpression('fieldId');
@@ -34,7 +34,7 @@ describe('Resource Mapper', () => {
.resourceMapperFieldsContainer()
.should('be.visible')
.findChildByTestId('parameter-input')
.should('have.length', 2);
.should('have.length', 3);
ndv.actions.setInvalidExpression('otherField');
@@ -43,6 +43,53 @@ describe('Resource Mapper', () => {
.resourceMapperFieldsContainer()
.should('be.visible')
.findChildByTestId('parameter-input')
.should('have.length', 2);
.should('have.length', 3);
});
it('should correctly delete single field', () => {
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {
action: 'Resource Mapping Component',
});
ndv.getters.parameterInput('id').type('001');
ndv.getters.parameterInput('name').type('John');
ndv.getters.parameterInput('age').type('30');
ndv.getters.nodeExecuteButton().click();
ndv.getters.outputTableHeaderByText('id').should('exist');
ndv.getters.outputTableHeaderByText('name').should('exist');
ndv.getters.outputTableHeaderByText('age').should('exist');
// Remove the 'name' field
ndv.getters.resourceMapperRemoveFieldButton('name').should('exist').click({ force: true });
ndv.getters.nodeExecuteButton().click();
ndv.getters.parameterInput('id').should('exist');
ndv.getters.outputTableHeaderByText('id').should('exist');
// After removing the field, text field and the output table column for the 'name' should not be there anymore
ndv.getters.parameterInput('age').should('exist');
ndv.getters.outputTableHeaderByText('age').should('exist');
ndv.getters.parameterInput('name').should('not.exist');
ndv.getters.outputTableHeaderByText('name').should('not.exist');
});
it('should correctly delete all fields', () => {
workflowPage.actions.addInitialNodeToCanvas('E2e Test', {
action: 'Resource Mapping Component',
});
ndv.getters.parameterInput('id').type('001');
ndv.getters.parameterInput('name').type('John');
ndv.getters.parameterInput('age').type('30');
ndv.getters.nodeExecuteButton().click();
ndv.getters.outputTableHeaderByText('id').should('exist');
ndv.getters.outputTableHeaderByText('name').should('exist');
ndv.getters.outputTableHeaderByText('age').should('exist');
ndv.getters.resourceMapperColumnsOptionsButton().click();
// Click on the 'Remove All Fields' option
ndv.getters.resourceMapperRemoveAllFieldsOption().should('be.visible').click();
ndv.getters.nodeExecuteButton().click();
ndv.getters.parameterInput('id').should('exist');
ndv.getters.outputTableHeaderByText('id').should('exist');
// After removing the all fields, only required one should be in UI and output table
ndv.getters.parameterInput('name').should('not.exist');
ndv.getters.outputTableHeaderByText('name').should('not.exist');
ndv.getters.parameterInput('age').should('not.exist');
ndv.getters.outputTableHeaderByText('age').should('not.exist');
});
});