2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-03-21 19:54:40 +00:00
Files
InvenTree/src/frontend/tests/api.ts
2026-03-14 13:29:46 +11:00

17 lines
385 B
TypeScript

import { request } from '@playwright/test';
import { adminuser, apiUrl } from './defaults';
export const createApi = ({
username,
password
}: {
username?: string;
password?: string;
}) =>
request.newContext({
baseURL: apiUrl,
extraHTTPHeaders: {
Authorization: `Basic ${btoa(`${username || adminuser.username}:${password || adminuser.testcred}`)}`
}
});