feat: support guest session (#919)
This commit is contained in:
parent
24cb2ce19b
commit
9279135355
34 changed files with 741 additions and 288 deletions
|
|
@ -1,34 +1,51 @@
|
|||
import { expect as baseExpect, test as baseTest } from '@playwright/test';
|
||||
import { createAuthenticatedContext, type UserContext } from './auth-helper';
|
||||
import { createAuthenticatedContext, type UserContext } from './helpers';
|
||||
import { getUnixTime } from 'date-fns';
|
||||
|
||||
interface Fixtures {
|
||||
adaContext: UserContext;
|
||||
babbageContext: UserContext;
|
||||
curieContext: UserContext;
|
||||
}
|
||||
|
||||
export const test = baseTest.extend<any, Fixtures>({
|
||||
adaContext: [
|
||||
async ({ browser }, use) => {
|
||||
async ({ browser }, use, workerInfo) => {
|
||||
const ada = await createAuthenticatedContext({
|
||||
browser,
|
||||
name: 'ada',
|
||||
name: `ada-${workerInfo.workerIndex}-${getUnixTime(new Date())}`,
|
||||
});
|
||||
|
||||
await use(ada);
|
||||
await ada.context.close();
|
||||
},
|
||||
{ scope: 'worker' },
|
||||
],
|
||||
babbageContext: [
|
||||
async ({ browser }, use) => {
|
||||
async ({ browser }, use, workerInfo) => {
|
||||
const babbage = await createAuthenticatedContext({
|
||||
browser,
|
||||
name: 'babbage',
|
||||
name: `babbage-${workerInfo.workerIndex}-${getUnixTime(new Date())}`,
|
||||
});
|
||||
|
||||
await use(babbage);
|
||||
await babbage.context.close();
|
||||
},
|
||||
{ scope: 'worker' },
|
||||
],
|
||||
curieContext: [
|
||||
async ({ browser }, use, workerInfo) => {
|
||||
const curie = await createAuthenticatedContext({
|
||||
browser,
|
||||
name: `curie-${workerInfo.workerIndex}-${getUnixTime(new Date())}`,
|
||||
chatModel: 'chat-model-reasoning',
|
||||
});
|
||||
|
||||
await use(curie);
|
||||
await curie.context.close();
|
||||
},
|
||||
{ scope: 'worker' },
|
||||
],
|
||||
});
|
||||
|
||||
export const expect = baseExpect;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue