♻️(e2e) improve config testcases

Improve config testcases:
- let THEME_CUSTOMIZATION_FILE_PATH to be set to
check the default value
- add helper function overrideConfig
This commit is contained in:
Anthony LC
2025-05-13 11:24:02 +02:00
parent 2733785016
commit 310154815b
4 changed files with 37 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
import { expect, test } from '@playwright/test';
import { CONFIG } from './common';
import { overrideConfig } from './common';
test.beforeEach(async ({ page }) => {
await page.goto('/docs/');
@@ -54,18 +54,8 @@ test.describe('Home page', () => {
});
test('it checks the homepage feature flag', async ({ page }) => {
await page.route('**/api/v1.0/config/', async (route) => {
const request = route.request();
if (request.method().includes('GET')) {
await route.fulfill({
json: {
...CONFIG,
FRONTEND_HOMEPAGE_FEATURE_ENABLED: false,
},
});
} else {
await route.continue();
}
await overrideConfig(page, {
FRONTEND_HOMEPAGE_FEATURE_ENABLED: false,
});
await page.goto('/');