feat: migrate cypress e2e tests to playwright (#1739)

This commit is contained in:
kolaente
2025-11-27 16:34:48 +01:00
committed by GitHub
parent 23a6ae19ea
commit 51512c1cb4
80 changed files with 4075 additions and 3066 deletions

View File

@@ -0,0 +1,23 @@
import type {APIRequestContext} from '@playwright/test'
export async function updateUserSettings(apiContext: APIRequestContext, token: string, settings: any) {
const apiUrl = process.env.API_URL || 'http://localhost:3456/api/v1'
const userResponse = await apiContext.get(`${apiUrl}/user`, {
headers: {
'Authorization': `Bearer ${token}`,
},
})
const oldSettings = await userResponse.json()
await apiContext.post(`${apiUrl}/user/settings/general`, {
headers: {
'Authorization': `Bearer ${token}`,
},
data: {
...oldSettings,
...settings,
},
})
}