diff --git a/apps/datahub-e2e/src/support/commands.ts b/apps/datahub-e2e/src/support/commands.ts index 0f1151b769..38595569a8 100644 --- a/apps/datahub-e2e/src/support/commands.ts +++ b/apps/datahub-e2e/src/support/commands.ts @@ -76,7 +76,9 @@ Cypress.Commands.add( { prevSubject: true }, (dropdownElement) => { cy.get('body').click() // first click on the document to close other dropdowns - cy.wrap(dropdownElement).click('right') // click on the right size to avoid the label + const width = dropdownElement.width() + const height = dropdownElement.height() + cy.wrap(dropdownElement).click(width - 10, height / 2) // click on the right size to avoid the label return cy.get('.cdk-overlay-container').find('[role=listbox]') } )