Revert "feat(test-runner): allow parametrized tests that don't extend base (#9301)"

This reverts commit f63af830de30872f60eff7a4be22379df5bf985c.
This commit is contained in:
Max Schmitt 2021-10-11 17:32:31 +02:00
parent f884103b62
commit 9dd6bb8c6a
4 changed files with 2 additions and 35 deletions

View File

@ -2444,7 +2444,7 @@ export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' |
* ```
*
*/
export interface PlaywrightTestOptions extends PlaywrightTest.ExtraUseOptions {
export interface PlaywrightTestOptions {
/**
* Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.
*/

View File

@ -166,11 +166,4 @@ declare global {
}
}
declare global {
namespace PlaywrightTest {
export interface ExtraUseOptions {
}
}
}
export { };

View File

@ -182,29 +182,3 @@ test('config should allow void/empty options', async ({ runTSC }) => {
});
expect(result.exitCode).toBe(0);
});
test('config should allow ExtraUseOptions', async ({ runTSC }) => {
const result = await runTSC({
'playwright.config.ts': `
const configs: pwt.Config[] = [];
configs.push({ use: { myParam: 'text' }});
`,
'extraUseOptions.d.ts': `
export {};
declare global {
namespace PlaywrightTest {
export interface ExtraUseOptions {
myParam: string
}
}
}
`,
'a.spec.ts': `
const { test } = pwt;
test('my test', async ({ myParam }) => {
console.log(myParam);
});
`
});
expect(result.exitCode).toBe(0);
});

View File

@ -298,7 +298,7 @@ export interface PlaywrightWorkerOptions {
export type VideoMode = 'off' | 'on' | 'retain-on-failure' | 'on-first-retry' | /** deprecated */ 'retry-with-video';
export interface PlaywrightTestOptions extends PlaywrightTest.ExtraUseOptions {
export interface PlaywrightTestOptions {
acceptDownloads: boolean | undefined;
bypassCSP: boolean | undefined;
colorScheme: ColorScheme | undefined;