diff --git a/cypress/commons/actions/generic/DatasetManager.js b/cypress/commons/actions/generic/DatasetManager.js index 03c297a19..316ad7eef 100644 --- a/cypress/commons/actions/generic/DatasetManager.js +++ b/cypress/commons/actions/generic/DatasetManager.js @@ -84,7 +84,8 @@ export const getDatasetOverviewPlaceholderApiLink = () => cy.get(SELECTORS.overv export const getIndicatorCard = (kpiId) => cy.get(SELECTORS.overview.indicators.cardByKpiId.replace('$KPI_ID', kpiId)); export const getKpiLoading = (parent) => parent.find(SELECTORS.overview.indicators.kpiLoading); -export const getKpiValue = (parent) => parent.find(SELECTORS.overview.indicators.kpiValue); +export const getKpiValue = (parent, timeout) => + parent.find(SELECTORS.overview.indicators.kpiValue, timeout ? { timeout: timeout * 1000 } : undefined); export const getKpiError = (parent) => parent.find(SELECTORS.overview.indicators.kpiError); export const getKpiUnknownState = (parent) => parent.find(SELECTORS.overview.indicators.kpiUnknownState); diff --git a/cypress/commons/utils/apiUtils.js b/cypress/commons/utils/apiUtils.js index f2750d495..509c6417e 100644 --- a/cypress/commons/utils/apiUtils.js +++ b/cypress/commons/utils/apiUtils.js @@ -1,5 +1,6 @@ // Copyright (c) Cosmo Tech. // Licensed under the MIT license. +import { POLLING_START_DELAY } from '../../../src/services/config/FunctionalConstants'; import utils from '../../commons/TestUtils'; import { DEFAULT_DATASET, SCENARIO_EXAMPLE, SCENARIO_RUN_EXAMPLE } from '../../fixtures/stubbing/default'; import { API_ENDPOINT, API_REGEX, AUTH_QUERY_URL, URL_POWERBI, URL_ROOT } from '../constants/generic/TestConstants'; @@ -137,11 +138,13 @@ const interceptLaunchScenario = (stubbingOptions) => { stub.patchScenario(scenarioId, { state: 'Running', lastRun: scenarioLastRun }); setTimeout(() => { - stub.patchScenario(scenarioId, { state: 'DataIngestionInProgress' }); setTimeout(() => { - stub.patchScenario(scenarioId, { state: finalStatus }); - }, dataIngestionDuration); - }, runDuration); + stub.patchScenario(scenarioId, { state: 'DataIngestionInProgress' }); + setTimeout(() => { + stub.patchScenario(scenarioId, { state: finalStatus }); + }, dataIngestionDuration); + }, runDuration); + }, POLLING_START_DELAY); req.reply(scenarioRun); } diff --git a/cypress/e2e/brewery/DatasetManager_e2e.cy.js b/cypress/e2e/brewery/DatasetManager_e2e.cy.js index a4dc1a590..f0c432853 100644 --- a/cypress/e2e/brewery/DatasetManager_e2e.cy.js +++ b/cypress/e2e/brewery/DatasetManager_e2e.cy.js @@ -73,7 +73,7 @@ describe('End-to-end test of the dataset manager view', () => { DatasetManager.getAllReuploadDatasetButtons().click(); DatasetManager.getConfirmDatasetRefreshButton().click(); DatasetManager.getAllReuploadDatasetInputs().attachFile(NINE_CUSTOMERS_DATASET_ZIP_FILE_PATH); - DatasetManager.getKpiValue(DatasetManager.getIndicatorCard('satisfaction_links_count')).should('have.text', 16); + DatasetManager.getKpiValue(DatasetManager.getIndicatorCard('satisfaction_links_count'), 10).should('have.text', 16); DatasetManager.getAllDeleteDatasetButtons().click(); DatasetManager.getDeleteDatasetDialogBody().contains(fileDatasetName);