testdriverai 4.0.46 → 4.0.48

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.
package/index.js CHANGED
@@ -485,6 +485,7 @@ const generate = async (type) => {
485
485
 
486
486
  // for each testPrompt
487
487
  for (const testPrompt of testPrompts) {
488
+
488
489
  // with the contents of the testPrompt
489
490
  let fileName =
490
491
  sanitizeFilename(testPrompt.headings[0])
@@ -497,7 +498,8 @@ const generate = async (type) => {
497
498
  fs.mkdirSync(path.join(process.cwd(), "testdriver", "generate"));
498
499
  }
499
500
  let list = testPrompt.listsOrdered[0];
500
- list.append(`/save testdriver/${fileName}`);
501
+
502
+ list.push(`/save testdriver/${fileName}`);
501
503
  let contents = list
502
504
  .map((item, index) => `${index + 1}. /explore ${item}`)
503
505
  .join("\n");
package/lib/analytics.js CHANGED
@@ -3,10 +3,10 @@ const config = require("./config");
3
3
 
4
4
  module.exports = {
5
5
  track: async (event, data) => {
6
- if (config["TD_ANALYTICS"]) {
6
+ if (!config["TD_ANALYTICS"]) {
7
7
  return;
8
8
  } else {
9
- sdk.req("analytics", { event, data });
9
+ await sdk.req("analytics", { event, data });
10
10
  }
11
11
  },
12
12
  };
package/lib/commander.js CHANGED
@@ -6,6 +6,7 @@ const yaml = require("js-yaml");
6
6
  const speak = require("./speak");
7
7
  const notify = require("./notify");
8
8
  const analytics = require("./analytics");
9
+ const marky = require('marky');
9
10
 
10
11
  // object is a json representation of the individual yml command
11
12
  // the process turns markdown -> yml -> json -> js function execution
@@ -35,7 +36,7 @@ commands:
35
36
  } else {
36
37
  let copy = JSON.parse(JSON.stringify(object));
37
38
 
38
- analytics.track("command", { data: object, depth });
39
+ marky.mark(object.command);
39
40
 
40
41
  // we speak, log, and take images here because we want to be careful not to render a notification containing the text we're looking for
41
42
  // or to cover the screen of some item we might want
@@ -176,6 +177,9 @@ commands:
176
177
  }
177
178
  }
178
179
 
180
+ let timing = marky.stop(object.command);
181
+ await analytics.track("command", { data: object, depth, timing});
182
+
179
183
  return response;
180
184
  };
181
185
 
package/lib/config.js CHANGED
@@ -23,7 +23,7 @@ function parseValue(value) {
23
23
  // Object for TD related config, with defaults
24
24
  const config = {
25
25
  TD_SPEAK: false,
26
- TD_ANALYTICS: false,
26
+ TD_ANALYTICS: true,
27
27
  TD_NOTIFY: false,
28
28
  TD_API_ROOT: "https://replayable-api-production.herokuapp.com",
29
29
  TD_DEV: parseValue(process.env["DEV"]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "4.0.46",
3
+ "version": "4.0.48",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -29,6 +29,7 @@
29
29
  "markdown-parser": "0.0.8",
30
30
  "marked": "^12.0.1",
31
31
  "marked-terminal": "^7.0.0",
32
+ "marky": "^1.2.5",
32
33
  "node-notifier": "^10.0.1",
33
34
  "prompts": "^2.4.2",
34
35
  "remark-parse": "^11.0.0",