donobu 2.23.3 → 2.23.5

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.
@@ -1 +1 @@
1
- 1257
1
+ 1260
@@ -29,12 +29,6 @@ function formatDuration(ms) {
29
29
  return `${minutes}m ${remainingSeconds}s`;
30
30
  }
31
31
 
32
- // Function to format date in a readable way
33
- function formatDate(dateString) {
34
- const date = new Date(dateString);
35
- return date.toLocaleString();
36
- }
37
-
38
32
  // Read the JSON data from file or stdin
39
33
  function readInput() {
40
34
  const args = process.argv.slice(2);
@@ -47,7 +41,7 @@ function readInput() {
47
41
 
48
42
  // Process JSON and create markdown
49
43
  function generateMarkdown(jsonData) {
50
- const { suites, stats } = jsonData;
44
+ const { suites } = jsonData;
51
45
 
52
46
  // Count self-healed tests
53
47
  let selfHealedCount = 0;
@@ -100,7 +94,12 @@ function generateMarkdown(jsonData) {
100
94
  test.annotations &&
101
95
  test.annotations.some((a) => a.type === 'self-healed');
102
96
 
103
- if (result) {
97
+ if (
98
+ test.status === 'skipped' ||
99
+ (!result && test.status === undefined)
100
+ ) {
101
+ skipped++;
102
+ } else if (result) {
104
103
  if (isSelfHealed) {
105
104
  selfHealed++;
106
105
  } else {
@@ -148,7 +147,7 @@ function generateMarkdown(jsonData) {
148
147
 
149
148
  // Generate test details sections
150
149
  suites.forEach((suite) => {
151
- const fileName = suite.file.split('/').pop();
150
+ const fileName = suite.file;
152
151
  markdown += `## ${fileName}\n\n`;
153
152
 
154
153
  suite.specs.forEach((spec) => {
@@ -157,11 +156,25 @@ function generateMarkdown(jsonData) {
157
156
  spec.tests.forEach((test) => {
158
157
  const result = test.results && test.results.at(-1);
159
158
 
160
- // Skip tests without results
161
- if (!result) {
162
- markdown += `**Status**: ⚠️ No Results\n`;
163
- markdown += `**Duration**: N/A\n`;
164
- markdown += `**Objective**: Test skipped or no results available\n`;
159
+ if (test.status === 'skipped' || !result || test.status !== undefined) {
160
+ markdown += `**Status**: ⏭️ Skipped \n`;
161
+ markdown += `**Duration**: N/A \n`;
162
+ // Get objective from annotations if available
163
+ let objective = 'No objective provided';
164
+
165
+ if (test.annotations) {
166
+ const objectiveAnnotation = test.annotations.find(
167
+ (a) => a.type === 'objective',
168
+ );
169
+ if (objectiveAnnotation) {
170
+ objective =
171
+ objectiveAnnotation.description || 'No objective provided';
172
+ }
173
+ }
174
+
175
+ // Escape any existing triple backticks in the objective
176
+ objective = objective.replace(/```/g, '\\`\\`\\`');
177
+ markdown += `**Objective**:\n\`\`\`\n${objective}\n\`\`\`\n`;
165
178
  markdown += `---\n\n`;
166
179
  return;
167
180
  }
@@ -1 +1 @@
1
- 1257
1
+ 1260
@@ -29,12 +29,6 @@ function formatDuration(ms) {
29
29
  return `${minutes}m ${remainingSeconds}s`;
30
30
  }
31
31
 
32
- // Function to format date in a readable way
33
- function formatDate(dateString) {
34
- const date = new Date(dateString);
35
- return date.toLocaleString();
36
- }
37
-
38
32
  // Read the JSON data from file or stdin
39
33
  function readInput() {
40
34
  const args = process.argv.slice(2);
@@ -47,7 +41,7 @@ function readInput() {
47
41
 
48
42
  // Process JSON and create markdown
49
43
  function generateMarkdown(jsonData) {
50
- const { suites, stats } = jsonData;
44
+ const { suites } = jsonData;
51
45
 
52
46
  // Count self-healed tests
53
47
  let selfHealedCount = 0;
@@ -100,7 +94,12 @@ function generateMarkdown(jsonData) {
100
94
  test.annotations &&
101
95
  test.annotations.some((a) => a.type === 'self-healed');
102
96
 
103
- if (result) {
97
+ if (
98
+ test.status === 'skipped' ||
99
+ (!result && test.status === undefined)
100
+ ) {
101
+ skipped++;
102
+ } else if (result) {
104
103
  if (isSelfHealed) {
105
104
  selfHealed++;
106
105
  } else {
@@ -148,7 +147,7 @@ function generateMarkdown(jsonData) {
148
147
 
149
148
  // Generate test details sections
150
149
  suites.forEach((suite) => {
151
- const fileName = suite.file.split('/').pop();
150
+ const fileName = suite.file;
152
151
  markdown += `## ${fileName}\n\n`;
153
152
 
154
153
  suite.specs.forEach((spec) => {
@@ -157,11 +156,25 @@ function generateMarkdown(jsonData) {
157
156
  spec.tests.forEach((test) => {
158
157
  const result = test.results && test.results.at(-1);
159
158
 
160
- // Skip tests without results
161
- if (!result) {
162
- markdown += `**Status**: ⚠️ No Results\n`;
163
- markdown += `**Duration**: N/A\n`;
164
- markdown += `**Objective**: Test skipped or no results available\n`;
159
+ if (test.status === 'skipped' || !result || test.status !== undefined) {
160
+ markdown += `**Status**: ⏭️ Skipped \n`;
161
+ markdown += `**Duration**: N/A \n`;
162
+ // Get objective from annotations if available
163
+ let objective = 'No objective provided';
164
+
165
+ if (test.annotations) {
166
+ const objectiveAnnotation = test.annotations.find(
167
+ (a) => a.type === 'objective',
168
+ );
169
+ if (objectiveAnnotation) {
170
+ objective =
171
+ objectiveAnnotation.description || 'No objective provided';
172
+ }
173
+ }
174
+
175
+ // Escape any existing triple backticks in the objective
176
+ objective = objective.replace(/```/g, '\\`\\`\\`');
177
+ markdown += `**Objective**:\n\`\`\`\n${objective}\n\`\`\`\n`;
165
178
  markdown += `---\n\n`;
166
179
  return;
167
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donobu",
3
- "version": "2.23.3",
3
+ "version": "2.23.5",
4
4
  "description": "Create browser automations with an LLM agent and replay them as Playwright scripts.",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/esm/main.js",