I have multiple projects in my playwright.config file, all of which have the same setup project as a dependency.
Is there a way to determine at runtime which parent project is initiating the setup process?
playwright.config
projects: [
{ name: "setup", testMatch: /.*\.setup\.ts/ },
{
name: "foo",
dependencies: ["setup"],
},
{
name: "bar",
dependencies: ["setup"],
},
]
setup test
setup("setup test", async ({ page }, testInfo) => {
console.log(testInfo.project.name); // output: "setup"
/* Desired output: */
// console.log(testInfo.paretProject.name);
/* Or */
// console.log(testInfo.project.parentName)
});
(Possibly by providing the initiator name within the project dependency properties somehow)