Skip to content

Commit 132e8bb

Browse files
committed
revert last commit
1 parent 2ebda28 commit 132e8bb

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

features/step_definitions/request_steps.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,28 @@ Given(/body from file "(.*)"/, function (this: World, filename: string) {
5151
Given(
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

6262
Given(
6363
/request contains "([^"]+)" parameter with value (.*)/,
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

7474
Given("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

8078
When("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

Comments
 (0)