test(e2e): honor configured game base paths

This commit is contained in:
2026-07-31 18:08:04 +00:00
parent c3c1ddc0cf
commit 132baf21cc
13 changed files with 88 additions and 72 deletions
@@ -1,4 +1,5 @@
import { expect, test, type Page, type Route } from '@playwright/test';
import { gameProfile, gameTrpcRoute } from './gameTestPaths.js';
const response = (data: unknown) => ({ result: { data } });
const errorResponse = (path: string, message: string) => ({
@@ -128,12 +129,12 @@ const chiefCenter = {
const install = async (page: Page, rejectGeneral = false) => {
const requests: unknown[] = [];
await page.addInitScript(() => {
await page.addInitScript((profile) => {
localStorage.setItem('sammo-game-token', 'ga_commands');
localStorage.setItem('sammo-game-profile', 'che:default');
});
localStorage.setItem('sammo-game-profile', profile);
}, gameProfile);
await page.route('**/image/**', (route) => route.fulfill({ status: 404, body: '' }));
await page.route('**/che/api/trpc/**', async (route) => {
await page.route(gameTrpcRoute, async (route) => {
const names = operations(route);
const body = route.request().postDataJSON();
const results = names.map((name) => {