Skip to content

Commit 9358f48

Browse files
authored
Upgrade @playwright/test and cleanup internal APIs (#77659)
Addressing the API incompatibility in the newest Playwright release: microsoft/playwright#27059 (comment) cc @wyozi
1 parent 5195704 commit 9358f48

File tree

3 files changed

+33
-54
lines changed

3 files changed

+33
-54
lines changed

packages/next/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
},
111111
"peerDependencies": {
112112
"@opentelemetry/api": "^1.1.0",
113-
"@playwright/test": "^1.41.2",
113+
"@playwright/test": "^1.51.1",
114114
"babel-plugin-react-compiler": "*",
115115
"react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
116116
"react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
@@ -170,7 +170,7 @@
170170
"@next/react-refresh-utils": "15.3.0-canary.26",
171171
"@next/swc": "15.3.0-canary.26",
172172
"@opentelemetry/api": "1.6.0",
173-
"@playwright/test": "1.41.2",
173+
"@playwright/test": "1.51.1",
174174
"@storybook/addon-a11y": "8.6.0",
175175
"@storybook/addon-essentials": "8.6.0",
176176
"@storybook/addon-interactions": "8.6.0",

packages/next/src/experimental/testmode/playwright/step.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,13 @@ export interface StepProps {
99
params?: Record<string, string | number | boolean | null | undefined>
1010
}
1111

12-
// Access the internal Playwright API until it's exposed publicly.
13-
// See https://github.com/microsoft/playwright/issues/27059.
14-
interface TestInfoWithRunAsStep extends TestInfo {
15-
_runAsStep: <T>(
16-
stepInfo: StepProps,
17-
handler: (result: { complete: Complete }) => Promise<T>
18-
) => Promise<T>
19-
}
20-
2112
type Complete = (result: { error?: any }) => void
2213

23-
function isWithRunAsStep(
24-
testInfo: TestInfo
25-
): testInfo is TestInfoWithRunAsStep {
26-
return '_runAsStep' in testInfo
27-
}
28-
2914
export async function step<T>(
30-
testInfo: TestInfo,
15+
_testInfo: TestInfo,
3116
props: StepProps,
3217
handler: (complete: Complete) => Promise<Awaited<T>>
3318
): Promise<Awaited<T>> {
34-
if (isWithRunAsStep(testInfo)) {
35-
return testInfo._runAsStep(props, ({ complete }) => handler(complete))
36-
}
37-
38-
// Fallback to the `test.step()`.
3919
let result: Awaited<T>
4020
let reportedError: any
4121
try {

pnpm-lock.yaml

+30-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)