This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Add basic set of multiflow tests #1921
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
describe('Test for Multi route actions from the canvas', () => { | ||
beforeEach(() => { | ||
cy.intercept('/v1/deployments*').as('getDeployments'); | ||
cy.intercept('/v1/steps/id/*').as('getStepDetails'); | ||
cy.intercept('/v1/integrations/dsls').as('getDSLs'); | ||
cy.intercept('/v1/view-definitions').as('getViewDefinitions'); | ||
cy.intercept('POST', '/v2/integrations*').as('getIntegration'); | ||
|
||
cy.openHomePage(); | ||
cy.zoomOutXTimes(3); | ||
}); | ||
|
||
it('User changes route type in the canvas', () => { | ||
cy.switchIntegrationType('Integration'); | ||
cy.get('.pf-c-chip__text').contains('Integration'); | ||
cy.switchIntegrationType('Camel Route'); | ||
cy.get('.pf-c-chip__text').contains('Camel Route'); | ||
cy.switchIntegrationType('Kamelet'); | ||
cy.get('.pf-c-chip__text').contains('Kamelet'); | ||
cy.switchIntegrationType('KameletBinding'); | ||
cy.get('.pf-c-chip__text').contains('KameletBinding'); | ||
}); | ||
|
||
it('User shows and hides a route', () => { | ||
cy.switchIntegrationType('Integration'); | ||
cy.createNewRoute(); | ||
cy.createNewRoute(); | ||
|
||
cy.toggleRouteVisibility(0); | ||
cy.toggleRouteVisibility(1); | ||
|
||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 3); | ||
|
||
cy.toggleRouteVisibility(0); | ||
cy.toggleRouteVisibility(1); | ||
cy.toggleRouteVisibility(2); | ||
|
||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 0); | ||
}); | ||
|
||
it('User deletes routes in the canvas', () => { | ||
cy.switchIntegrationType('Integration'); | ||
cy.createNewRoute(); | ||
cy.createNewRoute(); | ||
cy.showAllRoutes(); | ||
|
||
cy.deleteRoute(0); | ||
cy.deleteRoute(0); | ||
cy.deleteRoute(0); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 0); | ||
}); | ||
|
||
it('User creates multiple routes in canvas', () => { | ||
cy.switchIntegrationType('Integration'); | ||
cy.createNewRoute(); | ||
cy.createNewRoute(); | ||
|
||
cy.hideAllRoutes(); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 0); | ||
cy.toggleRouteVisibility(0); | ||
|
||
cy.replaceEmptyStepMiniCatalog('timer'); | ||
cy.appendStepMiniCatalog('timer', 'log'); | ||
cy.hideAllRoutes(); | ||
|
||
cy.toggleRouteVisibility(1); | ||
cy.replaceEmptyStepMiniCatalog('timer'); | ||
cy.appendStepMiniCatalog('timer', 'log'); | ||
cy.hideAllRoutes(); | ||
|
||
cy.toggleRouteVisibility(2); | ||
cy.replaceEmptyStepMiniCatalog('timer'); | ||
cy.appendStepMiniCatalog('timer', 'log'); | ||
|
||
cy.showAllRoutes(); | ||
cy.get('[data-testid="viz-step-timer"]').should('have.length', 3); | ||
cy.get('[data-testid="viz-step-log"]').should('have.length', 3); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 3); | ||
}); | ||
}); |
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,79 @@ | ||
describe('Test for Multi route actions from the code editor', () => { | ||
beforeEach(() => { | ||
cy.intercept('/v1/deployments*').as('getDeployments'); | ||
cy.intercept('/v1/steps/id/*').as('getStepDetails'); | ||
cy.intercept('/v1/integrations/dsls').as('getDSLs'); | ||
cy.intercept('/v1/view-definitions').as('getViewDefinitions'); | ||
cy.intercept('POST', '/v2/integrations*').as('getIntegration'); | ||
|
||
cy.openHomePage(); | ||
cy.uploadFixture('IntegrationMultiFlow.yaml'); | ||
|
||
cy.zoomOutXTimes(3); | ||
}); | ||
|
||
it('User deletes first route from multi-route using code editor', () => { | ||
cy.editorDeleteLine(0, 15); | ||
cy.syncUpCodeChanges(); | ||
|
||
cy.showAllRoutes(); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 1); | ||
}); | ||
|
||
it('User deletes second route from multi-route using code editor', () => { | ||
cy.editorDeleteLine(15, 12); | ||
cy.syncUpCodeChanges(); | ||
|
||
cy.showAllRoutes(); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 1); | ||
}); | ||
|
||
it('User deletes step from first route using code editor', () => { | ||
cy.editorDeleteLine(11, 2); | ||
cy.syncUpCodeChanges(); | ||
|
||
cy.showAllRoutes(); | ||
cy.get('[data-testid="viz-step-set-body"]').should('not.exist'); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 2); | ||
}); | ||
|
||
it('User adds step to the first route using code editor', () => { | ||
const stepToInsert = ` - set-header: | ||
constant: test`; | ||
const insertLine = 11; | ||
cy.editorAddText(insertLine, stepToInsert); | ||
cy.syncUpCodeChanges(); | ||
|
||
// CHECK the set-header step was added | ||
cy.get('[data-testid="viz-step-set-header"]').should('be.visible'); | ||
}); | ||
|
||
// Blocked by - https://github.com/KaotoIO/kaoto-ui/issues/1910 | ||
it.skip('User adds step to the second route using code editor', () => { | ||
cy.showAllRoutes(); | ||
const stepToInsert = ` - set-body: | ||
constant: test`; | ||
const insertLine = 25; | ||
cy.editorAddText(insertLine, stepToInsert); | ||
cy.syncUpCodeChanges(); | ||
// CHECK the insert-field-action step was added | ||
cy.get('[data-testid="viz-step-set-body"]').should('be.visible'); | ||
}); | ||
|
||
it('User reverts route deletion using code editor', () => { | ||
cy.editorDeleteLine(15, 12); | ||
cy.syncUpCodeChanges(); | ||
|
||
cy.showAllRoutes(); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 1); | ||
|
||
// First click undo button => reverted automatic adjustments | ||
cy.editorClickUndoXTimes(); | ||
// Second click undo button => changes reverted & alert is displayed | ||
cy.editorClickUndoXTimes(); | ||
cy.syncUpCodeChanges(); | ||
|
||
cy.showAllRoutes(); | ||
cy.get('[data-testid^="rf__node-node_0"]').should('have.length', 2); | ||
}); | ||
}); |
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,27 @@ | ||
apiVersion: camel.apache.org/v1 | ||
kind: Integration | ||
metadata: | ||
name: '' | ||
spec: | ||
flows: | ||
- from: | ||
uri: cron:cron | ||
parameters: | ||
schedule: '1000' | ||
steps: | ||
- set-body: | ||
simple: body | ||
- to: | ||
uri: log:log1 | ||
--- | ||
apiVersion: camel.apache.org/v1 | ||
kind: Integration | ||
metadata: | ||
name: '' | ||
spec: | ||
flows: | ||
- from: | ||
uri: timer:test | ||
steps: | ||
- to: | ||
uri: log:log2 | ||
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.
This integration type will be slightly different from what it is now. Later on, multiple routes from the
Integration
type will be handled inside of theflows
array but this is in the works at the backend.Can I suggest you another fixture in the meantime? This is a multiple Camel route fixture.
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.
sure, thanks for letting me know - will convert this to the
flows
once it's in the backend. Also the second fixture - I'll extend the tests and add there also camelRoute type tests, so the covered area represents all the possible route options.