doc-detective 3.4.0-dev.5 → 3.4.0-dev.7

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "input": "dev.spec.json",
3
+ "logLevel": "debug",
4
+ "integrations": {
5
+ "docDetectiveApi": {
6
+ "apiKey": "cd6f10bf0a47db1436cb3294b54e4f3e1599ca64be0313039fb0fc474ec8d116"
7
+ }
8
+ }
9
+ }
package/dev/dev.spec.json CHANGED
@@ -1,45 +1,19 @@
1
1
  {
2
- "id": "Do all the things! - Spec",
3
2
  "tests": [
4
3
  {
5
- "id": "Do all the things! - Test",
6
- "description": "This test includes nearly every property across all actions.",
7
4
  "steps": [
8
- {
9
- "action": "setVariables",
10
- "path": ".env"
11
- },
12
5
  {
13
6
  "action": "runShell",
14
- "command": "echo",
15
- "args": ["$USER"]
7
+ "command": "echo Hello, World!"
16
8
  },
17
9
  {
18
10
  "action": "checkLink",
19
11
  "url": "https://www.duckduckgo.com"
20
12
  },
21
- {
22
- "action": "httpRequest",
23
- "url": "https://reqres.in/api/users",
24
- "method": "post",
25
- "requestData": {
26
- "name": "morpheus",
27
- "job": "leader"
28
- },
29
- "responseData": {
30
- "name": "morpheus",
31
- "job": "leader"
32
- },
33
- "statusCodes": [200, 201]
34
- },
35
13
  {
36
14
  "action": "goTo",
37
15
  "url": "https://www.google.com"
38
16
  },
39
- {
40
- "action": "startRecording",
41
- "path": "test.mp4"
42
- },
43
17
  {
44
18
  "action": "find",
45
19
  "selector": "[title=Search]",
@@ -49,12 +23,6 @@
49
23
  "typeKeys": {
50
24
  "keys": ["shorthair cat", "$ENTER$"]
51
25
  }
52
- },
53
- {
54
- "action": "wait"
55
- },
56
- {
57
- "action": "stopRecording"
58
26
  }
59
27
  ]
60
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doc-detective",
3
- "version": "3.4.0-dev.5",
3
+ "version": "3.4.0-dev.7",
4
4
  "description": "Treat doc content as testable assertions to validate doc accuracy and product UX.",
5
5
  "bin": {
6
6
  "doc-detective": "src/index.js"
@@ -35,7 +35,7 @@
35
35
  "@ffmpeg-installer/ffmpeg": "^1.1.0",
36
36
  "axios": "^1.12.2",
37
37
  "doc-detective-common": "3.4.0-dev.1",
38
- "doc-detective-core": "3.4.0-dev.3",
38
+ "doc-detective-core": "3.4.0-dev.5",
39
39
  "yargs": "^17.7.2"
40
40
  },
41
41
  "devDependencies": {
package/src/utils.js CHANGED
@@ -93,10 +93,10 @@ async function getResolvedTestsFromEnv(config = {}) {
93
93
  process.exit(1);
94
94
  }
95
95
 
96
- log(`CLI:Fetching resolved tests from ${apiConfig.url}`, "debug", config);
96
+ log(`CLI:Fetching resolved tests from ${apiConfig.url}/resolved-tests`, "debug", config);
97
97
 
98
98
  // Make GET request to the specified URL with token in header
99
- const response = await axios.get(apiConfig.url, {
99
+ const response = await axios.get(`${apiConfig.url}/resolved-tests`, {
100
100
  headers: {
101
101
  "x-runner-token": apiConfig.token,
102
102
  },
@@ -747,13 +747,13 @@ async function reportResults({ apiConfig, results }) {
747
747
 
748
748
  // Convert result status to lowercase (PASS -> passed, FAIL -> failed, etc.)
749
749
  let status;
750
- if (context.result === "PASS") {
750
+ if (context.result.status === "PASS") {
751
751
  status = "passed";
752
- } else if (context.result === "FAIL") {
752
+ } else if (context.result.status === "FAIL") {
753
753
  status = "failed";
754
- } else if (context.result === "WARNING") {
754
+ } else if (context.result.status === "WARNING") {
755
755
  status = "warning";
756
- } else if (context.result === "SKIPPED") {
756
+ } else if (context.result.status === "SKIPPED") {
757
757
  status = "skipped";
758
758
  } else {
759
759
  status = "unknown";
@@ -777,6 +777,8 @@ async function reportResults({ apiConfig, results }) {
777
777
  const url = `${apiConfig.url}/contexts`;
778
778
  const payload = { contexts };
779
779
 
780
+ console.log(payload);
781
+
780
782
  const response = await axios.post(url, payload, {
781
783
  headers: {
782
784
  "x-runner-token": apiConfig.token,