Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Add basic set of multiflow tests #1921

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

tplevko
Copy link
Contributor

@tplevko tplevko commented Jun 6, 2023

Add basic set of multiflow tests - both for canvas and editor.

The basic tests include:
Editor - based:

  1. User deletes first route from multi-route using code editor
  2. User deletes second route from multi-route using code editor
  3. User deletes step from first route using code editor
  4. User adds step to the first route using code editor
  5. User reverts route deletion using code editor

Canvas - based:

  1. User changes route type in the canvas
  2. User shows and hides a route
  3. User deletes routes in the canvas
  4. User creates multiple routes in canvas

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #1921 (7590d9e) into main (6598915) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1921   +/-   ##
=======================================
  Coverage   59.89%   59.89%           
=======================================
  Files          76       76           
  Lines        2516     2516           
  Branches      565      565           
=======================================
  Hits         1507     1507           
  Misses        962      962           
  Partials       47       47           
Impacted Files Coverage Δ
src/components/ConfirmationModal.tsx 100.00% <ø> (ø)

@tplevko tplevko force-pushed the multiflow_tests branch 3 times, most recently from 4a72432 to 1af67b9 Compare June 6, 2023 12:20
@tplevko tplevko marked this pull request as ready for review June 6, 2023 12:47
@tplevko tplevko requested a review from a team June 6, 2023 12:47
lordrip
lordrip previously approved these changes Jun 6, 2023
Copy link
Collaborator

@lordrip lordrip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks Tomas 💪

uri: timer:test
steps:
- to:
uri: log:log2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This integration type will be slightly different from what it is now. Later on, multiple routes from the Integration type will be handled inside of the flows array but this is in the works at the backend.

Can I suggest you another fixture in the meantime? This is a multiple Camel route fixture.

- from:
    uri: cron:cron
    parameters:
      schedule: '1000'
    steps:
    - set-body:
        simple: body
    - to:
        uri: log:log1

- from:
    uri: timer:test
    steps:
    - to:
        uri: log:log2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, thanks for letting me know - will convert this to the flows once it's in the backend. Also the second fixture - I'll extend the tests and add there also camelRoute type tests, so the covered area represents all the possible route options.

.then((element) => {
cy.wrap(element).click();
});
cy.get('.pf-c-modal-box__footer').children('.pf-c-button.pf-m-primary').click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be convenient to have a better handler for the Accept button? I can add it 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob - I should have added data-test-id and will change that. Really looks "subotimal" :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ok now

@@ -64,7 +64,7 @@ Cypress.Commands.add('deleteStep', (step, stepIndex) => {
const previousStepsCount = elem.length;

/** Delete the given step */
cy.get(`[data-testid="viz-step-${step}"]`).eq(stepIndex).trigger('mouseover').children('[data-testid="configurationTab__deleteBtn"]').click({ force: true });
cy.get(`[data-testid="viz-step-${step}"]`,{withinSubject:null}).eq(stepIndex).trigger('mouseover').children('[data-testid="configurationTab__deleteBtn"]').click({ force: true });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this {withinSubject: null} ok or would be better to have a dedicated handler from the UI side?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found this is probably redundant - removed, thanks for noticing this

@tplevko tplevko force-pushed the multiflow_tests branch 3 times, most recently from 1015617 to 0b6cc4f Compare June 8, 2023 07:33
@@ -80,6 +80,7 @@ Cypress.Commands.add('openStepConfigurationTab', (step, EIP, stepIndex) => {
if (!EIP) {
cy.get('[data-testid="kaoto-right-drawer"]').should('be.visible');
}
cy.waitVisualizationUpdate();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be workarround for #1855

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I'll link your message on that issue, right now is just saying that the issue got mentioned on this pull request and I think it will come in handy to ensure that the bug was fixed.

@tplevko tplevko force-pushed the multiflow_tests branch 2 times, most recently from 5b1618f to 61e9685 Compare June 8, 2023 08:33
@tplevko tplevko force-pushed the multiflow_tests branch from 61e9685 to 7590d9e Compare June 8, 2023 09:12
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
12.9% 12.9% Duplication

@lordrip lordrip merged commit 31d4481 into kaoto-archive:main Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants