-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e - add missing tests for special form fields #912
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, better to have the
skip
so we can know how many tests we have under this condition 💪