@@ -9,7 +9,7 @@ import OperationalStudiesTimetablePage from './pages/op-timetable-page-model';
9
9
import OperationalStudiesPage from './pages/operational-studies-page-model' ;
10
10
import ScenarioPage from './pages/scenario-page-model' ;
11
11
import { readJsonFile } from './utils' ;
12
- import { cleanWhitespace , cleanWhitespaces , type StationData } from './utils/dataNormalizer' ;
12
+ import { cleanWhitespace , cleanWhitespaceInArray , type StationData } from './utils/dataNormalizer' ;
13
13
import setupScenario from './utils/scenario' ;
14
14
import scrollContainer from './utils/scrollHelper' ;
15
15
import enTranslations from '../public/locales/en/timesStops.json' ;
@@ -20,7 +20,17 @@ let study: Study;
20
20
let scenario : Scenario ;
21
21
let selectedLanguage : string ;
22
22
23
- const dualRollingStockName = 'dual-mode_rollingstock_test_e2e' ;
23
+ type TranslationKeys = keyof typeof enTranslations ;
24
+
25
+ // Define CellData interface for table cell data
26
+ interface CellData {
27
+ stationName : string ;
28
+ header : TranslationKeys ;
29
+ value : string ;
30
+ marginForm ?: string ;
31
+ }
32
+
33
+ const dualRollingStockName = 'dual-mode_rolling_stock_test_e2e' ;
24
34
25
35
const initialInputsData : CellData [ ] = readJsonFile (
26
36
'./tests/assets/operationStudies/timesAndStops/initialInputs.json'
@@ -43,16 +53,6 @@ const expectedViaValues = [
43
53
{ name : 'Mid_East_station' , ch : 'BV' , uic : '4' , km : 'KM 26.300' } ,
44
54
] ;
45
55
46
- type TranslationKeys = keyof typeof enTranslations ;
47
-
48
- // Define CellData interface for table cell data
49
- interface CellData {
50
- stationName : string ;
51
- header : TranslationKeys ;
52
- value : string ;
53
- marginForm ?: string ;
54
- }
55
-
56
56
test . beforeEach ( async ( { page } ) => {
57
57
// Create a new scenario
58
58
( { project, study, scenario } = await setupScenario ( ) ) ;
@@ -106,7 +106,7 @@ test.describe('Times and Stops Tab Verification', () => {
106
106
107
107
// Set column names based on the selected language
108
108
const translations = selectedLanguage === 'English' ? enTranslations : frTranslations ;
109
- const expectedColumnNames = cleanWhitespaces ( [
109
+ const expectedColumnNames = cleanWhitespaceInArray ( [
110
110
translations . name ,
111
111
'Ch' ,
112
112
translations . arrivalTime ,
@@ -117,7 +117,7 @@ test.describe('Times and Stops Tab Verification', () => {
117
117
] ) ;
118
118
119
119
// Verify that the actual column headers match the expected headers
120
- const actualColumnHeaders = cleanWhitespaces (
120
+ const actualColumnHeaders = cleanWhitespaceInArray (
121
121
await opInputTablePage . columnHeaders . allInnerTexts ( )
122
122
) ;
123
123
expect ( actualColumnHeaders ) . toEqual ( expectedColumnNames ) ;
@@ -157,7 +157,8 @@ test.describe('Times and Stops Tab Verification', () => {
157
157
// Add the train schedule and verify simulation results
158
158
await scenarioPage . addTrainSchedule ( ) ;
159
159
await scenarioPage . returnSimulationResult ( ) ;
160
- opTimetablePage . verifyTimeStopsDatasheetVisibility ( ) ;
160
+ await opTimetablePage . clickOnScenarioCollapseButton ( ) ;
161
+ await opTimetablePage . verifyTimeStopsDataSheetVisibility ( ) ;
161
162
// Scroll and extract data from output table
162
163
await scrollContainer ( page , '.osrd-simulation-container .time-stops-datasheet .dsg-container' ) ;
163
164
await opOutputTablePage . getOutputTableData ( outputExpectedCellData , selectedLanguage ) ;
0 commit comments