// foo.ts
import { test as base } from "@playwright/test";
const test = base.extend<{foo: string}>({
foo: "hello"
});
export { test };
// bar.ts
import { test as base } from "@playwright/test";
const test = base.extend<{bar: string}>({
bar: "bye"
});
export { test };
// index.ts
import { test } from /* BOTH_FOO_AND_BAR??? */;
test("Basic test", async ({ foo, bar }) => { // <-- I want to be able to use both foo and bar fixture here
console.log(foo);
console.log(bar);
});
以上能实现吗?还是我必须像这样依赖另一个?
// bar.ts
import { test as base } from "./foo";
// index.ts
import { test } from "./bar";
如果我有很多文件并且导入最后一个文件将导入所有文件,这将创建一个长链。如果可能的话,我更喜欢挑选和匹配。