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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
323 additions
and
49 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
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.