♻️(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:
@@ -22,6 +22,24 @@ export const CONFIG = {
|
||||
theme_customization: {},
|
||||
};
|
||||
|
||||
export const overrideConfig = async (
|
||||
page: Page,
|
||||
newConfig: { [K in keyof typeof CONFIG]?: unknown },
|
||||
) =>
|
||||
await page.route('**/api/v1.0/config/', async (route) => {
|
||||
const request = route.request();
|
||||
if (request.method().includes('GET')) {
|
||||
await route.fulfill({
|
||||
json: {
|
||||
...CONFIG,
|
||||
...newConfig,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
await route.continue();
|
||||
}
|
||||
});
|
||||
|
||||
export const keyCloakSignIn = async (
|
||||
page: Page,
|
||||
browserName: string,
|
||||
|
||||
Reference in New Issue
Block a user