Skip to content

Commit

Permalink
front: fix stdcm towed rolling stock e2e test
Browse files Browse the repository at this point in the history
Signed-off-by: maymanaf <[email protected]>
  • Loading branch information
Maymanaf committed Jan 8, 2025
1 parent e5bce37 commit a9cb8c8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions front/src/assets/rollingStock/freightRollingStocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const FREIGHT_ROLLING_STOCKS = [
'Y8000AP',
'Y9000US',
'electric_rolling_stock_test_e2e',
'FAST_ROLLING_STOCK_TEST_E2E',
];

export default FREIGHT_ROLLING_STOCKS;
17 changes: 11 additions & 6 deletions front/tests/006-stdcm.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Infra, TowedRollingStock } from 'common/api/osrdEditoastApi';

import { electricRollingStockName } from './assets/project-const';
import { electricRollingStockName, fastRollingStockName } from './assets/project-const';
import HomePage from './pages/home-page-model';
import STDCMPage, { type ConsistFields } from './pages/stdcm-page-model';
import test from './test-logger';
Expand All @@ -20,7 +20,7 @@ test.describe('Verify train schedule elements and filters', () => {
let infra: Infra;
let OSRDLanguage: string;
let createdTowedRollingStock: TowedRollingStock;
const UPDATED_TONNAGE = '561';
const UPDATED_TONNAGE = '112';
const consistDetails: ConsistFields = {
tractionEngine: electricRollingStockName,
tonnage: '400',
Expand All @@ -33,6 +33,11 @@ test.describe('Verify train schedule elements and filters', () => {
length: '400',
maxSpeed: '288',
};
const fastRollingStockPrefilledValues = {
tonnage: '190',
length: '45',
maxSpeed: '220',
};
const towedRollingStockPrefilledValues = {
tonnage: '46',
length: '26',
Expand Down Expand Up @@ -133,15 +138,15 @@ test.describe('Verify train schedule elements and filters', () => {
/** *************** Test 4 **************** */
test('Launch simulation with and without capacity for towed rolling stock', async ({ page }) => {
const towedConsistDetails: ConsistFields = {
tractionEngine: electricRollingStockName,
tractionEngine: fastRollingStockName,
towedRollingStock: createdTowedRollingStock.name,
};
const stdcmPage = new STDCMPage(page);
await stdcmPage.fillAndVerifyConsistDetails(
towedConsistDetails,
tractionEnginePrefilledValues.tonnage,
tractionEnginePrefilledValues.length,
tractionEnginePrefilledValues.maxSpeed,
fastRollingStockPrefilledValues.tonnage,
fastRollingStockPrefilledValues.length,
fastRollingStockPrefilledValues.maxSpeed,
towedRollingStockPrefilledValues.tonnage,
towedRollingStockPrefilledValues.length,
towedRollingStockPrefilledValues.maxSpeed
Expand Down
2 changes: 1 addition & 1 deletion front/tests/assets/project-const.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const electricRollingStockName = 'electric_rolling_stock_test_e2e';
export const dualModeRollingStockName = 'dual-mode_rolling_stock_test_e2e';
export const slowRollingStockName = 'slow_rolling_stock_test_e2e';
export const fastRollingStockName = 'fast_rolling_stock_test_e2e';
export const fastRollingStockName = 'FAST_ROLLING_STOCK_TEST_E2E';
export const improbableRollingStockName = 'improbable_rolling_stock_test_e2e';
export const infrastructureName = 'small_infra_test_e2e';
export const trainScheduleProjectName = 'TS_project_test_e2e';
Expand Down
4 changes: 2 additions & 2 deletions front/tests/assets/rollingStock/fast_rolling_stock.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@
"default_mode": "thermal"
},
"metadata": {
"detail": "fast_rolling_stock",
"detail": "",
"family": "",
"type": "",
"grouping": "",
"series": "",
"subseries": "",
"unit": "",
"number": "",
"reference": "fast_rolling_stock"
"reference": ""
},
"length": 45.56,
"max_speed": 61.111111111111114,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"endStop": "",
"passageStop": "",
"startStop": "20:21",
"weight": "561t",
"weight": "112t",
"refEngine": ""
},
{
Expand All @@ -23,10 +23,10 @@
"index": 3,
"operationalPoint": "South_station",
"code": "BV",
"endStop": "20:46",
"endStop": "20:45",
"passageStop": "",
"startStop": "",
"weight": "561t",
"weight": "112t",
"refEngine": ""
}
]

0 comments on commit a9cb8c8

Please sign in to comment.