plum-e2e 1.0.1 → 1.0.3

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 +5 -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,127 +1,127 @@
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
- const express = require('express');
19
- const router = express.Router();
20
- const cronService = require('../services/cronService');
21
-
22
- /* -----------------------------------------------------
23
- * Get Cron Jobs
24
- * Description:
25
- * - Get all cron jobs from config/cron-jobs.json
26
- * ------------------------------------------------------ */
27
- router.get('/', (req, res) => {
28
- try {
29
- const cronJobs = cronService.getAllCronJobs();
30
- res.json({ cronJobs });
31
- } catch (error) {
32
- console.error('Error fetching cron jobs:', error);
33
- res.status(500).json({ error: 'Failed to fetch cron jobs' });
34
- }
35
- });
36
-
37
- /* -----------------------------------------------------
38
- * Create Cron Job
39
- * Description:
40
- * Add a new cron job to config/cron-jobs.json
41
- * Params:
42
- * - cronExpression:
43
- * e.g. "* * * * *"
44
- * https://www.baeldung.com/cron-expressions
45
- * - taskName:
46
- * the unique identifier
47
- * - tags:
48
- * cucumber tag you want to run when cron job
49
- * is triggered.
50
- * ------------------------------------------------------ */
51
- router.post('/', (req, res) => {
52
- try {
53
- const { cronExpression, taskName, tags } = req.body;
54
- if (!cronExpression || !taskName || !tags) {
55
- return res.status(400).json({ error: 'Missing required fields' });
56
- }
57
-
58
- cronService.addCronJob(req.body);
59
- res.json({
60
- message: `Cron job ${taskName} added with tags: ${tags}`,
61
- taskName,
62
- cronExpression
63
- });
64
- } catch (error) {
65
- console.error('Error adding cron job:', error);
66
- res.status(500).json({ error: 'Failed to add cron job' });
67
- }
68
- });
69
-
70
- /* -----------------------------------------------------
71
- * Edit Cron Job
72
- * Description:
73
- * Edit an existing cron job from
74
- * config/cron-jobs.json
75
- * Params:
76
- * - taskName:
77
- * the unique identifier
78
- * - cronExpression:
79
- * e.g. "* * * * *"
80
- * https://www.baeldung.com/cron-expressions
81
- * - tags:
82
- * cucumber tag you want to run when cron job
83
- * is triggered.
84
- * ------------------------------------------------------ */
85
- router.put('/:taskName', (req, res) => {
86
- try {
87
- const { taskName } = req.params;
88
- const { cronExpression, tags } = req.body;
89
-
90
- if (!cronExpression || !tags) {
91
- return res.status(400).json({ error: 'Missing required fields' });
92
- }
93
-
94
- const updatedCronJob = cronService.updateCronJob(taskName, req.body); // Assuming this is a function to update the cron job
95
- res.json({
96
- message: `Cron job ${taskName} updated`,
97
- taskName,
98
- cronExpression,
99
- tags: updatedCronJob.tags
100
- });
101
- } catch (error) {
102
- console.error('Error updating cron job:', error);
103
- res.status(500).json({ error: 'Failed to update cron job' });
104
- }
105
- });
106
-
107
- /* -----------------------------------------------------
108
- * Delete Cron Job
109
- * Description:
110
- * Delete cron job from config/cron-jobs.json
111
- * by taskName
112
- * Params:
113
- * - taskName:
114
- * the unique identifier
115
- * ------------------------------------------------------ */
116
- router.delete('/:taskName', (req, res) => {
117
- try {
118
- const { taskName } = req.params;
119
- cronService.removeCronJob(taskName);
120
- res.json({ message: `Cron job ${taskName} deleted` });
121
- } catch (error) {
122
- console.error('Error deleting cron job:', error);
123
- res.status(500).json({ error: 'Failed to delete cron job' });
124
- }
125
- });
126
-
127
- module.exports = router;
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
+ const express = require('express');
19
+ const router = express.Router();
20
+ const cronService = require('../services/cronService');
21
+
22
+ /* -----------------------------------------------------
23
+ * Get Cron Jobs
24
+ * Description:
25
+ * - Get all cron jobs from config/cron-jobs.json
26
+ * ------------------------------------------------------ */
27
+ router.get('/', (req, res) => {
28
+ try {
29
+ const cronJobs = cronService.getAllCronJobs();
30
+ res.json({ cronJobs });
31
+ } catch (error) {
32
+ console.error('Error fetching cron jobs:', error);
33
+ res.status(500).json({ error: 'Failed to fetch cron jobs' });
34
+ }
35
+ });
36
+
37
+ /* -----------------------------------------------------
38
+ * Create Cron Job
39
+ * Description:
40
+ * Add a new cron job to config/cron-jobs.json
41
+ * Params:
42
+ * - cronExpression:
43
+ * e.g. "* * * * *"
44
+ * https://www.baeldung.com/cron-expressions
45
+ * - taskName:
46
+ * the unique identifier
47
+ * - tags:
48
+ * cucumber tag you want to run when cron job
49
+ * is triggered.
50
+ * ------------------------------------------------------ */
51
+ router.post('/', (req, res) => {
52
+ try {
53
+ const { cronExpression, taskName, tags } = req.body;
54
+ if (!cronExpression || !taskName || !tags) {
55
+ return res.status(400).json({ error: 'Missing required fields' });
56
+ }
57
+
58
+ cronService.addCronJob(req.body);
59
+ res.json({
60
+ message: `Cron job ${taskName} added with tags: ${tags}`,
61
+ taskName,
62
+ cronExpression
63
+ });
64
+ } catch (error) {
65
+ console.error('Error adding cron job:', error);
66
+ res.status(500).json({ error: 'Failed to add cron job' });
67
+ }
68
+ });
69
+
70
+ /* -----------------------------------------------------
71
+ * Edit Cron Job
72
+ * Description:
73
+ * Edit an existing cron job from
74
+ * config/cron-jobs.json
75
+ * Params:
76
+ * - taskName:
77
+ * the unique identifier
78
+ * - cronExpression:
79
+ * e.g. "* * * * *"
80
+ * https://www.baeldung.com/cron-expressions
81
+ * - tags:
82
+ * cucumber tag you want to run when cron job
83
+ * is triggered.
84
+ * ------------------------------------------------------ */
85
+ router.put('/:taskName', (req, res) => {
86
+ try {
87
+ const { taskName } = req.params;
88
+ const { cronExpression, tags } = req.body;
89
+
90
+ if (!cronExpression || !tags) {
91
+ return res.status(400).json({ error: 'Missing required fields' });
92
+ }
93
+
94
+ const updatedCronJob = cronService.updateCronJob(taskName, req.body); // Assuming this is a function to update the cron job
95
+ res.json({
96
+ message: `Cron job ${taskName} updated`,
97
+ taskName,
98
+ cronExpression,
99
+ tags: updatedCronJob.tags
100
+ });
101
+ } catch (error) {
102
+ console.error('Error updating cron job:', error);
103
+ res.status(500).json({ error: 'Failed to update cron job' });
104
+ }
105
+ });
106
+
107
+ /* -----------------------------------------------------
108
+ * Delete Cron Job
109
+ * Description:
110
+ * Delete cron job from config/cron-jobs.json
111
+ * by taskName
112
+ * Params:
113
+ * - taskName:
114
+ * the unique identifier
115
+ * ------------------------------------------------------ */
116
+ router.delete('/:taskName', (req, res) => {
117
+ try {
118
+ const { taskName } = req.params;
119
+ cronService.removeCronJob(taskName);
120
+ res.json({ message: `Cron job ${taskName} deleted` });
121
+ } catch (error) {
122
+ console.error('Error deleting cron job:', error);
123
+ res.status(500).json({ error: 'Failed to delete cron job' });
124
+ }
125
+ });
126
+
127
+ module.exports = router;
@@ -1,42 +1,42 @@
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
- const express = require('express');
19
- const router = express.Router();
20
- const reportService = require('../services/reportService');
21
-
22
- /* -----------------------------------------------------
23
- * Get Reports
24
- * Description:
25
- * Get all reports from reports/
26
- * ------------------------------------------------------ */
27
- router.get('/', (req, res) => {
28
- const reports = reportService.getAllReports();
29
- res.json({ reports });
30
- });
31
-
32
- /* -----------------------------------------------------
33
- * Get Latest Report
34
- * Description:
35
- * Get latest report
36
- * ------------------------------------------------------ */
37
- router.get('/latest', (req, res) => {
38
- const latestReport = reportService.getLatestReport();
39
- res.json({ latestReport });
40
- });
41
-
42
- module.exports = router;
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
+ const express = require('express');
19
+ const router = express.Router();
20
+ const reportService = require('../services/reportService');
21
+
22
+ /* -----------------------------------------------------
23
+ * Get Reports
24
+ * Description:
25
+ * Get all reports from reports/
26
+ * ------------------------------------------------------ */
27
+ router.get('/', (req, res) => {
28
+ const reports = reportService.getAllReports();
29
+ res.json({ reports });
30
+ });
31
+
32
+ /* -----------------------------------------------------
33
+ * Get Latest Report
34
+ * Description:
35
+ * Get latest report
36
+ * ------------------------------------------------------ */
37
+ router.get('/latest', (req, res) => {
38
+ const latestReport = reportService.getLatestReport();
39
+ res.json({ latestReport });
40
+ });
41
+
42
+ module.exports = router;
@@ -1,32 +1,32 @@
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
- const express = require('express');
19
- const router = express.Router();
20
- const scheduleService = require('../services/scheduleService');
21
-
22
- /* -----------------------------------------------------
23
- * Get Schedules
24
- * Description:
25
- * Get all schedules from schedules/
26
- * ------------------------------------------------------ */
27
- router.get('/', (req, res) => {
28
- const schedules = scheduleService.getAllSchedules();
29
- res.json({ schedules });
30
- });
31
-
32
- module.exports = router;
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
+ const express = require('express');
19
+ const router = express.Router();
20
+ const scheduleService = require('../services/scheduleService');
21
+
22
+ /* -----------------------------------------------------
23
+ * Get Schedules
24
+ * Description:
25
+ * Get all schedules from schedules/
26
+ * ------------------------------------------------------ */
27
+ router.get('/', (req, res) => {
28
+ const schedules = scheduleService.getAllSchedules();
29
+ res.json({ schedules });
30
+ });
31
+
32
+ module.exports = router;
@@ -1,33 +1,33 @@
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
- const express = require('express');
19
- const router = express.Router();
20
- const testService = require('../services/testService');
21
-
22
- /* -----------------------------------------------------
23
- * Get all tests
24
- * Description:
25
- * Gets all suites and its own test cases in
26
- * features/
27
- * ------------------------------------------------------ */
28
- router.get('/', (req, res) => {
29
- const suites = testService.getTestSuites();
30
- res.json({ suites });
31
- });
32
-
33
- module.exports = router;
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
+ const express = require('express');
19
+ const router = express.Router();
20
+ const testService = require('../services/testService');
21
+
22
+ /* -----------------------------------------------------
23
+ * Get all tests
24
+ * Description:
25
+ * Gets all suites and its own test cases in
26
+ * features/
27
+ * ------------------------------------------------------ */
28
+ router.get('/', (req, res) => {
29
+ const suites = testService.getTestSuites();
30
+ res.json({ suites });
31
+ });
32
+
33
+ module.exports = router;
package/backend/server.js CHANGED
@@ -1,39 +1,39 @@
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
- const http = require('http');
19
- const { Server } = require('socket.io');
20
- const app = require('./app');
21
- const socketHandler = require('./websockets/socketHandler.js');
22
- const server = http.createServer(app);
23
- const io = new Server(server, { cors: { origin: '*' } });
24
- const path = require('path');
25
- const fs = require('fs');
26
-
27
- // Always point to the mounted tests directory
28
- const testsDir = path.resolve(process.cwd(), 'tests');
29
-
30
- if (!fs.existsSync(testsDir)) {
31
- console.error('❌ No tests folder found at /app/tests');
32
- process.exit(1);
33
- }
34
-
35
- console.log('📂 Loading tests from:', testsDir);
36
-
37
- socketHandler(io);
38
-
39
- server.listen(3001, () => console.log('Backend running on port 3001'));
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
+ const http = require('http');
19
+ const { Server } = require('socket.io');
20
+ const app = require('./app');
21
+ const socketHandler = require('./websockets/socketHandler.js');
22
+ const server = http.createServer(app);
23
+ const io = new Server(server, { cors: { origin: '*' } });
24
+ const path = require('path');
25
+ const fs = require('fs');
26
+
27
+ // Always point to the mounted tests directory
28
+ const testsDir = path.resolve(process.cwd(), 'tests');
29
+
30
+ if (!fs.existsSync(testsDir)) {
31
+ console.error('❌ No tests folder found at /app/tests');
32
+ process.exit(1);
33
+ }
34
+
35
+ console.log('📂 Loading tests from:', testsDir);
36
+
37
+ socketHandler(io);
38
+
39
+ server.listen(3001, () => console.log('Backend running on port 3001'));