Files
vikunja/frontend/tests/support/fixtures.ts
kolaente 8b6082e8c7 feat(kanban): add setting to always show bucket task count (#1966)
Added "Always show task count on Kanban buckets" setting in user preferences to control the visibility of task counts on Kanban bucket headers
2025-12-11 23:27:13 +00:00

39 lines
1.0 KiB
TypeScript

import {test as base, type APIRequestContext, type Page} from '@playwright/test'
import {Factory} from './factory'
import {login, createFakeUser} from './authenticateUser'
export const test = base.extend<{
apiContext: APIRequestContext;
authenticatedPage: Page;
currentUser: any;
userToken: string;
}>({
apiContext: async ({playwright}, use) => {
const baseURL = process.env.API_URL || 'http://localhost:3456/api/v1/'
const apiContext = await playwright.request.newContext({
baseURL,
})
Factory.setRequestContext(apiContext)
await use(apiContext)
await apiContext.dispose()
},
currentUser: async ({apiContext}, use) => {
const user = await createFakeUser()
await use(user)
},
userToken: async ({apiContext, currentUser}, use) => {
const {token} = await login(null, apiContext, currentUser)
await use(token)
},
authenticatedPage: async ({page, apiContext, currentUser}, use) => {
const {token} = await login(page, apiContext, currentUser)
await use(page)
},
})
export {expect} from '@playwright/test'