@dev-blinq/cucumber_client 1.0.1610-dev → 1.0.1612-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.
|
@@ -382,12 +382,7 @@ const _generateCodeFromCommand = (step, elements, userData) => {
|
|
|
382
382
|
if (data) {
|
|
383
383
|
try {
|
|
384
384
|
const { snapshot, fileName, filePath } = data;
|
|
385
|
-
|
|
386
|
-
if (process.env.BVT_TEMP_SNAPSHOTS_FOLDER) {
|
|
387
|
-
const envName = path.basename(process.env.BLINQ_ENV).replace(".json", "");
|
|
388
|
-
folderPath = path.join(process.env.BVT_TEMP_SNAPSHOTS_FOLDER, envName);
|
|
389
|
-
}
|
|
390
|
-
// const folderPath = process.env.BVT_TEMP_SNAPSHOTS_FOLDER ?? filePath;
|
|
385
|
+
const folderPath = process.env.BVT_TEMP_SNAPSHOTS_FOLDER ?? filePath;
|
|
391
386
|
const filePathWithName = path.join(folderPath, fileName);
|
|
392
387
|
if (!fs.existsSync(folderPath)) {
|
|
393
388
|
fs.mkdirSync(folderPath, { recursive: true });
|
|
@@ -200,7 +200,7 @@ export class BVTRecorder {
|
|
|
200
200
|
this.workspaceService = new PublishService(this.TOKEN);
|
|
201
201
|
this.pageSet = new Set();
|
|
202
202
|
this.lastKnownUrlPath = "";
|
|
203
|
-
this.world = { attach: () => {} };
|
|
203
|
+
this.world = { attach: () => { } };
|
|
204
204
|
this.shouldTakeScreenshot = true;
|
|
205
205
|
this.watcher = null;
|
|
206
206
|
this.networkEventsFolder = path.join(tmpdir(), "blinq_network_events");
|
|
@@ -322,7 +322,7 @@ export class BVTRecorder {
|
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
// this.stepRunner.setRemoteDebugPort(this.#remoteDebuggerPort);
|
|
325
|
-
this.world = { attach: () => {} };
|
|
325
|
+
this.world = { attach: () => { } };
|
|
326
326
|
|
|
327
327
|
const ai_config_file = path.join(this.projectDir, "ai_config.json");
|
|
328
328
|
let ai_config = {};
|
|
@@ -824,7 +824,7 @@ export class BVTRecorder {
|
|
|
824
824
|
}
|
|
825
825
|
async closeBrowser() {
|
|
826
826
|
delete process.env.TEMP_RUN;
|
|
827
|
-
await this.watcher.close().then(() => {});
|
|
827
|
+
await this.watcher.close().then(() => { });
|
|
828
828
|
this.watcher = null;
|
|
829
829
|
this.previousIndex = null;
|
|
830
830
|
this.previousHistoryLength = null;
|
|
@@ -923,13 +923,15 @@ export class BVTRecorder {
|
|
|
923
923
|
}
|
|
924
924
|
async runStep({ step, parametersMap, tags, isFirstStep, listenNetwork }, options) {
|
|
925
925
|
const { skipAfter = true, skipBefore = !isFirstStep } = options || {};
|
|
926
|
+
|
|
927
|
+
const env = path.basename(this.envName, ".json");
|
|
926
928
|
const _env = {
|
|
927
929
|
TOKEN: this.TOKEN,
|
|
928
930
|
TEMP_RUN: true,
|
|
929
931
|
REPORT_FOLDER: this.bvtContext.reportFolder,
|
|
930
932
|
BLINQ_ENV: this.envName,
|
|
931
933
|
DEBUG: "blinq:route",
|
|
932
|
-
BVT_TEMP_SNAPSHOTS_FOLDER: this.tempSnapshotsFolder,
|
|
934
|
+
BVT_TEMP_SNAPSHOTS_FOLDER: path.join(this.tempSnapshotsFolder, env),
|
|
933
935
|
};
|
|
934
936
|
|
|
935
937
|
this.bvtContext.navigate = true;
|
|
@@ -976,7 +978,7 @@ export class BVTRecorder {
|
|
|
976
978
|
this.bvtContext.navigate = false;
|
|
977
979
|
}
|
|
978
980
|
}
|
|
979
|
-
async saveScenario({ scenario, featureName, override, isSingleStep, branch, isEditing }) {
|
|
981
|
+
async saveScenario({ scenario, featureName, override, isSingleStep, branch, isEditing, env }) {
|
|
980
982
|
// await updateStepDefinitions({ scenario, featureName, projectDir: this.projectDir }); // updates mjs files
|
|
981
983
|
// if (!isSingleStep) await updateFeatureFile({ featureName, scenario, override, projectDir: this.projectDir }); // updates gherkin files
|
|
982
984
|
const res = await this.workspaceService.saveScenario({
|
|
@@ -987,6 +989,7 @@ export class BVTRecorder {
|
|
|
987
989
|
branch,
|
|
988
990
|
isEditing,
|
|
989
991
|
projectId: path.basename(this.projectDir),
|
|
992
|
+
env,
|
|
990
993
|
});
|
|
991
994
|
if (res.success) {
|
|
992
995
|
await this.cleanup({ tags: scenario.tags });
|
|
@@ -153,7 +153,7 @@ export class PublishService {
|
|
|
153
153
|
constructor(TOKEN) {
|
|
154
154
|
this.TOKEN = TOKEN;
|
|
155
155
|
}
|
|
156
|
-
async saveScenario({ scenario, featureName, override, branch, isEditing, projectId }) {
|
|
156
|
+
async saveScenario({ scenario, featureName, override, branch, isEditing, projectId, env }) {
|
|
157
157
|
const runsURL = getRunsServiceBaseURL();
|
|
158
158
|
const workspaceURL = runsURL.replace("/runs", "/workspace");
|
|
159
159
|
const url = `${workspaceURL}/publish-recording`;
|
|
@@ -164,6 +164,7 @@ export class PublishService {
|
|
|
164
164
|
scenario,
|
|
165
165
|
featureName,
|
|
166
166
|
override,
|
|
167
|
+
env,
|
|
167
168
|
},
|
|
168
169
|
params: {
|
|
169
170
|
branch,
|