plum-e2e 1.2.4 → 1.3.1

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 (62) hide show
  1. package/CLAUDE.md +201 -0
  2. package/README.md +245 -90
  3. package/backend/_scaffold/utils/browser.ts +5 -2
  4. package/backend/app.js +9 -1
  5. package/backend/config/scripts/generate-report.js +34 -73
  6. package/backend/config/scripts/run-tests.js +13 -3
  7. package/backend/constants/triggers.js +67 -0
  8. package/backend/lib/reportFilename.js +37 -0
  9. package/backend/lib/testChunker.js +73 -0
  10. package/backend/middleware/auth.js +32 -0
  11. package/backend/package.json +4 -2
  12. package/backend/prisma/migrations/20260616000000_add_runners_and_browser/migration.sql +26 -0
  13. package/backend/prisma/migrations/20260616000001_cron_runner_ids/migration.sql +6 -0
  14. package/backend/prisma/migrations/20260617000000_cron_enabled/migration.sql +1 -0
  15. package/backend/prisma/migrations/20260617000001_report_content/migration.sql +8 -0
  16. package/backend/prisma/schema.prisma +21 -1
  17. package/backend/routes/cron.routes.js +28 -0
  18. package/backend/routes/node.routes.js +121 -0
  19. package/backend/routes/reports.routes.js +23 -20
  20. package/backend/routes/runners.routes.js +83 -0
  21. package/backend/scripts/add-local-runner.js +120 -0
  22. package/backend/scripts/create-test.js +148 -0
  23. package/backend/server.js +16 -7
  24. package/backend/services/backupService.js +3 -30
  25. package/backend/services/cronService.js +220 -36
  26. package/backend/services/reportService.js +227 -55
  27. package/backend/services/runnerService.js +179 -0
  28. package/backend/websockets/socketHandler.js +162 -21
  29. package/bin/plum.js +160 -31
  30. package/docker-compose.node.yml +59 -0
  31. package/docker-compose.yml +2 -0
  32. package/frontend/package.json +1 -4
  33. package/frontend/src/app.css +20 -254
  34. package/frontend/src/app.html +1 -1
  35. package/frontend/src/lib/api/reports.js +17 -36
  36. package/frontend/src/lib/api/runners.js +61 -0
  37. package/frontend/src/lib/api/schedules.js +34 -5
  38. package/frontend/src/lib/api/settings.js +5 -5
  39. package/frontend/src/lib/api/tests.js +2 -19
  40. package/frontend/src/lib/components/icons/BrowserIcon.svelte +75 -0
  41. package/frontend/src/lib/components/layout/Nav.svelte +42 -47
  42. package/frontend/src/lib/components/layout/RunnerPanel.svelte +913 -253
  43. package/frontend/src/lib/components/ui/Badge.svelte +6 -1
  44. package/frontend/src/lib/components/ui/ConfirmModal.svelte +98 -0
  45. package/frontend/{tailwind.config.js → src/lib/components/ui/EmptyState.svelte} +27 -8
  46. package/frontend/{postcss.config.js → src/lib/components/ui/Toast.svelte} +20 -7
  47. package/frontend/src/lib/constants.js +36 -0
  48. package/frontend/src/lib/stores/runner.js +23 -12
  49. package/frontend/src/lib/styles/global.css +176 -0
  50. package/frontend/src/lib/styles/reset.css +86 -0
  51. package/frontend/src/lib/styles/tokens.css +90 -0
  52. package/frontend/src/lib/utils/format.js +46 -0
  53. package/frontend/src/routes/+page.svelte +16 -35
  54. package/frontend/src/routes/reports/+page.svelte +84 -167
  55. package/frontend/src/routes/reports/{[slug] → [id]}/+page.svelte +325 -76
  56. package/frontend/src/routes/reports/live/+page.svelte +704 -0
  57. package/frontend/src/routes/scheduled-tests/+page.svelte +328 -88
  58. package/frontend/src/routes/settings/+page.svelte +774 -127
  59. package/frontend/static/favicon-32x32.png +0 -0
  60. package/frontend/static/favicon.ico +0 -0
  61. package/package.json +1 -1
  62. package/frontend/static/favicon.png +0 -0
@@ -0,0 +1,75 @@
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
+ export let browser = 'chromium';
20
+ export let size = 11;
21
+ </script>
22
+
23
+ {#if browser === 'firefox'}
24
+ <svg
25
+ width={size}
26
+ height={size}
27
+ viewBox="0 0 24 24"
28
+ fill="none"
29
+ stroke="currentColor"
30
+ stroke-width="2"
31
+ stroke-linecap="round"
32
+ stroke-linejoin="round"
33
+ >
34
+ <path d="M12 2c0 4.5-5 7-5 12a5 5 0 0 0 10 0c0-5-5-7.5-5-12z" />
35
+ <path d="M12 9c0 2.5-2.5 4-2.5 7a2.5 2.5 0 0 0 5 0c0-3-2.5-4.5-2.5-7z" />
36
+ </svg>
37
+ {:else if browser === 'webkit'}
38
+ <svg
39
+ width={size}
40
+ height={size}
41
+ viewBox="0 0 24 24"
42
+ fill="none"
43
+ stroke="currentColor"
44
+ stroke-width="2"
45
+ stroke-linecap="round"
46
+ stroke-linejoin="round"
47
+ >
48
+ <circle cx="12" cy="12" r="10" />
49
+ <polygon points="12,5.5 14.5,12 12,10.5 9.5,12" fill="currentColor" stroke="none" />
50
+ <polygon
51
+ points="12,18.5 9.5,12 12,13.5 14.5,12"
52
+ fill="currentColor"
53
+ stroke="none"
54
+ opacity="0.35"
55
+ />
56
+ </svg>
57
+ {:else}
58
+ <!-- chromium -->
59
+ <svg
60
+ width={size}
61
+ height={size}
62
+ viewBox="0 0 24 24"
63
+ fill="none"
64
+ stroke="currentColor"
65
+ stroke-width="2"
66
+ stroke-linecap="round"
67
+ stroke-linejoin="round"
68
+ >
69
+ <circle cx="12" cy="12" r="10" />
70
+ <circle cx="12" cy="12" r="4" />
71
+ <line x1="21.17" y1="8" x2="12" y2="8" />
72
+ <line x1="3.95" y1="6.06" x2="8.54" y2="14" />
73
+ <line x1="10.88" y1="21.94" x2="15.46" y2="14" />
74
+ </svg>
75
+ {/if}
@@ -17,7 +17,6 @@
17
17
 
18
18
  <script>
19
19
  import { page } from '$app/stores';
20
- import { theme } from '$lib/stores/theme';
21
20
  import { slide } from 'svelte/transition';
22
21
 
23
22
  let menuOpen = false;
@@ -25,14 +24,9 @@
25
24
  const links = [
26
25
  { href: '/', label: 'Run Tests' },
27
26
  { href: '/reports', label: 'Reports' },
28
- { href: '/scheduled-tests', label: 'Scheduled' },
29
- { href: '/settings', label: 'Settings' }
27
+ { href: '/scheduled-tests', label: 'Scheduled' }
30
28
  ];
31
29
 
32
- function toggleTheme() {
33
- theme.update((t) => (t === 'light' ? 'dark' : 'light'));
34
- }
35
-
36
30
  function closeMenu() {
37
31
  menuOpen = false;
38
32
  }
@@ -53,43 +47,29 @@
53
47
  </div>
54
48
 
55
49
  <div class="actions">
56
- <button class="theme-btn" on:click={toggleTheme} aria-label="Toggle theme">
57
- {#if $theme === 'light'}
58
- <svg
59
- width="15"
60
- height="15"
61
- viewBox="0 0 24 24"
62
- fill="none"
63
- stroke="currentColor"
64
- stroke-width="2"
65
- stroke-linecap="round"
66
- stroke-linejoin="round"
67
- >
68
- <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" />
69
- </svg>
70
- {:else}
71
- <svg
72
- width="15"
73
- height="15"
74
- viewBox="0 0 24 24"
75
- fill="none"
76
- stroke="currentColor"
77
- stroke-width="2"
78
- stroke-linecap="round"
79
- stroke-linejoin="round"
80
- >
81
- <circle cx="12" cy="12" r="5" />
82
- <line x1="12" y1="1" x2="12" y2="3" />
83
- <line x1="12" y1="21" x2="12" y2="23" />
84
- <line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
85
- <line x1="18.36" y1="18.36" x2="19.78" y2="19.78" />
86
- <line x1="1" y1="12" x2="3" y2="12" />
87
- <line x1="21" y1="12" x2="23" y2="12" />
88
- <line x1="4.22" y1="19.78" x2="5.64" y2="18.36" />
89
- <line x1="18.36" y1="5.64" x2="19.78" y2="4.22" />
90
- </svg>
91
- {/if}
92
- </button>
50
+ <a
51
+ href="/settings"
52
+ class="settings-btn"
53
+ class:active={$page.url.pathname === '/settings'}
54
+ aria-label="Settings"
55
+ title="Settings"
56
+ >
57
+ <svg
58
+ width="16"
59
+ height="16"
60
+ viewBox="0 0 24 24"
61
+ fill="none"
62
+ stroke="currentColor"
63
+ stroke-width="2"
64
+ stroke-linecap="round"
65
+ stroke-linejoin="round"
66
+ >
67
+ <circle cx="12" cy="12" r="3" />
68
+ <path
69
+ d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"
70
+ />
71
+ </svg>
72
+ </a>
93
73
 
94
74
  <button
95
75
  class="hamburger"
@@ -116,6 +96,14 @@
116
96
  {link.label}
117
97
  </a>
118
98
  {/each}
99
+ <a
100
+ href="/settings"
101
+ class="mobile-link"
102
+ class:active={$page.url.pathname === '/settings'}
103
+ on:click={closeMenu}
104
+ >
105
+ Settings
106
+ </a>
119
107
  </div>
120
108
  {/if}
121
109
  </nav>
@@ -199,7 +187,8 @@
199
187
  margin-left: auto;
200
188
  }
201
189
 
202
- .theme-btn {
190
+ /* Settings gear icon */
191
+ .settings-btn {
203
192
  display: flex;
204
193
  align-items: center;
205
194
  justify-content: center;
@@ -209,19 +198,25 @@
209
198
  border: 1px solid var(--border);
210
199
  background: transparent;
211
200
  color: var(--text-muted);
212
- cursor: pointer;
201
+ text-decoration: none;
213
202
  transition:
214
203
  background var(--duration-fast),
215
204
  color var(--duration-fast),
216
205
  border-color var(--duration-fast);
217
206
  }
218
207
 
219
- .theme-btn:hover {
208
+ .settings-btn:hover {
220
209
  background: var(--bg-subtle);
221
210
  color: var(--text);
222
211
  border-color: var(--text-muted);
223
212
  }
224
213
 
214
+ .settings-btn.active {
215
+ background: var(--accent-soft);
216
+ color: var(--accent);
217
+ border-color: var(--accent);
218
+ }
219
+
225
220
  /* Hamburger */
226
221
  .hamburger {
227
222
  display: none;