plum-e2e 1.3.7 → 2.2.0

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/README.md +111 -3
  2. package/backend/app.js +5 -0
  3. package/backend/config/scripts/create-test.mjs +172 -0
  4. package/backend/config/scripts/generate-report.js +2 -1
  5. package/backend/lib/runnerProcess.js +50 -4
  6. package/backend/logs/runner-cmqneqerz0000qq01i5ap2rvl.log +22 -0
  7. package/backend/logs/runner-cmqnfv7kr0000r101aeocm8eu.log +20 -0
  8. package/backend/logs/runner-cmqnfvb560001r101qoi0phau.log +43 -0
  9. package/backend/logs/runner-cmqnfvlm20002r101gsyqb837.log +20 -0
  10. package/backend/logs/runner-cmqnfvqfy0003r101fh41pzx3.log +20 -0
  11. package/backend/logs/runner-cmqnfvvwo0004r101q4dtqxd2.log +20 -0
  12. package/backend/middleware/jwtAuth.js +33 -0
  13. package/backend/middleware/requireAdmin.js +25 -0
  14. package/backend/package.json +2 -0
  15. package/backend/prisma/migrations/20260618000000_add_test_repository/migration.sql +133 -0
  16. package/backend/prisma/migrations/20260618000001_add_user_roles/migration.sql +3 -0
  17. package/backend/prisma/migrations/20260618000002_drop_automated_tag/migration.sql +2 -0
  18. package/backend/prisma/migrations/20260618000003_entry_assignee/migration.sql +2 -0
  19. package/backend/prisma/migrations/20260621000000_add_notifications/migration.sql +8 -0
  20. package/backend/prisma/schema.prisma +123 -10
  21. package/backend/routes/auth.routes.js +96 -0
  22. package/backend/routes/node.routes.js +9 -0
  23. package/backend/routes/runners.routes.js +10 -0
  24. package/backend/routes/settings.routes.js +71 -8
  25. package/backend/routes/test-cases.routes.js +80 -0
  26. package/backend/routes/test-runs.routes.js +122 -0
  27. package/backend/routes/test-suites.routes.js +92 -0
  28. package/backend/routes/users.routes.js +67 -0
  29. package/backend/scripts/create-test.js +7 -6
  30. package/backend/scripts/manage-runners.mjs +49 -8
  31. package/backend/server.js +22 -1
  32. package/backend/services/cronService.js +91 -7
  33. package/backend/services/notificationService.js +163 -0
  34. package/backend/services/reportService.js +96 -4
  35. package/backend/services/settingsService.js +46 -2
  36. package/backend/services/testCaseService.js +139 -0
  37. package/backend/services/testRunService.js +203 -0
  38. package/backend/services/testSuiteService.js +191 -0
  39. package/backend/services/userService.js +114 -0
  40. package/backend/websockets/socketHandler.js +96 -7
  41. package/bin/plum.js +105 -9
  42. package/frontend/src/lib/api/auth.js +69 -0
  43. package/frontend/src/lib/api/repository.js +256 -0
  44. package/frontend/src/lib/api/schedules.js +5 -1
  45. package/frontend/src/lib/api/settings.js +15 -0
  46. package/frontend/src/lib/api/users.js +52 -0
  47. package/frontend/src/lib/components/layout/Nav.svelte +116 -4
  48. package/frontend/src/lib/components/layout/RunnerPanel.svelte +321 -31
  49. package/frontend/src/lib/components/ui/Modal.svelte +8 -1
  50. package/frontend/src/lib/constants.js +2 -0
  51. package/frontend/src/lib/stores/auth.js +60 -0
  52. package/frontend/src/lib/stores/runner.js +11 -2
  53. package/frontend/src/routes/+layout.svelte +32 -4
  54. package/frontend/src/routes/+page.svelte +1 -1
  55. package/frontend/src/routes/login/+page.svelte +209 -0
  56. package/frontend/src/routes/scheduled-tests/+page.svelte +65 -7
  57. package/frontend/src/routes/settings/+page.svelte +677 -6
  58. package/frontend/src/routes/setup/+page.svelte +249 -0
  59. package/frontend/src/routes/test-repository/+page.svelte +1379 -0
  60. package/frontend/src/routes/test-repository/runs/[id]/+page.svelte +1549 -0
  61. package/frontend/src/routes/test-repository/suites/[id]/+page.svelte +1490 -0
  62. package/package.json +1 -1
@@ -0,0 +1,249 @@
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
+ import { setup, checkNeedsSetup } from '$lib/api/auth';
21
+ import { auth } from '$lib/stores/auth';
22
+ import { login as apiLogin } from '$lib/api/auth';
23
+ import { theme } from '$lib/stores/theme';
24
+
25
+ let name = '';
26
+ let email = '';
27
+ let password = '';
28
+ let error = '';
29
+ let loading = false;
30
+ let checking = true;
31
+
32
+ onMount(async () => {
33
+ try {
34
+ const needs = await checkNeedsSetup();
35
+ if (!needs) goto('/login');
36
+ } catch {}
37
+ checking = false;
38
+ });
39
+
40
+ async function handleSubmit() {
41
+ if (!name || !email || !password) {
42
+ error = 'All fields are required.';
43
+ return;
44
+ }
45
+ if (password.length < 8) {
46
+ error = 'Password must be at least 8 characters.';
47
+ return;
48
+ }
49
+ error = '';
50
+ loading = true;
51
+ try {
52
+ await setup({ name, email, password });
53
+ const { token, user } = await apiLogin({ email, password });
54
+ auth.login(token, user);
55
+ window.location.href = '/';
56
+ } catch (e) {
57
+ error = e.message || 'Setup failed';
58
+ } finally {
59
+ loading = false;
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <svelte:head><title>Setup — Plum</title></svelte:head>
65
+
66
+ <div class="page" data-theme={$theme}>
67
+ {#if !checking}
68
+ <div class="card">
69
+ <div class="brand">
70
+ <span class="brand-serif">Pl</span><span class="brand-sans">um</span>
71
+ </div>
72
+ <div class="heading">
73
+ <h1 class="title">Welcome to Plum</h1>
74
+ <p class="subtitle">Create your first account to get started.</p>
75
+ </div>
76
+
77
+ <div class="fields">
78
+ <div class="field">
79
+ <label class="label" for="name">Your name</label>
80
+ <input
81
+ id="name"
82
+ type="text"
83
+ class="input"
84
+ bind:value={name}
85
+ placeholder="Jane Smith"
86
+ autocomplete="name"
87
+ />
88
+ </div>
89
+ <div class="field">
90
+ <label class="label" for="email">Email</label>
91
+ <input
92
+ id="email"
93
+ type="email"
94
+ class="input"
95
+ bind:value={email}
96
+ placeholder="jane@example.com"
97
+ autocomplete="email"
98
+ />
99
+ </div>
100
+ <div class="field">
101
+ <label class="label" for="password">Password</label>
102
+ <input
103
+ id="password"
104
+ type="password"
105
+ class="input"
106
+ bind:value={password}
107
+ placeholder="Min. 8 characters"
108
+ autocomplete="new-password"
109
+ />
110
+ </div>
111
+ </div>
112
+
113
+ {#if error}
114
+ <p class="error">{error}</p>
115
+ {/if}
116
+
117
+ <button
118
+ class="submit-btn"
119
+ on:click={handleSubmit}
120
+ disabled={loading || !name || !email || !password}
121
+ >
122
+ {loading ? 'Creating account…' : 'Create account'}
123
+ </button>
124
+ </div>
125
+ {/if}
126
+ </div>
127
+
128
+ <style>
129
+ .page {
130
+ min-height: 100vh;
131
+ background: var(--bg);
132
+ display: flex;
133
+ align-items: center;
134
+ justify-content: center;
135
+ padding: 1rem;
136
+ }
137
+
138
+ .card {
139
+ width: 100%;
140
+ max-width: 400px;
141
+ background: var(--bg-elevated);
142
+ border: 1px solid var(--border);
143
+ border-radius: var(--radius-lg);
144
+ padding: 2.5rem 2rem;
145
+ display: flex;
146
+ flex-direction: column;
147
+ gap: 1.25rem;
148
+ }
149
+
150
+ .brand {
151
+ font-size: 1.5rem;
152
+ letter-spacing: -0.02em;
153
+ margin-bottom: -0.25rem;
154
+ }
155
+
156
+ .brand-serif {
157
+ font-family: var(--font-display);
158
+ font-weight: 400;
159
+ color: var(--accent);
160
+ }
161
+
162
+ .brand-sans {
163
+ font-family: var(--font-body);
164
+ font-weight: 400;
165
+ color: var(--text);
166
+ }
167
+
168
+ .heading {
169
+ display: flex;
170
+ flex-direction: column;
171
+ gap: 0.25rem;
172
+ }
173
+
174
+ .title {
175
+ font-size: 1.4rem;
176
+ font-weight: 600;
177
+ color: var(--text);
178
+ margin: 0;
179
+ }
180
+
181
+ .subtitle {
182
+ font-size: 0.875rem;
183
+ color: var(--text-muted);
184
+ margin: 0;
185
+ }
186
+
187
+ .fields {
188
+ display: flex;
189
+ flex-direction: column;
190
+ gap: 0.875rem;
191
+ }
192
+
193
+ .field {
194
+ display: flex;
195
+ flex-direction: column;
196
+ gap: 0.375rem;
197
+ }
198
+
199
+ .label {
200
+ font-size: 0.8125rem;
201
+ font-weight: 500;
202
+ color: var(--text);
203
+ }
204
+
205
+ .input {
206
+ height: 38px;
207
+ padding: 0 0.75rem;
208
+ font-family: var(--font-body);
209
+ font-size: 0.875rem;
210
+ color: var(--text);
211
+ background: var(--bg);
212
+ border: 1px solid var(--border);
213
+ border-radius: var(--radius-sm);
214
+ outline: none;
215
+ transition: border-color var(--duration-fast);
216
+ }
217
+
218
+ .input:focus {
219
+ border-color: var(--accent);
220
+ }
221
+
222
+ .error {
223
+ font-size: 0.8125rem;
224
+ color: var(--fail);
225
+ margin: -0.25rem 0 0;
226
+ }
227
+
228
+ .submit-btn {
229
+ height: 40px;
230
+ background: var(--accent);
231
+ color: #fff;
232
+ border: none;
233
+ border-radius: var(--radius-sm);
234
+ font-family: var(--font-body);
235
+ font-size: 0.875rem;
236
+ font-weight: 500;
237
+ cursor: pointer;
238
+ transition: opacity var(--duration-fast);
239
+ }
240
+
241
+ .submit-btn:disabled {
242
+ opacity: 0.5;
243
+ cursor: not-allowed;
244
+ }
245
+
246
+ .submit-btn:not(:disabled):hover {
247
+ opacity: 0.88;
248
+ }
249
+ </style>