@ai-qa/workflow 2.0.2 → 2.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.
- package/DESIGN.md +0 -0
- package/install.js +1 -0
- package/package.json +3 -2
- package/qa-dashboard/app.js +52 -0
- package/qa-dashboard/package-lock.json +1002 -0
- package/qa-dashboard/public/css/style.css +1062 -207
- package/qa-dashboard/public/js/main.js +3 -2
- package/qa-dashboard/routes/export.js +35 -16
- package/qa-dashboard/routes/index.js +38 -1
- package/qa-dashboard/routes/runs.js +58 -6
- package/qa-dashboard/routes/stories.js +59 -15
- package/qa-dashboard/services/cli-bridge.js +47 -3
- package/qa-dashboard/services/project-manager.js +26 -0
- package/qa-dashboard/views/analytics.ejs +226 -153
- package/qa-dashboard/views/index.ejs +241 -82
- package/qa-dashboard/views/layouts/main.ejs +18 -0
- package/qa-dashboard/views/project.ejs +49 -29
- package/qa-dashboard/views/projects.ejs +7 -5
- package/qa-dashboard/views/run.ejs +97 -37
- package/qa-dashboard/views/runs.ejs +29 -38
- package/qa-dashboard/views/stories.ejs +23 -25
- package/qa-dashboard/views/story.ejs +94 -15
- package/qa-dashboard/views/test-data.ejs +24 -24
- package/scripts/executor.js +11 -7
- package/specs/us-expense-01-test-plan.md +55 -0
- package/tests/us-expense-01.spec.ts +30 -0
- package/user-story/Demande-alimentation.md +24 -0
package/DESIGN.md
ADDED
|
File without changes
|
package/install.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-qa/workflow",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "One-command AI QA Pipeline — User Story to Test Report. Auto-detects project config, generates Playwright tests, self-heals failures, dashboard UI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"qa",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"qa:status": "node ai-qa-workflow.js status",
|
|
34
34
|
"qa:list": "node ai-qa-workflow.js list",
|
|
35
35
|
"dashboard": "cd qa-dashboard && npm start",
|
|
36
|
-
"dashboard:dev": "cd qa-dashboard && npx nodemon app.js"
|
|
36
|
+
"dashboard:dev": "cd qa-dashboard && npx nodemon app.js",
|
|
37
|
+
"dashboard:stop": "npx kill-port 4000"
|
|
37
38
|
}
|
|
38
39
|
}
|
package/qa-dashboard/app.js
CHANGED
|
@@ -9,6 +9,33 @@ const pm = require('./services/project-manager');
|
|
|
9
9
|
const app = express();
|
|
10
10
|
const PORT = process.env.PORT || 4000;
|
|
11
11
|
|
|
12
|
+
// Auto-shutdown: when client closes the tab, shutdown after timeout
|
|
13
|
+
let shutdownTimer = null;
|
|
14
|
+
const SHUTDOWN_DELAY = 10000; // 10 seconds — allows page navigation
|
|
15
|
+
|
|
16
|
+
function resetShutdownTimer() {
|
|
17
|
+
if (shutdownTimer) {
|
|
18
|
+
clearTimeout(shutdownTimer);
|
|
19
|
+
shutdownTimer = null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function scheduleShutdown() {
|
|
24
|
+
resetShutdownTimer();
|
|
25
|
+
shutdownTimer = setTimeout(() => {
|
|
26
|
+
console.log('\n Dashboard tab closed — shutting down.');
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}, SHUTDOWN_DELAY);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Reset timer on every request (handles page navigation)
|
|
32
|
+
app.use((req, res, next) => {
|
|
33
|
+
if (req.path !== '/shutdown') {
|
|
34
|
+
resetShutdownTimer();
|
|
35
|
+
}
|
|
36
|
+
next();
|
|
37
|
+
});
|
|
38
|
+
|
|
12
39
|
app.set('view engine', 'ejs');
|
|
13
40
|
app.set('views', path.join(__dirname, 'views'));
|
|
14
41
|
app.use(expressLayouts);
|
|
@@ -18,6 +45,30 @@ app.use(express.urlencoded({ extended: true }));
|
|
|
18
45
|
app.use(express.json());
|
|
19
46
|
app.use(morgan('dev'));
|
|
20
47
|
|
|
48
|
+
// Client signals it's leaving (tab close / navigation)
|
|
49
|
+
app.post('/shutdown', (req, res) => {
|
|
50
|
+
scheduleShutdown();
|
|
51
|
+
res.json({ shutdown: true });
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// SSE Endpoint for React-like live reload
|
|
55
|
+
app.get('/live-reload', (req, res) => {
|
|
56
|
+
res.setHeader('Content-Type', 'text/event-stream');
|
|
57
|
+
res.setHeader('Cache-Control', 'no-cache');
|
|
58
|
+
res.setHeader('Connection', 'keep-alive');
|
|
59
|
+
res.flushHeaders();
|
|
60
|
+
|
|
61
|
+
// Keep connection open
|
|
62
|
+
const keepAlive = setInterval(() => {
|
|
63
|
+
res.write(': keepalive\n\n');
|
|
64
|
+
}, 30000);
|
|
65
|
+
|
|
66
|
+
req.on('close', () => {
|
|
67
|
+
clearInterval(keepAlive);
|
|
68
|
+
res.end();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
21
72
|
// Serve Allure reports for each registered project
|
|
22
73
|
app.use('/allure-report', (req, res, next) => {
|
|
23
74
|
const projectId = req.query.project;
|
|
@@ -43,4 +94,5 @@ app.use((req, res) => { res.status(404).render('error', { message: 'Page not fou
|
|
|
43
94
|
|
|
44
95
|
app.listen(PORT, () => {
|
|
45
96
|
console.log(`QA Dashboard running at http://localhost:${PORT}`);
|
|
97
|
+
console.log(`Close the browser tab to stop the server.`);
|
|
46
98
|
});
|