@@ -51,30 +51,28 @@ Given(/body from file "(.*)"/, function (this: World, filename: string) {
5151Given (
5252 "request contains {string} parameter from {string}" ,
5353 function ( this : World , parameterName : string , fixturePath : string ) {
54- const value = pathLookup ( this . fixtures , fixturePath ) ;
55- this . opts [ parameterName . toAttributeName ( ) ] = value ;
56- // Store in pathParameters for undo operations with naming variants
57- this . pathParameters [ parameterName ] = value ;
58- this . pathParameters [ parameterName . toAttributeName ( ) ] = value ;
54+ this . opts [ parameterName . toAttributeName ( ) ] = pathLookup (
55+ this . fixtures ,
56+ fixturePath
57+ ) ;
58+
5959 }
6060) ;
6161
6262Given (
6363 / r e q u e s t c o n t a i n s " ( [ ^ " ] + ) " p a r a m e t e r w i t h v a l u e ( .* ) / ,
6464 function ( this : World , parameterName : string , value : string ) {
65- const parsedValue = JSON . parse ( value . templated ( this . fixtures ) ) ;
66- const attrName = parameterName . toAttributeName ( ) . toOperationName ( ) ;
67- this . opts [ attrName ] = parsedValue ;
68- // Store in pathParameters for undo operations with naming variants
69- this . pathParameters [ parameterName ] = parsedValue ;
70- this . pathParameters [ attrName ] = parsedValue ;
65+ this . opts [ parameterName . toAttributeName ( ) . toOperationName ( ) ] = JSON . parse (
66+ value . templated ( this . fixtures )
67+ ) ;
68+
69+
70+
7171 }
7272) ;
7373
7474Given ( "new {string} request" , function ( this : World , operationId : string ) {
7575 this . operationId = operationId ;
76- this . opts = { } ;
77- this . pathParameters = { } ; // Clear path parameters for new request
7876} ) ;
7977
8078When ( "the request is sent" , async function ( this : World ) {
@@ -161,7 +159,7 @@ When("the request is sent", async function (this: World) {
161159 this . operationId ,
162160 this . response ,
163161 this . opts ,
164- this . pathParameters // Pass dedicated pathParameters
162+ this . opts // Pass opts as pathParameters (contains all parameters including path ones)
165163 )
166164 ) ;
167165 }
0 commit comments