20 lines
418 B
TypeScript
20 lines
418 B
TypeScript
import { BrowserContext, Browser } from '@playwright/test';
|
|
|
|
export interface AuthContext {
|
|
context: BrowserContext;
|
|
role: 'auth' | 'admin' | 'sponsor';
|
|
}
|
|
|
|
export class WebsiteAuthManager {
|
|
static async createAuthContext(
|
|
browser: Browser,
|
|
role: 'auth' | 'admin' | 'sponsor'
|
|
): Promise<AuthContext> {
|
|
const context = await browser.newContext();
|
|
|
|
return {
|
|
context,
|
|
role,
|
|
};
|
|
}
|
|
} |