mirror of
https://github.com/inventree/InvenTree.git
synced 2026-03-21 19:54:40 +00:00
17 lines
385 B
TypeScript
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}`)}`
|
|
}
|
|
});
|