Skip to content

Commit

Permalink
fixup! front: add stdcm simulation sheet e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
Maymanaf committed Jan 10, 2025
1 parent 137af84 commit 1539295
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 5 additions & 0 deletions front/tests/013-stdcm-simulation-sheet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ test.describe('Verify stdcm simulation page', () => {
infra = await getInfra();
});

test.afterAll(' Delete saved files in the results directory', async () => {
fs.rmSync('./tests/stdcm-results', { recursive: true, force: true });
logger.info('All downloaded files have been removed from the results directory.');
});

test.beforeEach('Navigate to the STDCM page', async ({ page }) => {
// Retrieve OSRD language and navigate to STDCM page
const homePage = new HomePage(page);
Expand Down
6 changes: 0 additions & 6 deletions front/tests/global-teardown.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import fs from 'fs';

import { test as teardown } from '@playwright/test';

import ROLLING_STOCK_NAMES, {
Expand All @@ -19,10 +17,6 @@ teardown('teardown', async ({ browser }) => {
await deleteProject(globalProjectName);
await deleteRollingStocks(ROLLING_STOCK_NAMES);

// Delete saved files in the results directory
fs.rmSync('./tests/stdcm-results', { recursive: true, force: true });
logger.info('All downloaded files have been removed from the results directory.');

// Close all browser contexts
await Promise.all(browser.contexts().map((context) => context.close()));
logger.info('All browser contexts closed successfully.');
Expand Down
1 change: 0 additions & 1 deletion front/tests/utils/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const SUPPORTED_LANGUAGES: Record<string, string> = {

/**
* Get a localized date string formatted according to the specified language.
* Defaults to English if the language is unsupported.
*
* @param dateString - The date string to format (ISO format recommended)
* @param language - The language for localization (e.g., "English", "French")
Expand Down

0 comments on commit 1539295

Please sign in to comment.