Skip to content

Commit

Permalink
e2e: coverage for missing camel route config types
Browse files Browse the repository at this point in the history
  • Loading branch information
tplevko authored and lordrip committed Jun 24, 2024
1 parent 482ea1d commit 8c1df55
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 0 deletions.
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');
});
});

0 comments on commit 8c1df55

Please sign in to comment.