mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-29 19:10:51 -05:00
Added "Always show task count on Kanban buckets" setting in user preferences to control the visibility of task counts on Kanban bucket headers
39 lines
1.0 KiB
TypeScript
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'
|