I want to store some re-usable config object for a Playwright test.
This seems to be a very cumbersome way to get a type definition,
import { Page, expect } from '@playwright/test';
type PageMatchersFn = ReturnType<typeof expect<Page>>;
type ToHaveUrlParams = Parameters<PageMatchersFn['toHaveURL']>;
type ToHaveUrlOptions = ToHaveUrlParams[1];
const toHaveUrlOptions: ToHaveUrlOptions = {
timeout: 20_000,
ignoreCase: true,
};
I see an interface PageAssertions
in the playwright/types/test.d.ts
but it do not seem to be exposed
Expecting there may be a more straightforward solution