plum-e2e 1.0.2 → 1.0.4

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.
Files changed (43) hide show
  1. package/.prettierrc +15 -15
  2. package/README.md +66 -5
  3. package/backend/_scaffold/pages/LoginPage.js +22 -22
  4. package/backend/_scaffold/step_definitions/LoginSteps.js +9 -9
  5. package/backend/_scaffold/utils/constants.js +3 -3
  6. package/backend/_scaffold/utils/hooks.js +65 -65
  7. package/backend/_scaffold/utils/utils.js +10 -10
  8. package/backend/app.js +37 -37
  9. package/backend/config/scripts/create-settings.js +60 -60
  10. package/backend/config/scripts/generate-report.js +135 -135
  11. package/backend/config/scripts/run-tests.js +37 -37
  12. package/backend/cucumber.json +6 -6
  13. package/backend/package.json +29 -29
  14. package/backend/playwright.config.js +97 -97
  15. package/backend/routes/cron.routes.js +127 -127
  16. package/backend/routes/reports.routes.js +42 -42
  17. package/backend/routes/schedules.routes.js +32 -32
  18. package/backend/routes/tests.routes.js +33 -33
  19. package/backend/server.js +39 -39
  20. package/backend/services/cronService.js +127 -127
  21. package/backend/services/envService.js +43 -43
  22. package/backend/services/reportService.js +50 -50
  23. package/backend/services/scheduleService.js +34 -34
  24. package/backend/services/testService.js +70 -70
  25. package/backend/websockets/socketHandler.js +46 -46
  26. package/bin/plum.js +198 -198
  27. package/docker-compose.yml +41 -41
  28. package/frontend/jsconfig.json +13 -13
  29. package/frontend/package.json +26 -26
  30. package/frontend/postcss.config.js +23 -23
  31. package/frontend/src/app.css +35 -35
  32. package/frontend/src/app.html +28 -28
  33. package/frontend/src/lib/index.js +18 -18
  34. package/frontend/src/routes/+layout.svelte +34 -34
  35. package/frontend/src/routes/+page.svelte +188 -188
  36. package/frontend/src/routes/components/Navigation.svelte +53 -53
  37. package/frontend/src/routes/reports/+page.svelte +160 -160
  38. package/frontend/src/routes/scheduled-tests/+page.svelte +363 -363
  39. package/frontend/svelte.config.js +30 -30
  40. package/frontend/tailwind.config.js +44 -44
  41. package/frontend/vite.config.js +23 -23
  42. package/license-config.json +37 -37
  43. package/package.json +32 -28
@@ -1,53 +1,53 @@
1
- <!--
2
- * This file is part of Plum.
3
- *
4
- * Plum is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation, either version 3 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * Plum is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with Plum. If not, see https://www.gnu.org/licenses/.
16
- -->
17
-
18
- <div class="navbar bg-base-100">
19
- <div class="navbar-start">
20
- <div class="dropdown">
21
- <div tabindex="0" role="button" class="btn btn-ghost lg:hidden">
22
- <svg
23
- xmlns="http://www.w3.org/2000/svg"
24
- class="h-5 w-5"
25
- fill="none"
26
- viewBox="0 0 24 24"
27
- stroke="currentColor"
28
- >
29
- <path
30
- stroke-linecap="round"
31
- stroke-linejoin="round"
32
- stroke-width="2"
33
- d="M4 6h16M4 12h8m-8 6h16"
34
- />
35
- </svg>
36
- </div>
37
- <ul class="menu menu-sm dropdown-content bg-base-100 rounded-box z-[1] mt-3 w-52 p-2 shadow">
38
- <li><a href="/">Home</a></li>
39
- <li><a href="/reports">Reports</a></li>
40
- <li><a href="/scheduled-tests">Scheduled Tests</a></li>
41
- </ul>
42
- </div>
43
- <a href="/" class="btn btn-ghost text-xl">Plum</a>
44
- </div>
45
- <div class="navbar-center hidden lg:flex">
46
- <ul class="menu menu-horizontal px-1">
47
- <li><a href="/">Home</a></li>
48
- <li><a href="/reports">Reports</a></li>
49
- <li><a href="/scheduled-tests">Scheduled Tests</a></li>
50
- </ul>
51
- </div>
52
- <div class="navbar-end"></div>
53
- </div>
1
+ <!--
2
+ * This file is part of Plum.
3
+ *
4
+ * Plum is free software: you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation, either version 3 of the License, or
7
+ * (at your option) any later version.
8
+ *
9
+ * Plum is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with Plum. If not, see https://www.gnu.org/licenses/.
16
+ -->
17
+
18
+ <div class="navbar bg-base-100">
19
+ <div class="navbar-start">
20
+ <div class="dropdown">
21
+ <div tabindex="0" role="button" class="btn btn-ghost lg:hidden">
22
+ <svg
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ class="h-5 w-5"
25
+ fill="none"
26
+ viewBox="0 0 24 24"
27
+ stroke="currentColor"
28
+ >
29
+ <path
30
+ stroke-linecap="round"
31
+ stroke-linejoin="round"
32
+ stroke-width="2"
33
+ d="M4 6h16M4 12h8m-8 6h16"
34
+ />
35
+ </svg>
36
+ </div>
37
+ <ul class="menu menu-sm dropdown-content bg-base-100 rounded-box z-[1] mt-3 w-52 p-2 shadow">
38
+ <li><a href="/">Home</a></li>
39
+ <li><a href="/reports">Reports</a></li>
40
+ <li><a href="/scheduled-tests">Scheduled Tests</a></li>
41
+ </ul>
42
+ </div>
43
+ <a href="/" class="btn btn-ghost text-xl">Plum</a>
44
+ </div>
45
+ <div class="navbar-center hidden lg:flex">
46
+ <ul class="menu menu-horizontal px-1">
47
+ <li><a href="/">Home</a></li>
48
+ <li><a href="/reports">Reports</a></li>
49
+ <li><a href="/scheduled-tests">Scheduled Tests</a></li>
50
+ </ul>
51
+ </div>
52
+ <div class="navbar-end"></div>
53
+ </div>
@@ -1,160 +1,160 @@
1
- <!--
2
- * This file is part of Plum.
3
- *
4
- * Plum is free software: you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation, either version 3 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * Plum is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with Plum. If not, see https://www.gnu.org/licenses/.
16
- -->
17
-
18
- <script>
19
- import { onMount } from 'svelte';
20
-
21
- let reports = [];
22
- let currentPage = 1;
23
- const itemsPerPage = 10;
24
-
25
- async function fetchReports() {
26
- const response = await fetch('http://localhost:3001/reports');
27
- const data = await response.json();
28
-
29
- reports = data.reports.map((fileName) => {
30
- // Updated regex to capture the trigger type and tags inside parentheses
31
- const match = fileName.match(
32
- /(PASS|FAIL)_cucumber_report_([^_]+)_\(([^)]+)\)_(\d{4})_(\d{2})_(\d{2})T(\d{2})_(\d{2})_(\d{2})_\d{3}Z\.html/
33
- );
34
- if (!match)
35
- return {
36
- fileName,
37
- status: 'Unknown',
38
- triggerType: 'Invalid Trigger',
39
- tags: 'Invalid Tags',
40
- date: 'Invalid Date'
41
- };
42
-
43
- const [_, status, triggerType, tagsString, year, month, day, hour, minute, second] = match;
44
-
45
- // Format date properly
46
- const rawDate = new Date(`${year}-${month}-${day}T${hour}:${minute}:${second}Z`);
47
- const formattedDate = rawDate.toLocaleString();
48
-
49
- return { fileName, status, triggerType, tags: tagsString, date: formattedDate };
50
- });
51
- }
52
-
53
- // Calculate the start and end indices for pagination
54
- function paginatedReports() {
55
- const startIndex = (currentPage - 1) * itemsPerPage;
56
- const endIndex = startIndex + itemsPerPage;
57
- return reports.slice(startIndex, endIndex);
58
- }
59
-
60
- function goToPage(pageNumber) {
61
- if (pageNumber < 1 || pageNumber > totalPages()) return;
62
- currentPage = pageNumber;
63
- }
64
-
65
- function totalPages() {
66
- return Math.ceil(reports.length / itemsPerPage);
67
- }
68
-
69
- onMount(fetchReports);
70
- </script>
71
-
72
- <div class="flex justify-center items-center w-full my-4">
73
- <div class="card bg-base-300 rounded-box p-4">
74
- <div class="card-body text-left">
75
- <h2 class="card-title sticky top-0 bg-base-300 z-10">Reports</h2>
76
- <div class="mt-4">
77
- {#if reports.length > 0}
78
- <div class="overflow-x-auto">
79
- <table class="table">
80
- <thead>
81
- <tr>
82
- <th>Status</th>
83
- <th>Type</th>
84
- <th>Tags</th>
85
- <th>Date</th>
86
- </tr>
87
- </thead>
88
- <tbody>
89
- {#each paginatedReports() as report}
90
- <tr
91
- on:click={() =>
92
- window.open(`http://localhost:3001/reports/${report.fileName}`, '_blank')}
93
- style="cursor: pointer;"
94
- >
95
- <td>
96
- <span
97
- class="badge"
98
- class:badge-success={report.status === 'PASS'}
99
- class:badge-error={report.status === 'FAIL'}
100
- >
101
- {report.status}
102
- </span>
103
- </td>
104
- <td>
105
- {#if report.triggerType === 'manual-trigger'}
106
- <span class="badge badge-primary">Manual Trigger</span>
107
- {:else if report.triggerType === 'command-line-trigger'}
108
- <span class="badge badge-primary">CLI Trigger</span>
109
- {:else}
110
- <span class="badge badge-secondary">Scheduled: {report.triggerType}</span>
111
- {/if}
112
- </td>
113
- <td>
114
- <span class="badge badge-neutral">
115
- {report.tags}
116
- </span>
117
- </td>
118
- <td>
119
- {report.date}
120
- </td>
121
- </tr>
122
- {/each}
123
- </tbody>
124
- </table>
125
- </div>
126
- <!-- Pagination Controls -->
127
- <div class="flex justify-center mt-4">
128
- <div class="btn-group">
129
- <button
130
- class="btn btn-ghost"
131
- on:click={() => goToPage(currentPage - 1)}
132
- disabled={currentPage === 1}
133
- >
134
- Previous
135
- </button>
136
- {#each Array(totalPages()) as _, i}
137
- <button
138
- class="btn mx-1"
139
- on:click={() => goToPage(i + 1)}
140
- class:btn-active={currentPage === i + 1}
141
- >
142
- {i + 1}
143
- </button>
144
- {/each}
145
- <button
146
- class="btn btn-primary"
147
- on:click={() => goToPage(currentPage + 1)}
148
- disabled={currentPage === totalPages()}
149
- >
150
- Next
151
- </button>
152
- </div>
153
- </div>
154
- {:else}
155
- <p>No reports available.</p>
156
- {/if}
157
- </div>
158
- </div>
159
- </div>
160
- </div>
1
+ <!--
2
+ * This file is part of Plum.
3
+ *
4
+ * Plum is free software: you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation, either version 3 of the License, or
7
+ * (at your option) any later version.
8
+ *
9
+ * Plum is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with Plum. If not, see https://www.gnu.org/licenses/.
16
+ -->
17
+
18
+ <script>
19
+ import { onMount } from 'svelte';
20
+
21
+ let reports = [];
22
+ let currentPage = 1;
23
+ const itemsPerPage = 10;
24
+
25
+ async function fetchReports() {
26
+ const response = await fetch('http://localhost:3001/reports');
27
+ const data = await response.json();
28
+
29
+ reports = data.reports.map((fileName) => {
30
+ // Updated regex to capture the trigger type and tags inside parentheses
31
+ const match = fileName.match(
32
+ /(PASS|FAIL)_cucumber_report_([^_]+)_\(([^)]+)\)_(\d{4})_(\d{2})_(\d{2})T(\d{2})_(\d{2})_(\d{2})_\d{3}Z\.html/
33
+ );
34
+ if (!match)
35
+ return {
36
+ fileName,
37
+ status: 'Unknown',
38
+ triggerType: 'Invalid Trigger',
39
+ tags: 'Invalid Tags',
40
+ date: 'Invalid Date'
41
+ };
42
+
43
+ const [_, status, triggerType, tagsString, year, month, day, hour, minute, second] = match;
44
+
45
+ // Format date properly
46
+ const rawDate = new Date(`${year}-${month}-${day}T${hour}:${minute}:${second}Z`);
47
+ const formattedDate = rawDate.toLocaleString();
48
+
49
+ return { fileName, status, triggerType, tags: tagsString, date: formattedDate };
50
+ });
51
+ }
52
+
53
+ // Calculate the start and end indices for pagination
54
+ function paginatedReports() {
55
+ const startIndex = (currentPage - 1) * itemsPerPage;
56
+ const endIndex = startIndex + itemsPerPage;
57
+ return reports.slice(startIndex, endIndex);
58
+ }
59
+
60
+ function goToPage(pageNumber) {
61
+ if (pageNumber < 1 || pageNumber > totalPages()) return;
62
+ currentPage = pageNumber;
63
+ }
64
+
65
+ function totalPages() {
66
+ return Math.ceil(reports.length / itemsPerPage);
67
+ }
68
+
69
+ onMount(fetchReports);
70
+ </script>
71
+
72
+ <div class="flex justify-center items-center w-full my-4">
73
+ <div class="card bg-base-300 rounded-box p-4">
74
+ <div class="card-body text-left">
75
+ <h2 class="card-title sticky top-0 bg-base-300 z-10">Reports</h2>
76
+ <div class="mt-4">
77
+ {#if reports.length > 0}
78
+ <div class="overflow-x-auto">
79
+ <table class="table">
80
+ <thead>
81
+ <tr>
82
+ <th>Status</th>
83
+ <th>Type</th>
84
+ <th>Tags</th>
85
+ <th>Date</th>
86
+ </tr>
87
+ </thead>
88
+ <tbody>
89
+ {#each paginatedReports() as report}
90
+ <tr
91
+ on:click={() =>
92
+ window.open(`http://localhost:3001/reports/${report.fileName}`, '_blank')}
93
+ style="cursor: pointer;"
94
+ >
95
+ <td>
96
+ <span
97
+ class="badge"
98
+ class:badge-success={report.status === 'PASS'}
99
+ class:badge-error={report.status === 'FAIL'}
100
+ >
101
+ {report.status}
102
+ </span>
103
+ </td>
104
+ <td>
105
+ {#if report.triggerType === 'manual-trigger'}
106
+ <span class="badge badge-primary">Manual Trigger</span>
107
+ {:else if report.triggerType === 'command-line-trigger'}
108
+ <span class="badge badge-primary">CLI Trigger</span>
109
+ {:else}
110
+ <span class="badge badge-secondary">Scheduled: {report.triggerType}</span>
111
+ {/if}
112
+ </td>
113
+ <td>
114
+ <span class="badge badge-neutral">
115
+ {report.tags}
116
+ </span>
117
+ </td>
118
+ <td>
119
+ {report.date}
120
+ </td>
121
+ </tr>
122
+ {/each}
123
+ </tbody>
124
+ </table>
125
+ </div>
126
+ <!-- Pagination Controls -->
127
+ <div class="flex justify-center mt-4">
128
+ <div class="btn-group">
129
+ <button
130
+ class="btn btn-ghost"
131
+ on:click={() => goToPage(currentPage - 1)}
132
+ disabled={currentPage === 1}
133
+ >
134
+ Previous
135
+ </button>
136
+ {#each Array(totalPages()) as _, i}
137
+ <button
138
+ class="btn mx-1"
139
+ on:click={() => goToPage(i + 1)}
140
+ class:btn-active={currentPage === i + 1}
141
+ >
142
+ {i + 1}
143
+ </button>
144
+ {/each}
145
+ <button
146
+ class="btn btn-primary"
147
+ on:click={() => goToPage(currentPage + 1)}
148
+ disabled={currentPage === totalPages()}
149
+ >
150
+ Next
151
+ </button>
152
+ </div>
153
+ </div>
154
+ {:else}
155
+ <p>No reports available.</p>
156
+ {/if}
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>