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
17 lines
550 B
TypeScript
17 lines
550 B
TypeScript
/* eslint-disable max-len */
|
|
import type { TestFixture, Page } from '@playwright/test';
|
|
|
|
export type MockFeaturesFixture = (features: Array<[string, unknown]>) => Promise<void>;
|
|
|
|
const fixture: TestFixture<MockFeaturesFixture, { page: Page }> = async({ page }, use) => {
|
|
await use(async(features) => {
|
|
for (const [ name, value ] of features) {
|
|
await page.evaluate(({ name, value }) => {
|
|
window.localStorage.setItem(`pw_feature:${ name }`, JSON.stringify(value));
|
|
}, { name, value });
|
|
}
|
|
});
|
|
};
|
|
|
|
export default fixture;
|