Skip to content
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 - preserving modeline after pipe config and disable step #1149

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('Tests for Design page', () => {
beforeEach(() => {
cy.openHomePage();
});

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

cy.selectDisableNode('setHeader');
cy.openStepConfigurationTab('setHeader');
cy.checkConfigCheckboxObject('disabled', true);

cy.openSourceCode();
cy.checkCodeSpanLine('disabled: true', 1);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('Tests for modeline', () => {
beforeEach(() => {
cy.openHomePage();
});

it('Preserve modeline in pipe config after pipe source was changed', () => {
cy.uploadFixture('flows/pipe/modeline.yaml');
cy.openDesignPage();

cy.removeNodeByName('https');
cy.openStepConfigurationTab('kamelet:log-sink');
cy.get(`input[name="parameters.showProperties"]`).check();

cy.openSourceCode();
cy.checkCodeSpanLine('# camel-k: dependency=camel:aws-secrets-manager', 1);
});
});
16 changes: 16 additions & 0 deletions packages/ui-tests/cypress/fixtures/flows/pipe/modeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# camel-k: dependency=camel:aws-secrets-manager

- route:
from:
uri: "kamelet:timer-source"
parameters:
period: 10000
message: 'test'
steps:
- to:
uri: "https://finnhub.io/api/v1/quote?symbol=AAPL&token={{aws:finnhub-token}}"
- to:
uri: "kamelet:log-sink"
parameters:
showStreams: true
showHeaders: true
3 changes: 2 additions & 1 deletion packages/ui-tests/cypress/support/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
export {};

declare global {
type ActionType = 'append' | 'prepend' | 'replace' | 'insert' | 'insert-special' | 'delete';
type ActionType = 'append' | 'prepend' | 'replace' | 'insert' | 'insert-special' | 'delete' | 'disable';

namespace Cypress {
interface Chainable {
Expand Down Expand Up @@ -39,6 +39,7 @@ declare global {
removeNodeByName(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
selectReplaceNode(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
selectAppendNode(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
selectDisableNode(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
selectInsertSpecialNode(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
selectInsertNode(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
selectPrependNode(inputName: string, nodeIndex?: number): Chainable<JQuery<Element>>;
Expand Down
4 changes: 4 additions & 0 deletions packages/ui-tests/cypress/support/next-commands/design.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ Cypress.Commands.add('selectAppendNode', (nodeName: string, nodeIndex?: number)
cy.performNodeAction(nodeName, 'append', nodeIndex);
});

Cypress.Commands.add('selectDisableNode', (nodeName: string, nodeIndex?: number) => {
cy.performNodeAction(nodeName, 'disable', nodeIndex);
});

Cypress.Commands.add('selectInsertNode', (nodeName: string, nodeIndex?: number) => {
cy.performNodeAction(nodeName, 'insert', nodeIndex);
});
Expand Down
Loading