Skip to content

Commit

Permalink
e2e struct improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko authored and lordrip committed Apr 2, 2024
1 parent 8345fae commit 738e380
Show file tree
Hide file tree
Showing 44 changed files with 80 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Test for Bean support', () => {
});

it('Beans - create a new bean using bean editor', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openBeans();
cy.get('[data-testid="metadata-add-Beans-btn"]').eq(0).click();
cy.get(`input[name="name"]`).clear().type('test');
Expand Down Expand Up @@ -40,7 +40,7 @@ describe('Test for Bean support', () => {

it('Beans - create a new bean using editor and edit in bean editor', () => {
cy.openSourceCode();
cy.uploadFixture('flows/Beans.yaml');
cy.uploadFixture('flows/camelRoute/beans.yaml');

cy.openBeans();

Expand Down Expand Up @@ -73,7 +73,7 @@ describe('Test for Bean support', () => {
});

it('Beans - delete bean properties using the bean editor', () => {
cy.uploadFixture('flows/Beans.yaml');
cy.uploadFixture('flows/camelRoute/beans.yaml');
cy.openBeans();

cy.get('[data-testid="metadata-row-0"]').click();
Expand All @@ -89,7 +89,7 @@ describe('Test for Bean support', () => {
});

it('Beans - delete bean using the bean editor', () => {
cy.uploadFixture('flows/Beans.yaml');
cy.uploadFixture('flows/camelRoute/beans.yaml');
cy.openBeans();

cy.get('[data-testid="metadata-delete-1-btn"]').click();
Expand Down
18 changes: 9 additions & 9 deletions packages/ui-tests/cypress/e2e/codeEditor/malformedFlows.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Test for Multi route actions from the code editor', () => {
// blocked ATM by https://github.com/KaotoIO/kaoto-next/issues/575
it.skip('User creates a flow with missing route ID', () => {
cy.openSourceCode();
cy.uploadFixture('flows/malformed/missingIdRoute.yaml');
cy.uploadFixture('flows/malformed/camelRoute/missingId.yaml');
cy.openDesignPage();

cy.get('span[data-testid="flows-list-route-id"]').should('contain.text', 'route-');
Expand All @@ -26,20 +26,20 @@ describe('Test for Multi route actions from the code editor', () => {
// blocked ATM by https://github.com/KaotoIO/kaoto-next/issues/683
it.skip('User creates kameletBinding with missing kind definition', () => {
cy.openSourceCode();
cy.uploadFixture('flows/malformed/missingKindKamelet.yaml');
cy.uploadFixture('flows/malformed/kamelet/missingKind.yaml');
cy.openDesignPage();

cy.checkNodeExist('timer-source', 0);
cy.checkNodeExist('kafka-sink', 0);

// verify the route wasn't removed and left for the user to repair
cy.openSourceCode();
cy.compareFileWithMonacoEditor('flows/malformed/missingKindKamelet.yaml');
cy.compareFileWithMonacoEditor('flows/malformed/kamelet/missingKind.yaml');
});

it('User creates a flow with unknown node', () => {
cy.openSourceCode();
cy.uploadFixture('flows/malformed/unknownNode.yaml');
cy.uploadFixture('flows/malformed/camelRoute/unknownNode.yaml');
cy.openDesignPage();
cy.checkNodeExist('id', 1);
cy.openStepConfigurationTab('id');
Expand All @@ -48,29 +48,29 @@ describe('Test for Multi route actions from the code editor', () => {
// Related issue to provide more info https://github.com/KaotoIO/kaoto-next/issues/309
// verify the route wasn't removed and left for the user to repair
cy.openSourceCode();
cy.compareFileWithMonacoEditor('flows/malformed/unknownNode.yaml');
cy.compareFileWithMonacoEditor('flows/malformed/camelRoute/unknownNode.yaml');
});

it('User creates a flow with wrongly indented node properties', () => {
cy.openSourceCode();
cy.uploadFixture('flows/malformed/wrongIndentPropertiesKamelet.yaml');
cy.uploadFixture('flows/malformed/kamelet/wrongIndentProperties.yaml');
cy.openDesignPage();
cy.checkNodeExist('source: Unknown', 1);

// verify the route wasn't removed and left for the user to repair
cy.openSourceCode();
cy.compareFileWithMonacoEditor('flows/malformed/wrongIndentPropertiesKamelet.yaml');
cy.compareFileWithMonacoEditor('flows/malformed/kamelet/wrongIndentProperties.yaml');
});

it('User creates a flow with wrongly indented source definition', () => {
cy.openSourceCode();
cy.uploadFixture('flows/malformed/wrongIndentSourceKamelet.yaml');
cy.uploadFixture('flows/malformed/kamelet/wrongIndentSource.yaml');
cy.openDesignPage();
cy.checkNodeExist('source: Unknown', 1);
cy.checkNodeExist('sink: Unknown', 1);

// verify the route wasn't removed and left for the user to repair
cy.openSourceCode();
cy.compareFileWithMonacoEditor('flows/malformed/wrongIndentSourceKamelet.yaml');
cy.compareFileWithMonacoEditor('flows/malformed/kamelet/wrongIndentSource.yaml');
});
});
12 changes: 6 additions & 6 deletions packages/ui-tests/cypress/e2e/codeEditor/multiFlowEditor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('Test for Multi route actions from the code editor', () => {

it('User deletes first route from multi-route using code editor', () => {
cy.openSourceCode();
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');
cy.openDesignPage();
cy.get('[data-testid="flows-list-route-count"]').should('have.text', '1/2');

Expand All @@ -18,7 +18,7 @@ describe('Test for Multi route actions from the code editor', () => {

it('User adds new route to Camel multi-route using code editor', () => {
cy.openSourceCode();
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');

const stepToInsert = `- route:
id: route-new
Expand All @@ -41,7 +41,7 @@ describe('Test for Multi route actions from the code editor', () => {
});

it('User deletes second route from multi-route using code editor', () => {
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');

cy.editorDeleteLine(11, 11);
cy.openDesignPage();
Expand All @@ -51,7 +51,7 @@ describe('Test for Multi route actions from the code editor', () => {
});

it('User deletes step from first route using code editor', () => {
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');

cy.editorDeleteLine(7, 4);
cy.openDesignPage();
Expand All @@ -61,7 +61,7 @@ describe('Test for Multi route actions from the code editor', () => {
});

it('User adds step to the first route using code editor', () => {
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');
const stepToInsert = ` - setHeader:
constant: test`;
cy.editorAddText(9, stepToInsert);
Expand All @@ -72,7 +72,7 @@ describe('Test for Multi route actions from the code editor', () => {
});

it('User adds step to the second route using code editor', () => {
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');
const stepToInsert = ` - setBody:
constant: test`;
cy.editorAddText(20, stepToInsert);
Expand Down
16 changes: 8 additions & 8 deletions packages/ui-tests/cypress/e2e/codeEditor/sourceCodeActions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Test source code editor', () => {
});

it('loads the YAML editor and deletes steps, check with visualization', () => {
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml');
cy.uploadFixture('flows/kameletBinding/kafkaSourceSink.yaml');
cy.openDesignPage();
cy.get('[data-id^="json-deserialize-action"]').should('exist');
cy.openSourceCode();
Expand All @@ -16,7 +16,7 @@ describe('Test source code editor', () => {
});

it('User adds step to the YAML', () => {
cy.uploadFixture('flows/TimerKafkaKB.yaml');
cy.uploadFixture('flows/kameletBinding/timerKafka.yaml');

const stepToInsert = ` steps:
- ref:
Expand All @@ -31,7 +31,7 @@ describe('Test source code editor', () => {
});

it('User removes step from the YAML', () => {
cy.uploadFixture('flows/TimerKafkaKB.yaml');
cy.uploadFixture('flows/kameletBinding/timerKafka.yaml');

cy.editorDeleteLine(12, 6);
cy.openDesignPage();
Expand All @@ -40,7 +40,7 @@ describe('Test source code editor', () => {
});

it('User edits step in the YAML', () => {
cy.uploadFixture('flows/TimerKafkaKB.yaml');
cy.uploadFixture('flows/kameletBinding/timerKafka.yaml');

cy.editorDeleteLine(13, 1);
const name = ` name: aws-s3-sink`;
Expand All @@ -53,7 +53,7 @@ describe('Test source code editor', () => {
});

it('User Deletes branch in the YAML', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');

cy.editorDeleteLine(41, 7);
cy.openDesignPage();
Expand All @@ -64,7 +64,7 @@ describe('Test source code editor', () => {
});

it('User Add a new branch in the YAML', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
const stepToInsert = ` - simple: {{}{{}?test}}
steps:
- to:
Expand All @@ -77,7 +77,7 @@ describe('Test source code editor', () => {
});

it('User undoes a change and redoes a change', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');

cy.editorDeleteLine(5, 7);
// click undo button => reverted automatic adjustments
Expand All @@ -98,7 +98,7 @@ describe('Test source code editor', () => {
});

it('User uploads YAML file, syncs with canvas', () => {
cy.uploadFixture('flows/TimerKafkaKB.yaml');
cy.uploadFixture('flows/kameletBinding/timerKafka.yaml');
cy.openDesignPage();

// CHECK the kafka-sink and timer-source were imported
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Tests for Design page', () => {
});

it('Design - add steps to CamelRoute', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openDesignPage();

cy.selectAppendNode('setHeader');
Expand All @@ -21,7 +21,7 @@ describe('Tests for Design page', () => {
});

it('Design - add steps to Pipe/KB', () => {
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml');
cy.uploadFixture('flows/kameletBinding/kafkaSourceSink.yaml');
cy.openDesignPage();

cy.selectAppendNode('json-deserialize-action');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Tests for Design page', () => {
});

it('Design - remove steps from CamelRoute', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openDesignPage();
cy.removeNodeByName('setHeader');
cy.removeNodeByName('log');
Expand All @@ -20,7 +20,7 @@ describe('Tests for Design page', () => {
});

it('Design - remove steps from Pipe/KB', () => {
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml');
cy.uploadFixture('flows/kameletBinding/kafkaSourceSink.yaml');
cy.openDesignPage();
cy.removeNodeByName('json-deserialize-action');
cy.removeNodeByName('kafka-source');
Expand All @@ -37,7 +37,7 @@ describe('Tests for Design page', () => {
});

it('In an integration with at least two steps, user deletes the first step, showing a placeholder step in its place (start-end)', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openDesignPage();

cy.removeNodeByName('timer');
Expand All @@ -54,7 +54,7 @@ describe('Tests for Design page', () => {
});

it('Step detail - User deletes a step, which closes the detail drawer', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openDesignPage();

cy.openStepConfigurationTab('log');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Tests for Design page', () => {
});

it('Design - replace steps in CamelRoute', () => {
cy.uploadFixture('flows/CamelRoute.yaml');
cy.uploadFixture('flows/camelRoute/basic.yaml');
cy.openDesignPage();

cy.selectReplaceNode('timer');
Expand Down Expand Up @@ -36,7 +36,7 @@ describe('Tests for Design page', () => {
});

it('Design - replace steps in Pipe/KB', () => {
cy.uploadFixture('flows/KafkaSourceSinkKB.yaml');
cy.uploadFixture('flows/kameletBinding/kafkaSourceSink.yaml');
cy.openDesignPage();

cy.selectReplaceNode('kafka-source');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('User completes normal actions on steps in a branch', () => {
});

it('User configures a step in a branch', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.openStepConfigurationTab('marshal');
Expand All @@ -18,7 +18,7 @@ describe('User completes normal actions on steps in a branch', () => {
});

it('User deletes a step in a branch', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.removeNodeByName('digitalocean');
Expand All @@ -28,7 +28,7 @@ describe('User completes normal actions on steps in a branch', () => {
});

it('User replaces a step in a branch', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.selectReplaceNode('digitalocean');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Test for Branching actions from the canvas', () => {
});

it(' User appends a branch from the canvas', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.checkNodeExist('when', 3);
Expand All @@ -18,7 +18,7 @@ describe('Test for Branching actions from the canvas', () => {
});

it('User deletes a branch from the canvas', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.checkNodeExist('when', 3);
Expand All @@ -36,7 +36,7 @@ describe('Test for Branching actions from the canvas', () => {
});

it('User inserts a branch from the canvas', () => {
cy.uploadFixture('flows/BasicKamelet.yaml');
cy.uploadFixture('flows/kamelet/basic.yaml');
cy.openDesignPage();

cy.selectAppendNode('marshal');
Expand All @@ -53,7 +53,7 @@ describe('Test for Branching actions from the canvas', () => {
});

it('User appends a step in a branch from the canvas (last in the branch)', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.checkNodeExist('setHeader', 1);
Expand All @@ -65,7 +65,7 @@ describe('Test for Branching actions from the canvas', () => {
});

it('User prepends a step in a branch from the canvas (first in the branch)', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.checkNodeExist('digitalocean', 1);
Expand All @@ -77,7 +77,7 @@ describe('Test for Branching actions from the canvas', () => {
});

it('User prepends a step to a step whose previous step contains branches', () => {
cy.uploadFixture('flows/ComplexKamelet.yaml');
cy.uploadFixture('flows/kamelet/complex.yaml');
cy.openDesignPage();

cy.checkNodeExist('filter', 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Test for Multi route actions from the canvas', () => {
});

it('User renames routes', () => {
cy.uploadFixture('flows/MultiflowCR.yaml');
cy.uploadFixture('flows/camelRoute/multiflow.yaml');
cy.openDesignPage();
cy.get('[data-testid="flows-list-route-count"]').should('have.text', '1/2');
cy.get('[data-testid="flows-list-dropdown"]').click();
Expand Down
Loading

0 comments on commit 738e380

Please sign in to comment.