From 4a953f23cb89b6f69fee56bbd7b7a7b2c2342dc3 Mon Sep 17 00:00:00 2001 From: maymanaf Date: Wed, 6 Nov 2024 15:21:43 +0100 Subject: [PATCH 1/3] front: add empty page check stdcm e2e test Signed-off-by: maymanaf --- .../components/StdcmForm/StdcmConfig.tsx | 6 +- .../components/StdcmForm/StdcmDestination.tsx | 1 + .../stdcm/components/StdcmForm/StdcmVias.tsx | 6 +- .../stdcm/components/StdcmHeader.tsx | 1 + .../stdcm/components/StdcmLoader.tsx | 1 + .../components/StdcmResults/StdcmResults.tsx | 13 +- .../StdcmResults/StdcmResultsTable.tsx | 2 + .../stdcm/components/StdcmStatusBanner.tsx | 2 +- .../stdcm/components/StdcmWarningBox.tsx | 2 +- front/tests/004-scenario-management.spec.ts | 2 +- front/tests/005-operational-studies.spec.ts | 22 +- front/tests/006-stdcm.spec.ts | 33 + front/tests/007-op-rollingstock-tab.spec.ts | 2 +- front/tests/008-train-schedule.spec.ts | 44 +- front/tests/009-rollingstock-editor.spec.ts | 2 +- front/tests/010-op-route-tab.spec.ts | 6 +- .../tests/011-op-times-and-stops-tab.spec.ts | 20 +- .../012-op-simulation-settings-tab.spec.ts | 33 +- front/tests/assets/infra/infra.json | 5447 ++++++++++++++--- .../simulationSettings/allSettings.json | 12 +- .../codeCompo/codeCompoOFF.json | 8 +- .../codeCompo/codeCompoON.json | 8 +- .../electricalProfileOFF.json | 8 +- .../electricalProfileON.json | 8 +- .../margin/linearMargin.json | 12 +- .../margin/marecoMargin.json | 18 +- .../expectedOutputsCellsData.json | 6 +- .../{project_const.ts => project-const.ts} | 3 + .../assets/trainSchedule/train_schedules.json | 405 +- front/tests/global-setup.ts | 8 +- front/tests/global-teardown.ts | 8 +- front/tests/pages/stdcm-page-model.ts | 125 + front/tests/utils/api-setup.ts | 17 +- front/tests/utils/index.ts | 33 + front/tests/utils/scenario.ts | 29 +- front/tests/utils/setup-utils.ts | 38 +- 36 files changed, 5206 insertions(+), 1185 deletions(-) create mode 100644 front/tests/006-stdcm.spec.ts rename front/tests/assets/{project_const.ts => project-const.ts} (80%) create mode 100644 front/tests/pages/stdcm-page-model.ts diff --git a/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx b/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx index 417f9298535..d564c7d9a23 100644 --- a/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx +++ b/front/src/applications/stdcm/components/StdcmForm/StdcmConfig.tsx @@ -174,7 +174,11 @@ const StdcmConfig = ({ })} > {showBtnToLaunchSimulation && ( - diff --git a/front/src/applications/stdcm/components/StdcmHeader.tsx b/front/src/applications/stdcm/components/StdcmHeader.tsx index 3497bbf954a..6216172e933 100644 --- a/front/src/applications/stdcm/components/StdcmHeader.tsx +++ b/front/src/applications/stdcm/components/StdcmHeader.tsx @@ -25,6 +25,7 @@ const StdcmHeader = ({ isDebugMode, onDebugModeToggle }: StdcmHeaderProps) => { {isSuperUser && (
{t('gesicoRequest')}
@@ -115,7 +119,12 @@ const StcdmResults = ({ )} {retainedSimulationIndex > -1 && (
-
)} diff --git a/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx b/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx index 770c9ef5a10..31cf6cc7c3d 100644 --- a/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx +++ b/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx @@ -122,6 +122,7 @@ const StcdmResultsTable = ({