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: coverage for missing camel route config types #1195

Merged
merged 1 commit into from
Jun 24, 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,60 @@
describe('Test for errorHandler configuration container', () => {
beforeEach(() => {
cy.openHomePage();
});

it('ErrorHandler types check', () => {
cy.selectCamelRouteType('Error Handling', 'errorHandler');

cy.get('[data-id^="errorHandler"]')
.find('.pf-topology__node__label')
.find('.pf-topology__node__label__background')
.click();

cy.get('#-oneof-toggle').click();
cy.get('ul.pf-v5-c-menu__list > li:first')
.should('have.attr', 'data-testid', '-oneof-select-dropdownlist-Dead Letter Channel')
.next('li')
.should('have.attr', 'data-testid', '-oneof-select-dropdownlist-Default Error Handler')
.next('li')
.should('have.attr', 'data-testid', '-oneof-select-dropdownlist-Jta Transaction Error Handler')
.next('li')
.should('have.attr', 'data-testid', '-oneof-select-dropdownlist-No Error Handler')
.next('li')
.should('have.attr', 'data-testid', '-oneof-select-dropdownlist-Ref Error Handler')
.next('li')
.should('have.attr', 'data-testid', '-oneof-select-dropdownlist-Spring Transaction Error Handler');
});

it('Root Default error handler configuration', () => {
cy.selectCamelRouteType('Error Handling', 'errorHandler');

cy.get('[data-id^="errorHandler"]')
.find('.pf-topology__node__label')
.find('.pf-topology__node__label__background')
.click();

cy.get('#-oneof-toggle').click();
cy.get('[data-testid="-oneof-select-dropdownlist-Default Error Handler"]').click();

cy.interactWithConfigInputObject('defaultErrorHandler.executorServiceRef', 'testExecutorServiceRef');
cy.interactWithConfigInputObject('defaultErrorHandler.id', 'testId');
cy.selectInTypeaheadField('defaultErrorHandler.level', 'INFO');
cy.interactWithConfigInputObject('defaultErrorHandler.logName', 'testLogName');
cy.interactWithConfigInputObject('defaultErrorHandler.loggerRef', 'testLoggerRef');
cy.interactWithConfigInputObject('defaultErrorHandler.onExceptionOccurredRef', 'testOnExceptionOccuredRef');
cy.interactWithConfigInputObject('defaultErrorHandler.onPrepareFailureRef', 'testOnPrepareFailureRef');
cy.interactWithConfigInputObject('defaultErrorHandler.onRedeliveryRef', 'testOnRedeliveryRef');

cy.openSourceCode();
cy.checkCodeSpanLine('- errorHandler:');
cy.checkCodeSpanLine('defaultErrorHandler:');
cy.checkCodeSpanLine('executorServiceRef: testExecutorServiceRef');
cy.checkCodeSpanLine('id: testId');
cy.checkCodeSpanLine('logName: testLogName');
cy.checkCodeSpanLine('loggerRef: testLoggerRef');
cy.checkCodeSpanLine('onExceptionOccurredRef: testOnExceptionOccuredRef');
cy.checkCodeSpanLine('onPrepareFailureRef: testOnPrepareFailureRef');
cy.checkCodeSpanLine('onRedeliveryRef: testOnRedeliveryRef');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
describe('Test for interceptSendToEndpoint configuration container', () => {
beforeEach(() => {
cy.openHomePage();
});

it('Root interceptSendToEndpoint configuration', () => {
cy.selectCamelRouteType('Configuration', 'interceptSendToEndpoint');

cy.get('[data-id^="interceptSendToEndpoint"]')
.find('.pf-topology__node__label')
.find('.pf-topology__node__label__background')
.click();

cy.interactWithConfigInputObject('description', 'testDescription');
cy.interactWithConfigInputObject('skipSendToOriginalEndpoint', 'testSkipSendToOriginalEndpoint');

cy.get('#processor-advanced-expandable-section-toggle').click();
cy.interactWithConfigInputObject('afterUri', 'testAfterUri');

cy.openSourceCode();
cy.checkCodeSpanLine('- interceptSendToEndpoint:');
cy.checkCodeSpanLine('description: testDescription');
cy.checkCodeSpanLine('skipSendToOriginalEndpoint: testSkipSendToOriginalEndpoint');
cy.checkCodeSpanLine('afterUri: testAfterUri');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
describe('Test for onCompletion configuration container', () => {
beforeEach(() => {
cy.openHomePage();
});

it('Root onCompletion configuration', () => {
cy.selectCamelRouteType('Configuration', 'onCompletion');

cy.get('[data-id^="onCompletion"]')
.find('.pf-topology__node__label')
.find('.pf-topology__node__label__background')
.click();

cy.interactWithConfigInputObject('description', 'testDescription');
cy.interactWithConfigInputObject('onCompleteOnly');
cy.interactWithConfigInputObject('onFailureOnly');

cy.get('#processor-advanced-expandable-section-toggle').click();
cy.selectInTypeaheadField('mode', 'BeforeConsumer');
cy.interactWithConfigInputObject('parallelProcessing');
cy.interactWithConfigInputObject('useOriginalMessage');

cy.openSourceCode();
cy.checkCodeSpanLine('- onCompletion:');
cy.checkCodeSpanLine('description: testDescription');
cy.checkCodeSpanLine('onCompleteOnly: true');
cy.checkCodeSpanLine('onFailureOnly: true');
cy.checkCodeSpanLine('mode: BeforeConsumer');
cy.checkCodeSpanLine('parallelProcessing: true');
cy.checkCodeSpanLine('useOriginalMessage: true');
});
});
Loading