forked from KaotoIO/kaoto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e - add missing tests for special form fields
- Loading branch information
Showing
16 changed files
with
340 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/dataFormatStepConfig.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
describe('Tests for sidebar dataformat configuration', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Design - sidebar dataformat configuration', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
|
||
// Configure marshal dataformat | ||
cy.openStepConfigurationTab('marshal'); | ||
cy.selectDataformat('Base64'); | ||
cy.interactWithDataformatInputObject('lineLength', '128'); | ||
cy.interactWithDataformatInputObject('id', 'simpleDataformatId'); | ||
cy.interactWithDataformatInputObject('lineSeparator', 'simpleLineSeparator'); | ||
cy.interactWithDataformatInputObject('urlSafe'); | ||
|
||
// CHECK they are reflected in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('lineLength: "128"', 1); | ||
cy.checkCodeSpanLine('id: simpleDataformatId', 1); | ||
cy.checkCodeSpanLine('lineSeparator: simpleLineSeparator', 1); | ||
cy.checkCodeSpanLine('urlSafe: true', 1); | ||
}); | ||
|
||
it('Design - sidebar dataformat configuration in Kamelet', () => { | ||
cy.uploadFixture('flows/BasicKamelet.yaml'); | ||
cy.openDesignPage(); | ||
|
||
// Configure marshal dataformat | ||
cy.openStepConfigurationTab('marshal'); | ||
cy.selectDataformat('Avro'); | ||
cy.configureDropdownValue('library', 'Jackson'); | ||
cy.interactWithDataformatInputObject('unmarshalType', 'com.fasterxml.jackson.databind.JsonNode'); | ||
cy.interactWithDataformatInputObject('schemaResolver', '#bean:{{}{{}schemaResolver}}'); | ||
// CHECK they are reflected in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('library: Jackson', 1); | ||
cy.checkCodeSpanLine('unmarshalType: com.fasterxml.jackson.databind.JsonNode', 1); | ||
cy.checkCodeSpanLine('schemaResolver: "#bean:{{schemaResolver}}"', 1); | ||
|
||
// Blocked by https://github.com/KaotoIO/kaoto-next/issues/489 | ||
// cy.checkCodeSpanLine('camel:jackson-avro', 1); | ||
}); | ||
}); |
113 changes: 113 additions & 0 deletions
113
packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/expressionStepConfig.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
describe('Tests for sidebar expression configuration', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Design - sidebar expression configuration', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
// Configure setHeader expression | ||
cy.openStepConfigurationTab('setHeader'); | ||
cy.openExpressionModal(); | ||
cy.selectExpression('Simple'); | ||
cy.interactWithExpressinInputObject('expression', `{{}{{}header.baz}}`); | ||
cy.interactWithExpressinInputObject('id', 'simpleExpressionId'); | ||
cy.interactWithExpressinInputObject('resultType', 'java.lang.String'); | ||
cy.confirmExpressionModal(); | ||
|
||
// CHECK they are reflected in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('expression: "{{header.baz}}"', 1); | ||
cy.checkCodeSpanLine('id: simpleExpressionId', 1); | ||
cy.checkCodeSpanLine('resultType: java.lang.String', 1); | ||
}); | ||
|
||
//reproducer for https://github.com/KaotoIO/kaoto-next/issues/518 | ||
it('Design - name attribute was sometimes lost after expression configuration', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.openStepConfigurationTab('setHeader'); | ||
cy.openExpressionModal(); | ||
cy.selectExpression('JQ'); | ||
cy.interactWithConfigInputObject('expression', '.id'); | ||
cy.interactWithConfigInputObject('resultType', 'java.lang.String'); | ||
cy.interactWithConfigInputObject('trim'); | ||
cy.confirmExpressionModal(); | ||
|
||
cy.selectAppendNode('setHeader'); | ||
cy.chooseFromCatalog('processor', 'setHeader'); | ||
|
||
cy.checkNodeExist('setHeader', 2); | ||
|
||
cy.openStepConfigurationTab('setHeader', 1); | ||
cy.openExpressionModal(); | ||
cy.selectExpression('JQ'); | ||
cy.interactWithConfigInputObject('expression', '.name'); | ||
cy.interactWithConfigInputObject('resultType', 'java.lang.String'); | ||
cy.interactWithConfigInputObject('trim'); | ||
cy.confirmExpressionModal(); | ||
|
||
cy.openStepConfigurationTab('setHeader', 0); | ||
|
||
// Check the configured fields didn't disappear from the first node | ||
cy.openExpressionModal(); | ||
cy.checkConfigCheckboxObject('trim', true); | ||
cy.checkConfigInputObject('resultType', 'java.lang.String'); | ||
cy.checkConfigInputObject('expression', '.id'); | ||
cy.cancelExpressionModal(); | ||
|
||
// Check the configured fields didn't disappear from the second node | ||
cy.openStepConfigurationTab('setHeader', 0); | ||
cy.openExpressionModal(); | ||
cy.checkConfigCheckboxObject('trim', true); | ||
cy.checkConfigInputObject('resultType', 'java.lang.String'); | ||
cy.checkConfigInputObject('expression', '.name'); | ||
cy.cancelExpressionModal(); | ||
|
||
// CHECK they are reflected in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('expression: .id', 1); | ||
cy.checkCodeSpanLine('expression: .name', 1); | ||
}); | ||
|
||
// Blocked by: https://github.com/KaotoIO/kaoto-next/issues/904 | ||
it.skip('Design - expression configuration with switching type', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
// Configure setHeader expression | ||
cy.openStepConfigurationTab('setHeader'); | ||
cy.openExpressionModal(); | ||
cy.selectExpression('Simple'); | ||
cy.interactWithExpressinInputObject('expression', `{{}{{}header.baz}}`); | ||
cy.interactWithExpressinInputObject('id', 'simpleExpressionId'); | ||
cy.interactWithExpressinInputObject('resultType', 'java.lang.String'); | ||
cy.selectExpression('Constant'); | ||
cy.confirmExpressionModal(); | ||
|
||
// CHECK they are reflected in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('expression: "{{header.baz}}"', 1); | ||
cy.checkCodeSpanLine('id: constantExpressionId', 1); | ||
cy.checkCodeSpanLine('resultType: java.lang.String', 1); | ||
}); | ||
|
||
it('Design - sidebar expression configuration in Kamelet', () => { | ||
cy.uploadFixture('flows/BasicKamelet.yaml'); | ||
cy.openDesignPage(); | ||
// Configure setBody expression | ||
cy.openStepConfigurationTab('setBody'); | ||
cy.openExpressionModal(); | ||
cy.selectExpression('Simple'); | ||
cy.interactWithExpressinInputObject('expression', `{{}{{}body.baz}}`); | ||
cy.interactWithExpressinInputObject('id', 'simpleExpressionId'); | ||
cy.interactWithExpressinInputObject('resultType', 'java.lang.String'); | ||
cy.confirmExpressionModal(); | ||
|
||
// CHECK they are reflected in the code editor | ||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('expression: "{{body.baz}}"', 1); | ||
cy.checkCodeSpanLine('id: simpleExpressionId', 1); | ||
cy.checkCodeSpanLine('resultType: java.lang.String', 1); | ||
}); | ||
}); |
52 changes: 52 additions & 0 deletions
52
packages/ui-tests/cypress/e2e/designer/specialStepConfiguration/loadBalancerConfig.cy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
describe('Tests for sidebar loadBalancer step configuration', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Design - sidebar loadBalancer configuration in CR', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.selectAppendNode('marshal'); | ||
cy.chooseFromCatalog('processor', 'loadBalance'); | ||
cy.openStepConfigurationTab('loadBalance'); | ||
|
||
cy.get('[data-testid="loadbalancer-config-card"] button').click(); | ||
cy.get('[data-testid="loadbalancer-dropdownitem-roundRobin"] button').click(); | ||
|
||
cy.get('[data-testid="metadata-editor-form-loadbalancer"]') | ||
.find('input[data-testid="text-field"]') | ||
.type('roundRobinId'); | ||
|
||
cy.get(`input[name="id"]`).eq(1).clear().type('testId'); | ||
cy.get(`input[name="description"]`).clear().type('loadBalancerDescription'); | ||
cy.get(`input[name="inheritErrorHandler"]`).check(); | ||
cy.closeStepConfigurationTab(); | ||
|
||
cy.selectInsertNode('loadBalancerDescription'); | ||
cy.chooseFromCatalog('component', 'log'); | ||
|
||
cy.selectInsertNode('loadBalancerDescription'); | ||
cy.chooseFromCatalog('component', 'log'); | ||
|
||
const loadBalanceConfig = [ | ||
'- loadBalance:', | ||
'steps:', | ||
'- to:', | ||
'parameters: {}', | ||
'uri: log', | ||
'- to:', | ||
'parameters: {}', | ||
'uri: log', | ||
'description: loadBalancerDescription', | ||
'inheritErrorHandler: true', | ||
'id: testId', | ||
'roundRobin:', | ||
'id: roundRobinId', | ||
]; | ||
|
||
cy.openSourceCode(); | ||
// CHECK changes are reflected in the code editor | ||
cy.checkMultiLineContent(loadBalanceConfig); | ||
}); | ||
}); |
Oops, something went wrong.