From a83782f2181b2c1f8698a4a1c3ccbcb77edb75e6 Mon Sep 17 00:00:00 2001 From: maymanaf Date: Wed, 6 Nov 2024 17:24:13 +0100 Subject: [PATCH] front: add download stdcm simulation sheet e2e test Signed-off-by: maymanaf front: add fourth stdcm e2e test Signed-off-by: maymanaf --- front/playwright.config.ts | 2 + .../StdcmResults/StdcmResultsTable.tsx | 2 +- front/tests/005-operational-studies.spec.ts | 6 +- front/tests/006-stdcm.spec.ts | 45 ++++++- front/tests/007-op-rollingstock-tab.spec.ts | 17 ++- front/tests/008-train-schedule.spec.ts | 15 ++- front/tests/010-op-route-tab.spec.ts | 10 +- .../tests/011-op-times-and-stops-tab.spec.ts | 4 +- .../012-op-simulation-settings-tab.spec.ts | 4 +- front/tests/assets/project-const.ts | 6 +- front/tests/assets/stdcm/stdcmWithAllVia.json | 52 ++++++++ .../assets/stdcm/stdcmWithoutAllVia.json | 32 +++++ front/tests/global-setup.ts | 22 +++- front/tests/global-teardown.ts | 42 +++++-- .../pages/operational-studies-page-model.ts | 8 -- front/tests/pages/stdcm-page-model.ts | 112 +++++++++++++++--- front/tests/utils/api-setup.ts | 73 +++++++++--- front/tests/utils/dataNormalizer.ts | 8 +- front/tests/utils/index.ts | 36 +++--- front/tests/utils/scenario.ts | 2 +- front/tests/utils/scrollHelper.ts | 6 +- front/tests/utils/setup-utils.ts | 39 +++--- front/tests/utils/teardown-utils.ts | 10 +- front/tests/utils/trainSchedule.ts | 10 +- 24 files changed, 419 insertions(+), 144 deletions(-) create mode 100644 front/tests/assets/stdcm/stdcmWithAllVia.json create mode 100644 front/tests/assets/stdcm/stdcmWithoutAllVia.json diff --git a/front/playwright.config.ts b/front/playwright.config.ts index c3e03f0a039..b9da734d0f3 100644 --- a/front/playwright.config.ts +++ b/front/playwright.config.ts @@ -43,7 +43,9 @@ export default defineConfig({ trace: 'on-first-retry', video: 'on-first-retry', + /* Set locale and timezone */ locale: 'fr', + timezoneId: 'Europe/Paris', }, reporter: process.env.CI ? 'github' : [['line'], ['html']], diff --git a/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx b/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx index 31cf6cc7c3d..61509086f78 100644 --- a/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx +++ b/front/src/applications/stdcm/components/StdcmResults/StdcmResultsTable.tsx @@ -122,7 +122,7 @@ const StcdmResultsTable = ({