ortoni-report 3.0.3 → 3.0.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.
package/changelog.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Change Log:
2
2
 
3
+ ## v3.0.4
4
+
5
+ #### 🐛 Bug Fixes
6
+
7
+ - Fixed timeZone - #88
8
+ - Fixed markdown open page - #87
9
+
10
+ ## v3.0.4
11
+
12
+ #### 🐛 Bug Fixes
13
+
14
+ - Chart not showing latest trends
15
+
3
16
  ## v3.0.3
4
17
 
5
18
  #### 📦 New Features
@@ -215,7 +215,7 @@ function formatDateLocal(isoString) {
215
215
  hour: "2-digit",
216
216
  minute: "2-digit",
217
217
  hour12: true,
218
- timeZoneName: "short"
218
+ timeZoneName: "shortOffset"
219
219
  };
220
220
  return new Intl.DateTimeFormat(void 0, options).format(date);
221
221
  }
@@ -1563,9 +1563,39 @@ function convertMarkdownToHtml(markdownPath, htmlOutputPath, stepsError, resultE
1563
1563
  code, pre { background: #f4f4f4; padding: 0.5rem; border-radius: 5px; display: block; overflow-x: auto; }
1564
1564
  h1, h2, h3 { color: #444; }
1565
1565
  hr { margin: 2em 0; }
1566
+ #copyBtn {
1567
+ background-color: #007acc;
1568
+ color: white;
1569
+ border: none;
1570
+ padding: 0.5rem 1rem;
1571
+ margin-bottom: 1rem;
1572
+ border-radius: 5px;
1573
+ cursor: pointer;
1574
+ }
1575
+ #copyBtn:hover {
1576
+ background-color: #005fa3;
1577
+ }
1566
1578
  </style>
1567
1579
  </head>
1568
1580
  <body>
1581
+ <button id="copyBtn">\u{1F4CB} Copy All</button>
1582
+ <script>
1583
+ document.getElementById("copyBtn").addEventListener("click", () => {
1584
+ const content = document.getElementById("markdownContent").innerText;
1585
+ navigator.clipboard.writeText(content).then(() => {
1586
+ // change button text to indicate success
1587
+ const button = document.getElementById("copyBtn");
1588
+ button.textContent = "\u2705 Copied!";
1589
+ setTimeout(() => {
1590
+ button.textContent = "\u{1F4CB} Copy All"
1591
+ }, 2000);
1592
+ }).catch(err => {
1593
+ console.error("Failed to copy text: ", err);
1594
+ alert("Failed to copy text. Please try manually.");
1595
+ });
1596
+ });
1597
+ </script>
1598
+ <div id="markdownContent">
1569
1599
  <h1>Instructions</h1>
1570
1600
  <ul>
1571
1601
  <li>Following Playwright test failed.</li>
@@ -1575,7 +1605,8 @@ function convertMarkdownToHtml(markdownPath, htmlOutputPath, stepsError, resultE
1575
1605
  <h1>Error Details</h1>
1576
1606
  ${errorHtml || "<p>No errors found.</p>"}
1577
1607
  ${stepsHtml || "<p>No step data available.</p>"}
1578
- ${markdownHtml ? `${markdownHtml}` : ""}
1608
+ ${markdownHtml || ""}
1609
+ </div>
1579
1610
  </body>
1580
1611
  </html>
1581
1612
  `;
@@ -2025,7 +2056,7 @@ var DatabaseManager = class {
2025
2056
  };
2026
2057
  }
2027
2058
  }
2028
- async getTrends(limit = 30) {
2059
+ async getTrends(limit = 100) {
2029
2060
  if (!this.db) {
2030
2061
  console.error("OrtoniReport: Database not initialized");
2031
2062
  return [];
@@ -2040,12 +2071,12 @@ var DatabaseManager = class {
2040
2071
  FROM test_results tr
2041
2072
  JOIN test_runs trun ON tr.run_id = trun.id
2042
2073
  GROUP BY trun.run_date
2043
- ORDER BY trun.run_date ASC
2074
+ ORDER BY trun.run_date DESC
2044
2075
  LIMIT ?
2045
2076
  `,
2046
2077
  [limit]
2047
2078
  );
2048
- return rows.map((row) => ({
2079
+ return rows.reverse().map((row) => ({
2049
2080
  ...row,
2050
2081
  run_date: formatDateLocal(row.run_date),
2051
2082
  avg_duration: Math.round(row.avg_duration || 0)
@@ -182,7 +182,7 @@ function formatDateLocal(isoString) {
182
182
  hour: "2-digit",
183
183
  minute: "2-digit",
184
184
  hour12: true,
185
- timeZoneName: "short"
185
+ timeZoneName: "shortOffset"
186
186
  };
187
187
  return new Intl.DateTimeFormat(void 0, options).format(date);
188
188
  }
@@ -1530,9 +1530,39 @@ function convertMarkdownToHtml(markdownPath, htmlOutputPath, stepsError, resultE
1530
1530
  code, pre { background: #f4f4f4; padding: 0.5rem; border-radius: 5px; display: block; overflow-x: auto; }
1531
1531
  h1, h2, h3 { color: #444; }
1532
1532
  hr { margin: 2em 0; }
1533
+ #copyBtn {
1534
+ background-color: #007acc;
1535
+ color: white;
1536
+ border: none;
1537
+ padding: 0.5rem 1rem;
1538
+ margin-bottom: 1rem;
1539
+ border-radius: 5px;
1540
+ cursor: pointer;
1541
+ }
1542
+ #copyBtn:hover {
1543
+ background-color: #005fa3;
1544
+ }
1533
1545
  </style>
1534
1546
  </head>
1535
1547
  <body>
1548
+ <button id="copyBtn">\u{1F4CB} Copy All</button>
1549
+ <script>
1550
+ document.getElementById("copyBtn").addEventListener("click", () => {
1551
+ const content = document.getElementById("markdownContent").innerText;
1552
+ navigator.clipboard.writeText(content).then(() => {
1553
+ // change button text to indicate success
1554
+ const button = document.getElementById("copyBtn");
1555
+ button.textContent = "\u2705 Copied!";
1556
+ setTimeout(() => {
1557
+ button.textContent = "\u{1F4CB} Copy All"
1558
+ }, 2000);
1559
+ }).catch(err => {
1560
+ console.error("Failed to copy text: ", err);
1561
+ alert("Failed to copy text. Please try manually.");
1562
+ });
1563
+ });
1564
+ </script>
1565
+ <div id="markdownContent">
1536
1566
  <h1>Instructions</h1>
1537
1567
  <ul>
1538
1568
  <li>Following Playwright test failed.</li>
@@ -1542,7 +1572,8 @@ function convertMarkdownToHtml(markdownPath, htmlOutputPath, stepsError, resultE
1542
1572
  <h1>Error Details</h1>
1543
1573
  ${errorHtml || "<p>No errors found.</p>"}
1544
1574
  ${stepsHtml || "<p>No step data available.</p>"}
1545
- ${markdownHtml ? `${markdownHtml}` : ""}
1575
+ ${markdownHtml || ""}
1576
+ </div>
1546
1577
  </body>
1547
1578
  </html>
1548
1579
  `;
@@ -1931,7 +1962,7 @@ var DatabaseManager = class {
1931
1962
  };
1932
1963
  }
1933
1964
  }
1934
- async getTrends(limit = 30) {
1965
+ async getTrends(limit = 100) {
1935
1966
  if (!this.db) {
1936
1967
  console.error("OrtoniReport: Database not initialized");
1937
1968
  return [];
@@ -1946,12 +1977,12 @@ var DatabaseManager = class {
1946
1977
  FROM test_results tr
1947
1978
  JOIN test_runs trun ON tr.run_id = trun.id
1948
1979
  GROUP BY trun.run_date
1949
- ORDER BY trun.run_date ASC
1980
+ ORDER BY trun.run_date DESC
1950
1981
  LIMIT ?
1951
1982
  `,
1952
1983
  [limit]
1953
1984
  );
1954
- return rows.map((row) => ({
1985
+ return rows.reverse().map((row) => ({
1955
1986
  ...row,
1956
1987
  run_date: formatDateLocal(row.run_date),
1957
1988
  avg_duration: Math.round(row.avg_duration || 0)
@@ -1,7 +1,7 @@
1
1
  <head>
2
2
  <meta charset="UTF-8" />
3
3
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
4
- <meta name="description" content="Ortoni Report - V3.0.3" />
4
+ <meta name="description" content="Ortoni Report - V3.0.5" />
5
5
  <title>{{title}}</title>
6
6
  <link rel="icon" href="https://raw.githubusercontent.com/ortoniKC/ortoni-report/refs/heads/main/favicon.png"
7
7
  type="image/x-icon" />
@@ -548,8 +548,9 @@
548
548
  content += `
549
549
  <div class="column">
550
550
  <button
551
- onclick="window.open('${test.markdownPath}', '_blank')"
552
- class="button is-primary is-fullwidth mt-3">
551
+ class="button is-primary is-fullwidth mt-3"
552
+ data-markdown="${test.markdownPath}"
553
+ onclick="openMarkdown(this)">
553
554
  <span class="icon"><i class="fa-solid fa-file-lines"></i></span>
554
555
  <span class="has-text-white pl-2">Open Markdown</span>
555
556
  </button>
@@ -1271,6 +1272,15 @@
1271
1272
  window.open(`${baseUrl}/trace/index.html?trace=${baseUrl}/${normalizedTracePath}`, "_blank");
1272
1273
  }
1273
1274
  };
1275
+ window.openMarkdown = (button) => {
1276
+ const path = button.getAttribute('data-markdown');
1277
+ if (path) {
1278
+ const normalizedPath = path.replace(/\\/g, '/');
1279
+ const baseUrl = Utils.getAdjustedBaseUrl();
1280
+ const fullUrl = `${baseUrl.replace(/\/$/, '')}/${normalizedPath.replace(/^\//, '')}`;
1281
+ window.open(fullUrl, '_blank');
1282
+ }
1283
+ };
1274
1284
  window.getAdjustedBaseUrl = Utils.getAdjustedBaseUrl;
1275
1285
  window.copyFilePath = Utils.copyFilePath
1276
1286
  window.openHistory = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ortoni-report",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "Playwright Report By LetCode with Koushik",
5
5
  "scripts": {
6
6
  "tsc": "tsc",