test(web): isolate browser preferences and stabilize date input

This commit is contained in:
Codex committed 2026-11-03 20:13:03 +03:00
1 parent d3d5374a10
commit b5da1f06fb
2 files changed
+6 -2

No files matched your search

+2 -2
View File
@@ -161,8 +161,8 @@ const createTimeline = (page: Page, data: MockData) => {
goToDate: async (asset: AssetResponseDto) => {
await grid.hover();
await page.keyboard.press('g');
const value = DateTime.fromISO(asset.fileCreatedAt, { zone: 'utc' }).toFormat('MMddyyyy,hh:mm:ss.SSSa');
await page.locator('#datetime').pressSequentially(value);
const value = DateTime.fromISO(asset.fileCreatedAt, { zone: 'utc' }).toFormat("yyyy-MM-dd'T'HH:mm");
await page.locator('#datetime').fill(value);
await page.getByRole('button', { name: 'confirm', exact: true }).click();
},
+4
View File
@@ -58,6 +58,7 @@ export const test = base.extend<Fixtures, WorkerFixtures>({
await context.addInitScript(() => {
if (location.protocol.startsWith('http')) {
localStorage.setItem('lang', 'dev');
localStorage.setItem('locale', 'en-US');
}
});
await use(context);
@@ -80,6 +81,9 @@ export const test = base.extend<Fixtures, WorkerFixtures>({
const mock = new Mock(context);
await mock.install(workerPage);
await use(mock);
if (workerPage.url().startsWith(baseURL!)) {
await workerPage.evaluate(() => localStorage.clear());
}
await mock.uninstall();
await context.clearCookies();
// skipped for failed tests so the report shows the real failure instead of the requests it never reached