@dev-blinq/cucumber_client 1.0.1668-dev → 1.0.1669-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,7 +43,7 @@ class PromisifiedSocketServer {
43
43
  }
44
44
  this.socket.emit("response", { id, value: response, roomId, socketId });
45
45
  } catch (error) {
46
- console.error(`Error handling request for event: ${event}`, error);
46
+ console.error(`Error handling request for event: ${JSON.stringify(event, null, 2)}`, error);
47
47
  socketLogger.error("Error handling request", {
48
48
  event,
49
49
  input,
@@ -157,37 +157,45 @@ export class PublishService {
157
157
  const runsURL = getRunsServiceBaseURL();
158
158
  const workspaceURL = runsURL.replace("/runs", "/workspace");
159
159
  const url = `${workspaceURL}/publish-recording`;
160
- const result = await axiosClient({
161
- url,
162
- method: "POST",
163
- data: {
164
- scenario,
165
- featureName,
166
- override,
167
- env,
168
- },
169
- params: {
170
- branch,
171
- },
172
- headers: {
173
- Authorization: `Bearer ${this.TOKEN}`,
174
- "X-Source": "recorder",
175
- },
176
- });
177
- if (result.status !== 200) {
178
- return { success: false, message: "Error while saving scenario" };
179
- }
180
160
  try {
181
- this.updateProjectMetadata({
182
- featureName,
183
- scenarioName: scenario.name,
184
- projectId,
185
- branch,
186
- isEditing: override,
161
+ const result = await axiosClient({
162
+ url,
163
+ method: "POST",
164
+ data: {
165
+ scenario,
166
+ featureName,
167
+ override,
168
+ env,
169
+ },
170
+ params: {
171
+ branch,
172
+ },
173
+ headers: {
174
+ Authorization: `Bearer ${this.TOKEN}`,
175
+ "X-Source": "recorder",
176
+ },
187
177
  });
178
+ if (result.status !== 200) {
179
+ return { success: false, message: "Error while saving scenario" };
180
+ }
181
+ try {
182
+ this.updateProjectMetadata({
183
+ featureName,
184
+ scenarioName: scenario.name,
185
+ projectId,
186
+ branch,
187
+ isEditing: override,
188
+ });
189
+ }
190
+ catch (error) { }
191
+ return { success: true, data: result.data };
192
+ }
193
+ catch (error) {
194
+ // @ts-ignore
195
+ const reason = error?.response?.data?.error || "";
196
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
197
+ throw new Error(`Failed to save scenario: ${errorMessage} \n ${reason}`);
188
198
  }
189
- catch (error) { }
190
- return { success: true, data: result.data };
191
199
  }
192
200
  async updateProjectMetadata({ featureName, scenarioName, projectId, branch, isEditing }) {
193
201
  try {
@@ -690,7 +690,7 @@ export async function saveRecording({ step, cucumberStep, codePage, projectDir,
690
690
  step.finalTimeout
691
691
  );
692
692
 
693
- if (!step.renamedText) {
693
+ if (!step.renamedText && !(step.isImplemented && step.shouldOverride)) {
694
694
  stepsDefinitions.addStep({
695
695
  name: step.text,
696
696
  file: codePage.sourceFileName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-blinq/cucumber_client",
3
- "version": "1.0.1668-dev",
3
+ "version": "1.0.1669-dev",
4
4
  "description": " ",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",