tests cleanup
This commit is contained in:
20
tests/shared/website/WebsiteAuthManager.ts
Normal file
20
tests/shared/website/WebsiteAuthManager.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user