From b4054a2337f2cfb2f875958434132891ed906904 Mon Sep 17 00:00:00 2001 From: martinkrulltott Date: Tue, 20 Jun 2023 14:34:09 +0200 Subject: [PATCH 1/2] test: extend timeout after delete has been triggered --- cypress/elements/dimensionModal/dataDimension.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/elements/dimensionModal/dataDimension.js b/cypress/elements/dimensionModal/dataDimension.js index ed3915cbff..3c721fbdbb 100644 --- a/cypress/elements/dimensionModal/dataDimension.js +++ b/cypress/elements/dimensionModal/dataDimension.js @@ -1,4 +1,5 @@ import { DIMENSION_ID_DATA } from '@dhis2/analytics' +import { EXTENDED_TIMEOUT } from '../../support/utils.js' import { clearInput, typeInput } from '../common.js' import { expectDimensionModalToBeVisible, @@ -39,7 +40,9 @@ export const expectDataDimensionModalToBeVisible = () => expectDimensionModalToBeVisible(DIMENSION_ID_DATA) export const expectNoDataItemsToBeSelected = () => - cy.getBySel(selectedItemsEl).should('contain', 'No items selected') + cy + .getBySel(selectedItemsEl, EXTENDED_TIMEOUT) + .should('contain', 'No items selected') export const expectDataDimensionModalWarningToContain = (text) => cy.getBySel(rightHeaderEl).should('contain', text) From aab5c6dfe3d64ba2bc4a81ef438d7a150bfce9ed Mon Sep 17 00:00:00 2001 From: martinkrulltott Date: Wed, 21 Jun 2023 13:52:32 +0200 Subject: [PATCH 2/2] test: revert prev change, expect calc modal to be closed after deleting a calc --- cypress/elements/calculationsModal.js | 8 +++++--- cypress/elements/dimensionModal/dataDimension.js | 5 +---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cypress/elements/calculationsModal.js b/cypress/elements/calculationsModal.js index 6160c5ebd3..8ac3b106e8 100644 --- a/cypress/elements/calculationsModal.js +++ b/cypress/elements/calculationsModal.js @@ -1,3 +1,4 @@ +import { EXTENDED_TIMEOUT } from '../support/utils.js' import { clearInput, typeInput } from './common.js' const calculationModalEl = 'calculation-modal' @@ -64,12 +65,13 @@ export const clickDeleteButton = () => .contains('Delete calculation') .click() -export const clickConfirmDeleteButton = () => - cy - .getBySel('calculation-delete-modal') +export const clickConfirmDeleteButton = () => { + cy.getBySel('calculation-delete-modal') .find('button') .contains('Yes, delete') .click() + cy.getBySel(calculationModalEl, EXTENDED_TIMEOUT).should('not.exist') +} export const clickCheckFormulaButton = () => cy diff --git a/cypress/elements/dimensionModal/dataDimension.js b/cypress/elements/dimensionModal/dataDimension.js index 3c721fbdbb..ed3915cbff 100644 --- a/cypress/elements/dimensionModal/dataDimension.js +++ b/cypress/elements/dimensionModal/dataDimension.js @@ -1,5 +1,4 @@ import { DIMENSION_ID_DATA } from '@dhis2/analytics' -import { EXTENDED_TIMEOUT } from '../../support/utils.js' import { clearInput, typeInput } from '../common.js' import { expectDimensionModalToBeVisible, @@ -40,9 +39,7 @@ export const expectDataDimensionModalToBeVisible = () => expectDimensionModalToBeVisible(DIMENSION_ID_DATA) export const expectNoDataItemsToBeSelected = () => - cy - .getBySel(selectedItemsEl, EXTENDED_TIMEOUT) - .should('contain', 'No items selected') + cy.getBySel(selectedItemsEl).should('contain', 'No items selected') export const expectDataDimensionModalWarningToContain = (text) => cy.getBySel(rightHeaderEl).should('contain', text)