File tree 3 files changed +33
-54
lines changed
src/experimental/testmode/playwright
3 files changed +33
-54
lines changed Original file line number Diff line number Diff line change 110
110
},
111
111
"peerDependencies" : {
112
112
"@opentelemetry/api" : " ^1.1.0" ,
113
- "@playwright/test" : " ^1.41.2 " ,
113
+ "@playwright/test" : " ^1.51.1 " ,
114
114
"babel-plugin-react-compiler" : " *" ,
115
115
"react" : " ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" ,
116
116
"react-dom" : " ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0" ,
170
170
"@next/react-refresh-utils" : " 15.3.0-canary.26" ,
171
171
"@next/swc" : " 15.3.0-canary.26" ,
172
172
"@opentelemetry/api" : " 1.6.0" ,
173
- "@playwright/test" : " 1.41.2 " ,
173
+ "@playwright/test" : " 1.51.1 " ,
174
174
"@storybook/addon-a11y" : " 8.6.0" ,
175
175
"@storybook/addon-essentials" : " 8.6.0" ,
176
176
"@storybook/addon-interactions" : " 8.6.0" ,
Original file line number Diff line number Diff line change @@ -9,33 +9,13 @@ export interface StepProps {
9
9
params ?: Record < string , string | number | boolean | null | undefined >
10
10
}
11
11
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
-
21
12
type Complete = ( result : { error ?: any } ) => void
22
13
23
- function isWithRunAsStep (
24
- testInfo : TestInfo
25
- ) : testInfo is TestInfoWithRunAsStep {
26
- return '_runAsStep' in testInfo
27
- }
28
-
29
14
export async function step < T > (
30
- testInfo : TestInfo ,
15
+ _testInfo : TestInfo ,
31
16
props : StepProps ,
32
17
handler : ( complete : Complete ) => Promise < Awaited < T > >
33
18
) : Promise < Awaited < T > > {
34
- if ( isWithRunAsStep ( testInfo ) ) {
35
- return testInfo . _runAsStep ( props , ( { complete } ) => handler ( complete ) )
36
- }
37
-
38
- // Fallback to the `test.step()`.
39
19
let result : Awaited < T >
40
20
let reportedError : any
41
21
try {
You can’t perform that action at this time.
0 commit comments