mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* create storageState fixture * remove auth fixture * renaming * migrate bridge tokens and shibarium rollup tests * migrate to common app config * update screenshots * re-implement fixtures for mocking envs, features and auth state * update screenshot
14 lines
485 B
TypeScript
14 lines
485 B
TypeScript
import type { BrowserContext, TestFixture } from '@playwright/test';
|
|
|
|
import config from 'configs/app';
|
|
import * as cookies from 'lib/cookies';
|
|
|
|
export function authenticateUser(context: BrowserContext) {
|
|
context.addCookies([ { name: cookies.NAMES.API_TOKEN, value: 'foo', domain: config.app.host, path: '/' } ]);
|
|
}
|
|
|
|
export const contextWithAuth: TestFixture<BrowserContext, { context: BrowserContext }> = async({ context }, use) => {
|
|
authenticateUser(context);
|
|
use(context);
|
|
};
|