Skip to content

Commit

Permalink
try to fix e2e again
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Sep 26, 2023
1 parent 7d92738 commit 1fd208f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe('OHIF Measurement Panel', function () {
it('checks if measurement item can be Relabeled under Measurements panel', function () {
// Add length measurement
cy.addLengthMeasurement();

cy.get('[data-cy="viewport-notification"]').as('viewportNotification').should('exist');
cy.get('[data-cy="viewport-notification"]').as('viewportNotification').should('be.visible');

Expand Down
11 changes: 5 additions & 6 deletions platform/app/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Cypress.Commands.add('drag', { prevSubject: 'element' }, (...args) =>
*/
Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => {
const performClick = (alias, x, y) => {
cy.get(alias).as(`axu-${alias}`).click(x, y, { force: true, multiple: true }).wait(250);
cy.get(alias).as(`axu-${alias}`).click(x, y, { force: true, multiple: true }).wait(1000);
};

cy.get(viewport).as('viewportAlias');
Expand All @@ -155,11 +155,10 @@ Cypress.Commands.add('addLine', (viewport, firstClick, secondClick) => {
// First click
performClick('@viewportAlias', x1, y1);

// Move the mouse
cy.get('@viewportAlias').trigger('mousemove', { clientX: x2, clientY: y2 }).wait(250);

// Second click
performClick('@viewportAlias', x2, y2);

cy.wait(1000);
});

/**
Expand Down Expand Up @@ -281,7 +280,7 @@ Cypress.Commands.add(

cy.get('@lengthButton').should('have.class', 'active');

cy.addLine('.viewport-element', firstClick, secondClick);
cy.addLine('.cornerstone-canvas', firstClick, secondClick);
}
);

Expand All @@ -292,7 +291,7 @@ Cypress.Commands.add(
cy.get('[data-cy="MeasurementTools-split-button-secondary"]').click();
cy.get('[data-cy="Angle"]').click();

cy.addAngle('.viewport-element', initPos, midPos, finalPos);
cy.addAngle('.cornerstone-canvas', initPos, midPos, finalPos);
}
);

Expand Down

0 comments on commit 1fd208f

Please sign in to comment.