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.
chore(e2e): extend add/replace/remove node in canvas
- Loading branch information
Showing
6 changed files
with
212 additions
and
23 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,56 @@ | ||
describe('Tests for Design page', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Design - add steps to CamelRoute', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.selectAppendNode('setHeader'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('as2'); | ||
cy.get('#as2').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('as2', 1); | ||
|
||
cy.selectPrependNode('setHeader'); | ||
cy.get('[data-testid="model-catalog-tab"]').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('log'); | ||
cy.get('#log').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('log', 1); | ||
|
||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('uri: as2', 1); | ||
cy.checkCodeSpanLine('log', 1); | ||
}); | ||
|
||
it('Design - add steps to Pipe/KB', () => { | ||
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.selectAppendNode('json-deserialize-action'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('log-action'); | ||
cy.get('#log-action').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('log-action', 1); | ||
|
||
cy.selectPrependNode('json-deserialize-action'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('string-template-action'); | ||
cy.get('#string-template-action').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('string-template-action', 1); | ||
|
||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('log-action', 1); | ||
cy.checkCodeSpanLine('string-template-action', 1); | ||
}); | ||
}); |
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,38 @@ | ||
describe('Tests for Design page', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Design - remove steps from CamelRoute', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
cy.removeNodeByName('setHeader'); | ||
cy.removeNodeByName('log'); | ||
cy.removeNodeByName('timer'); | ||
cy.checkNodeExist('from: Unknown', 1); | ||
|
||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('uri: timer:test', 0); | ||
cy.checkCodeSpanLine('setHeader', 0); | ||
cy.checkCodeSpanLine('constant: test', 0); | ||
cy.checkCodeSpanLine('name: test', 0); | ||
cy.checkCodeSpanLine('uri: log:test', 0); | ||
}); | ||
|
||
it('Design - remove steps from Pipe/KB', () => { | ||
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml'); | ||
cy.openDesignPage(); | ||
cy.removeNodeByName('json-deserialize-action'); | ||
cy.removeNodeByName('kafka-source'); | ||
cy.removeNodeByName('kafka-sink'); | ||
cy.checkNodeExist('source: Unknown', 1); | ||
cy.checkNodeExist('sink: Unknown', 1); | ||
|
||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('json-deserialize-action', 0); | ||
cy.checkCodeSpanLine('kafka-source', 0); | ||
cy.checkCodeSpanLine('kafka-sink', 0); | ||
cy.checkCodeSpanLine('source: {}', 1); | ||
cy.checkCodeSpanLine('sink: {}', 1); | ||
}); | ||
}); |
87 changes: 87 additions & 0 deletions
87
packages/ui-tests/cypress/e2e/designer/stepReplacement.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,87 @@ | ||
describe('Tests for Design page', () => { | ||
beforeEach(() => { | ||
cy.openHomePage(); | ||
}); | ||
|
||
it('Design - remove steps from CamelRoute', () => { | ||
cy.uploadFixture('flows/CamelRoute.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.selectReplaceNode('timer'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('aws s3 storage service'); | ||
cy.get('#aws2-s3').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('aws2-s3', 1); | ||
cy.checkNodeExist('timer', 0); | ||
|
||
cy.selectReplaceNode('setHeader'); | ||
cy.get('[data-testid="model-catalog-tab"]').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('setBody'); | ||
cy.get('#setBody').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('setBody', 1); | ||
cy.checkNodeExist('setHeader', 0); | ||
|
||
cy.selectReplaceNode('log'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('dropbox'); | ||
cy.get('#dropbox').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('dropbox', 1); | ||
cy.checkNodeExist('log', 0); | ||
|
||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('uri: timer', 0); | ||
cy.checkCodeSpanLine('setHeader', 0); | ||
cy.checkCodeSpanLine('constant: test', 0); | ||
cy.checkCodeSpanLine('name: test', 0); | ||
cy.checkCodeSpanLine('uri: aws2-s3', 1); | ||
cy.checkCodeSpanLine('setBody', 1); | ||
cy.checkCodeSpanLine('uri: dropbox', 1); | ||
}); | ||
|
||
it('Design - remove steps from Pipe/KB', () => { | ||
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml'); | ||
cy.openDesignPage(); | ||
|
||
cy.selectReplaceNode('kafka-source'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('aws-s3-cdc-source'); | ||
cy.get('#aws-s3-cdc-source').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('aws-s3-cdc-source', 1); | ||
cy.checkNodeExist('kafka-source', 0); | ||
|
||
cy.selectReplaceNode('json-deserialize-action'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('log action'); | ||
cy.get('#log-action').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('log-action', 1); | ||
cy.checkNodeExist('json-deserialize-action', 0); | ||
|
||
cy.selectReplaceNode('kafka-sink'); | ||
cy.get('.pf-v5-c-text-input-group__text-input').click(); | ||
cy.get('.pf-v5-c-text-input-group__text-input').type('dropbox sink'); | ||
cy.get('#dropbox-sink').should('be.visible').click(); | ||
// wait for the canvas rerender | ||
cy.wait(1000); | ||
cy.checkNodeExist('dropbox-sink', 1); | ||
cy.checkNodeExist('kafka-sink', 0); | ||
|
||
cy.openSourceCode(); | ||
cy.checkCodeSpanLine('json-deserialize-action', 0); | ||
cy.checkCodeSpanLine('kafka-source', 0); | ||
cy.checkCodeSpanLine('kafka-sink', 0); | ||
cy.checkCodeSpanLine('aws-s3-cdc-source', 1); | ||
cy.checkCodeSpanLine('log-action', 1); | ||
cy.checkCodeSpanLine('dropbox-sink', 1); | ||
}); | ||
}); |
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