Skip to content

Commit b0f79f9

Browse files
[test optimization] Fix latest playwright@1.56.0 release (#6611)
1 parent c1d538f commit b0f79f9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/datadog-instrumentations/src/playwright.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,10 @@ addHook({
772772
if (!isKnownTestsEnabled && !isTestManagementTestsEnabled && !isImpactedTestsEnabled) {
773773
return oldCreateRootSuite.apply(this, arguments)
774774
}
775-
const rootSuite = await oldCreateRootSuite.apply(this, arguments)
775+
776+
const createRootSuiteReturnValue = await oldCreateRootSuite.apply(this, arguments)
777+
// From v1.56.0 on, createRootSuite returns `{ rootSuite, topLevelProjects }`
778+
const rootSuite = createRootSuiteReturnValue.rootSuite || createRootSuiteReturnValue
776779

777780
const allTests = rootSuite.allTests()
778781

@@ -861,7 +864,7 @@ addHook({
861864
}
862865
}
863866

864-
return rootSuite
867+
return createRootSuiteReturnValue
865868
}
866869

867870
// We need to proxy the createRootSuite function because the function is not configurable

0 commit comments

Comments
 (0)