create-pmos 0.401.0 → 0.403.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.
- package/package.json +25 -30
- package/payload/KIT-VERSION +2 -2
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/payload/state/log.md +1 -1
- package/workspace/board-programs-test.js +227 -0
- package/workspace/board-shot.js +54 -0
- package/workspace/briefing-premium-adddoc-test.js +28 -22
- package/workspace/briefing-premium-board-test.js +107 -82
- package/workspace/briefing-premium-calendar-2-test.js +23 -10
- package/workspace/briefing-premium-calendar-3-test.js +23 -19
- package/workspace/briefing-premium-calendar-test.js +20 -15
- package/workspace/briefing-premium-initiative-test.js +25 -12
- package/workspace/briefing-premium-insights-test.js +31 -18
- package/workspace/briefing-premium-metrics-test.js +8 -8
- package/workspace/briefing-premium-sources-test.js +15 -10
- package/workspace/briefing-premium-test.js +39 -16
- package/workspace/changelog.json +24 -0
- package/workspace/fixtures/board-premium-facts.js +20 -3
- package/workspace/fixtures/briefing-premium-facts.js +18 -2
- package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
- package/workspace/fixtures/program-ascent.js +101 -0
- package/workspace/guide/home.md +11 -7
- package/workspace/guide/index.md +1 -0
- package/workspace/guide/jira.md +38 -6
- package/workspace/guide/programs.md +37 -0
- package/workspace/home-rows-test.js +184 -0
- package/workspace/lib/briefing-premium-products.js +4 -4
- package/workspace/lib/briefing-premium.js +2 -2
- package/workspace/lib/calendar-layers.js +8 -4
- package/workspace/lib/initiative-layout.js +4 -3
- package/workspace/lib/jira-cli.js +17 -12
- package/workspace/lib/jira-status.js +1 -1
- package/workspace/lib/jira-tickets.js +126 -24
- package/workspace/lib/meeting-files.js +58 -0
- package/workspace/lib/meeting-learn.js +139 -0
- package/workspace/lib/meeting-material.js +12 -5
- package/workspace/lib/notes.js +3 -0
- package/workspace/lib/programs.js +129 -0
- package/workspace/lib/route-modules.js +1 -0
- package/workspace/lib/routes-brief-page.js +8 -1
- package/workspace/lib/routes-briefing-premium.js +1 -1
- package/workspace/lib/routes-calendar-views.js +24 -3
- package/workspace/lib/routes-meeting-material.js +38 -0
- package/workspace/lib/routes-meeting-points.js +23 -3
- package/workspace/lib/routes-programs.js +122 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +31 -25
- package/workspace/premium-chat-context-test.js +1 -1
- package/workspace/premium-chat-goal-view-test.js +1 -1
- package/workspace/premium-chat-viewer-test.js +1 -1
- package/workspace/premium-core-doc-issue-test.js +13 -7
- package/workspace/premium-discuss-landing-test.js +83 -0
- package/workspace/premium-link-suggest-test.js +103 -0
- package/workspace/premium-report-read-test.js +86 -82
- package/workspace/premium-vw-backlog-test.js +6 -5
- package/workspace/premium-vw-cal-test.js +45 -19
- package/workspace/premium-vw-item-test.js +8 -6
- package/workspace/premium-vw-jira-test.js +3 -2
- package/workspace/premium-vw-meet-test.js +122 -66
- package/workspace/premium-vw-notes-test.js +7 -6
- package/workspace/premium-vw-rec-test.js +14 -13
- package/workspace/premium-vw-slides-test.js +11 -5
- package/workspace/program-panel-test.js +152 -0
- package/workspace/public/pm/bd-acts.js +24 -15
- package/workspace/public/pm/bd-asks.js +111 -30
- package/workspace/public/pm/bd-ini-panel.js +229 -0
- package/workspace/public/pm/bd-pop.js +2 -2
- package/workspace/public/pm/bd-prog-panel.js +436 -0
- package/workspace/public/pm/bd-prog.js +191 -0
- package/workspace/public/pm/bd-span.js +98 -15
- package/workspace/public/pm/bd-views.js +93 -29
- package/workspace/public/pm/cozy-board.css +214 -20
- package/workspace/public/pm/cozy-evui.js +4 -2
- package/workspace/public/pm/cozy-home-rows.css +54 -0
- package/workspace/public/pm/cozy-home.css +35 -0
- package/workspace/public/pm/cozy-insights.css +1 -2
- package/workspace/public/pm/cozy-mtg-present.css +160 -0
- package/workspace/public/pm/cozy-panel.css +155 -0
- package/workspace/public/pm/cozy-rec-pill.css +12 -0
- package/workspace/public/pm/cozy-rec-pill.js +46 -0
- package/workspace/public/pm/cozy-today.css +189 -0
- package/workspace/public/pm/cozy-viewer.js +307 -43
- package/workspace/public/pm/cozy-vw-mtg.css +96 -94
- package/workspace/public/pm/cozy-vw-rp.css +40 -25
- package/workspace/public/pm/cozy-vw-shell.css +127 -0
- package/workspace/public/pm/cozy-xv.css +51 -0
- package/workspace/public/pm/cozy-xv.js +34 -0
- package/workspace/public/pm/home-app.js +192 -72
- package/workspace/public/pm/home-chat.js +17 -4
- package/workspace/public/pm/home-data.js +1 -1
- package/workspace/public/pm/home-day.js +64 -0
- package/workspace/public/pm/home-ini-model.js +1 -1
- package/workspace/public/pm/home-ini.js +197 -54
- package/workspace/public/pm/home-list.js +100 -27
- package/workspace/public/pm/home-mentions.js +187 -0
- package/workspace/public/pm/home-rec-row.js +67 -0
- package/workspace/public/pm/home-review.js +20 -10
- package/workspace/public/pm/home-task.js +19 -18
- package/workspace/public/pm/home-today.js +137 -59
- package/workspace/public/pm/premium-board.js +294 -288
- package/workspace/public/pm/premium-insights.js +118 -82
- package/workspace/public/pm/premium-mtg-present.js +408 -100
- package/workspace/public/pm/premium-mtg-replay.js +70 -10
- package/workspace/public/pm/premium-report-read.js +118 -63
- package/workspace/public/pm/premium-vw-cal.js +62 -34
- package/workspace/public/pm/premium-vw-mtg.js +348 -192
- package/workspace/public/pm/program-model.js +192 -0
- package/workspace/public/pm/rec-state.js +63 -0
- package/workspace/public/pm/rp-parts.js +33 -8
- package/workspace/public/pm/tk-draft.js +107 -0
- package/workspace/public/pm/tk-model.js +134 -0
- package/workspace/public/pm/tk-send.js +124 -0
- package/workspace/public/pm/tk-tasks.css +120 -0
- package/workspace/public/premium-board.html +4 -2
- package/workspace/server.js +4 -2
- package/workspace/skills/jira-push.skill +3 -3
- package/workspace/test-lists/board-programs.json +9 -0
- package/workspace/test-lists/prd-to-jira.json +6 -0
- package/workspace/test-lists/program-hierarchy.json +11 -0
- package/workspace/test-lists/program-panel.json +9 -0
- package/workspace/test-lists/viewer-home-rows.json +9 -0
- package/workspace/test-lists/viewer-meetings.json +9 -0
- package/workspace/test-lists/viewer-shell-a.json +15 -0
- package/workspace/tk-tasks-test.js +199 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.403.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,30 @@
|
|
|
32
32
|
"audit"
|
|
33
33
|
],
|
|
34
34
|
"pmosChanges": [
|
|
35
|
+
{
|
|
36
|
+
"v": "0.403.0",
|
|
37
|
+
"at": "2026-10-24T03:40:15.576Z",
|
|
38
|
+
"f": 2,
|
|
39
|
+
"prs": [
|
|
40
|
+
{
|
|
41
|
+
"n": 1033,
|
|
42
|
+
"t": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)",
|
|
43
|
+
"s": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"v": "0.402.0",
|
|
49
|
+
"at": "2026-10-24T03:05:59.743Z",
|
|
50
|
+
"f": 2,
|
|
51
|
+
"prs": [
|
|
52
|
+
{
|
|
53
|
+
"n": 1031,
|
|
54
|
+
"t": "Build the Ready for development page (Home A+C, Programs, 60% panel)",
|
|
55
|
+
"s": "Build the Ready for development page (Home A+C, Programs, 60% panel)"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
35
59
|
{
|
|
36
60
|
"v": "0.401.0",
|
|
37
61
|
"at": "2026-10-23T23:36:01.429Z",
|
|
@@ -267,35 +291,6 @@
|
|
|
267
291
|
"s": "Claude's stored lead shows first in a popup, with Refresh"
|
|
268
292
|
}
|
|
269
293
|
]
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
"v": "0.383.0",
|
|
273
|
-
"at": "2026-10-21T13:13:17.082Z",
|
|
274
|
-
"f": 2,
|
|
275
|
-
"prs": [
|
|
276
|
-
{
|
|
277
|
-
"n": 994,
|
|
278
|
-
"t": "Share a viewer file as a password link that needs no Cloudflare login",
|
|
279
|
-
"s": "Share a viewer file as a password link that needs no Cloudflare login"
|
|
280
|
-
}
|
|
281
|
-
]
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"v": "0.382.0",
|
|
285
|
-
"at": "2026-10-21T12:58:18.296Z",
|
|
286
|
-
"f": 2,
|
|
287
|
-
"prs": [
|
|
288
|
-
{
|
|
289
|
-
"n": 991,
|
|
290
|
-
"t": "A chat in every premium popup",
|
|
291
|
-
"s": "A chat in every premium popup"
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
"n": 992,
|
|
295
|
-
"t": "Download a file from the viewer (premium-viewer-share slice 1)",
|
|
296
|
-
"s": "Download a file from the viewer (premium-viewer-share slice 1)"
|
|
297
|
-
}
|
|
298
|
-
]
|
|
299
294
|
}
|
|
300
295
|
]
|
|
301
296
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
kernel-source: pmos@
|
|
2
|
-
assembled: 2026-10-
|
|
1
|
+
kernel-source: pmos@1a2052c2
|
|
2
|
+
assembled: 2026-10-24
|
|
3
3
|
mode: vendor
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-24T03:40:12Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-24T03:40:12Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-10-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-10-24T03:40:12Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/payload/state/log.md
CHANGED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* board-programs-test.js — programs on the Board (initiative program-hierarchy, P4 P6 P8; canvas PgBoard, PgBoardProduct, PgKanban, PgTimeline,
|
|
4
|
+
* PgList). Serves the real page from the real server; GET /api/board-premium answers each product of Project Ascent (fixtures/board-premium-facts.js
|
|
5
|
+
* programFacts) by its ws, and GET /api/programs answers the program (fixtures/program-ascent.js). The page's clock is the fixture's (17 Oct 2026).
|
|
6
|
+
* G grouping: programs first, then the product; no "Not in a program"; By product with the layers icon; the choice is remembered
|
|
7
|
+
* F every group folds, and the fold is remembered across reloads
|
|
8
|
+
* O a program band, swimlane or timeline row opens the program with the bd:program event and nothing else; ?program= opens it once
|
|
9
|
+
* K Kanban: programs as swimlanes, then the product; any column folds to a strip with its count; empty ones start folded
|
|
10
|
+
* T timeline: the program row brackets its initiatives; close milestones merge into one counted diamond; one-line rows; a legend
|
|
11
|
+
* L List: Product and Program columns, sortable
|
|
12
|
+
* Z with no program on the board, no group head and no grouping control (zero is silence) · phone: no sideways scroll */
|
|
13
|
+
const path = require('path');
|
|
14
|
+
const { spawn } = require('child_process');
|
|
15
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
16
|
+
const T = require('./test-run').configure({ name: 'board-programs' });
|
|
17
|
+
const BP = require('./lib/board-premium.js');
|
|
18
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
19
|
+
|
|
20
|
+
const BASE = T.BASE;
|
|
21
|
+
const results = [];
|
|
22
|
+
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + extra : ''}`); };
|
|
23
|
+
let srv = null; let browser = null;
|
|
24
|
+
const finish = async (code) => {
|
|
25
|
+
if (browser) await browser.close().catch(() => {});
|
|
26
|
+
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
27
|
+
T.killTmux();
|
|
28
|
+
const bad = results.filter((x) => !x.cond).length;
|
|
29
|
+
console.log(`\n${results.length - bad}/${results.length} board-programs assertions passed`);
|
|
30
|
+
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
31
|
+
};
|
|
32
|
+
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
33
|
+
|
|
34
|
+
(async () => {
|
|
35
|
+
const exe = findBrowser();
|
|
36
|
+
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the suite cannot run'); return finish(1); }
|
|
37
|
+
let chromium;
|
|
38
|
+
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
39
|
+
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
40
|
+
await T.waitForServer(BASE);
|
|
41
|
+
browser = await chromium.launch({ executablePath: exe });
|
|
42
|
+
|
|
43
|
+
/** A Board page of one Ascent product. o: { w, h, view, grouping, programs, qs, store } — store: localStorage to set before the page loads. */
|
|
44
|
+
const open = async (o = {}) => {
|
|
45
|
+
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 } });
|
|
46
|
+
const page = await ctx.newPage();
|
|
47
|
+
const errors = [];
|
|
48
|
+
page.on('pageerror', (e) => errors.push(String((e && e.stack) || e)));
|
|
49
|
+
await page.clock.setFixedTime(new Date(F.NOW));
|
|
50
|
+
await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.programFacts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
|
|
51
|
+
await page.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: o.programs || F.programs() }) }));
|
|
52
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
53
|
+
await page.addInitScript(([s]) => { try { if (!sessionStorage.getItem('set')) { sessionStorage.setItem('set', '1'); for (const [k, v] of Object.entries(s)) localStorage.setItem(k, v); } } catch { /* none */ } }, [{ 'pmos.board.view': o.view || 'track', 'pmos.board.pview': o.view === 'time' ? 'track' : o.view || 'track', 'pmos.board.grouping': o.grouping || 'program', ...(o.store || {}) }]);
|
|
54
|
+
await page.addInitScript(() => { window.__prog = []; document.addEventListener('bd:program', (e) => window.__prog.push(e.detail && e.detail.id)); });
|
|
55
|
+
await page.goto(BASE + '/premium-board.html?ws=' + (o.ws || 'idpf') + '&board=' + (o.ws || 'idpf') + (o.qs || ''));
|
|
56
|
+
await page.waitForSelector('#ibBody [data-key]', { timeout: 15000 });
|
|
57
|
+
await page.waitForTimeout(700); // the programs and the other product's rows land after the board
|
|
58
|
+
return { ctx, page, errors };
|
|
59
|
+
};
|
|
60
|
+
const events = (p) => p.evaluate(() => window.__prog.slice());
|
|
61
|
+
|
|
62
|
+
/* G F O — the stage track (PgBoard) */
|
|
63
|
+
{
|
|
64
|
+
const { ctx, page: p, errors } = await open();
|
|
65
|
+
const tr = await p.evaluate(() => ({
|
|
66
|
+
first: (document.querySelector('#ibBody .bt-h + *') || {}).className || '',
|
|
67
|
+
band: (document.querySelector('#ibBody .bt-pg .bt-pgo') || {}).textContent || '',
|
|
68
|
+
spread: (document.querySelector('#ibBody .bt-pg .bd-spl') || {}).textContent || '',
|
|
69
|
+
next: (document.querySelector('#ibBody .bt-pg .bd-pm') || {}).textContent || '',
|
|
70
|
+
ready: [...document.querySelectorAll('#ibBody .bt-pg .bd-rdy i')].map((i) => (i.classList.contains('on') ? 1 : 0)).join(''),
|
|
71
|
+
kids: [...document.querySelectorAll('#ibBody .bt-kid .bt-nm b')].map((b) => b.textContent),
|
|
72
|
+
prods: [...document.querySelectorAll('#ibBody .bt-prd .bd-prdb span:not(.bd-ti):not(.bd-gd):not(.n)')].map((b) => b.textContent),
|
|
73
|
+
after: [...document.querySelectorAll('#ibBody .bt-gr .bt-nm b')].map((b) => b.textContent),
|
|
74
|
+
text: document.querySelector('#ibBody').textContent,
|
|
75
|
+
grp: document.querySelector('#bdGrpw').hidden,
|
|
76
|
+
}));
|
|
77
|
+
ok('G the program comes first: its band row is the first row under the head, with its title and the products it spans', /bt-pg/.test(tr.first) && /Project Ascent/.test(tr.band) && /2 products/.test(tr.band), JSON.stringify(tr));
|
|
78
|
+
ok('G the band says its initiatives and their stage spread, read from every product (2 here, 1 in Microsites)', tr.spread === '3 initiatives, Triage to Plan', tr.spread);
|
|
79
|
+
ok('G the next milestone shows with its date and its readiness, one diamond per initiative it waits on', /Pilot live/.test(tr.next) && /Nov 18/.test(tr.next) && tr.ready === '00', JSON.stringify(tr));
|
|
80
|
+
ok('G its initiatives on this board sit under it; the rest of the product follows under the product head', tr.kids.join() === 'Legacy IdP sunset,Descope feature parity' && tr.prods.join() === 'IDPF' && tr.after.length === 2 && !tr.after.some((t) => tr.kids.includes(t)), JSON.stringify(tr));
|
|
81
|
+
ok('G there is no "Not in a program" group, and Programs first draws no grouping chip (the choice lives in Filter)', !/Not in a program/.test(tr.text) && tr.grp);
|
|
82
|
+
|
|
83
|
+
await p.click('#ibBody .bt-pg [data-prog]');
|
|
84
|
+
ok('O pressing the band dispatches bd:program with the program id and opens no initiative panel', (await events(p)).join() === 'project-ascent' && await p.evaluate(() => !/Initiative/.test(((window.czViewer && window.czViewer.current()) || {}).kind || '')), JSON.stringify(await events(p)));
|
|
85
|
+
await p.keyboard.press('Escape'); await p.waitForFunction(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; });
|
|
86
|
+
|
|
87
|
+
await p.click('#ibBody .bt-pg [data-fold]');
|
|
88
|
+
const f1 = await p.evaluate(() => ({ kids: document.querySelectorAll('#ibBody .bt-kid').length, band: !!document.querySelector('#ibBody .bt-pg'), exp: document.querySelector('#ibBody .bt-pg [data-fold]').getAttribute('aria-expanded'), st: localStorage.getItem('pmos.board.fold') }));
|
|
89
|
+
ok('F the program group folds to its band row, and the fold is stored', f1.kids === 0 && f1.band && f1.exp === 'false' && /g:project-ascent/.test(f1.st), JSON.stringify(f1));
|
|
90
|
+
await p.click('#ibBody .bt-prd [data-fold]');
|
|
91
|
+
ok('F a product group folds to its head with its count', await p.evaluate(() => document.querySelectorAll('#ibBody .bt-gr').length === 0 && /2/.test(document.querySelector('#ibBody .bt-prd').textContent)));
|
|
92
|
+
await p.reload(); await p.waitForSelector('#ibBody [data-fold]'); await p.waitForTimeout(500);
|
|
93
|
+
ok('F both folds are remembered across a reload', await p.evaluate(() => document.querySelectorAll('#ibBody .bt-kid, #ibBody .bt-gr').length === 0 && !!document.querySelector('#ibBody .bt-pg')));
|
|
94
|
+
await p.click('#ibBody .bt-pg [data-fold]'); await p.click('#ibBody .bt-prd [data-fold]');
|
|
95
|
+
ok('F unfolding shows the rows again', await p.evaluate(() => document.querySelectorAll('#ibBody .bt-kid').length === 2 && document.querySelectorAll('#ibBody .bt-gr').length === 2));
|
|
96
|
+
|
|
97
|
+
// By product (PgBoardProduct): from the grouping control, no new filter row
|
|
98
|
+
await p.click('#bdFilter');
|
|
99
|
+
ok('G the Filter popover holds the Group choice because a program holds rows here', await p.evaluate(() => [...document.querySelectorAll('#bdPop [data-fgrp]')].map((b) => b.dataset.fgrp + (b.getAttribute('aria-checked') === 'true' ? '*' : '')).join() === 'program*,product'));
|
|
100
|
+
await p.click('#bdPop [data-fgrp="product"]'); await p.keyboard.press('Escape');
|
|
101
|
+
const bp = await p.evaluate(() => ({ band: !!document.querySelector('#ibBody .bt-pg'), icons: [...document.querySelectorAll('#ibBody .bt-nm .bd-pgi')].map((i) => i.getAttribute('aria-label')), prods: document.querySelectorAll('#ibBody .bt-prd').length, chip: (document.querySelector('#bdGroup') || {}).textContent || '', st: localStorage.getItem('pmos.board.grouping') }));
|
|
102
|
+
ok('G By product draws the product only; a program member carries the small layers icon named for its program; the choice is stored', !bp.band && bp.prods === 1 && bp.icons.length === 2 && bp.icons.every((x) => x === 'In Project Ascent') && /By product/.test(bp.chip) && bp.st === 'product', JSON.stringify(bp));
|
|
103
|
+
await p.click('#bdGroup'); await p.click('#bdGrpMenu [data-grping="program"]');
|
|
104
|
+
ok('G Programs first comes back from the same menu', await p.evaluate(() => !!document.querySelector('#ibBody .bt-pg') && localStorage.getItem('pmos.board.grouping') === 'program'));
|
|
105
|
+
ok('the page threw nothing', !errors.length, errors.join('\n'));
|
|
106
|
+
await ctx.close();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* O ?program=<id> (Home links here) opens the program once */
|
|
110
|
+
{
|
|
111
|
+
const { ctx, page: p } = await open({ qs: '&program=project-ascent', store: { 'pmos.board.fold': '["g:project-ascent"]' } });
|
|
112
|
+
const e = await events(p);
|
|
113
|
+
ok('O ?program= dispatches bd:program once and unfolds the program', e.join() === 'project-ascent' && await p.evaluate(() => document.querySelectorAll('#ibBody .bt-kid').length === 2), JSON.stringify(e));
|
|
114
|
+
await ctx.close();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* K Kanban (PgKanban) */
|
|
118
|
+
{
|
|
119
|
+
const { ctx, page: p, errors } = await open({ view: 'stages' });
|
|
120
|
+
const k = await p.evaluate(() => ({
|
|
121
|
+
lanes: [...document.querySelectorAll('#ibBody .bd-lh')].map((l) => l.className.replace('bd-lh ', '') + ':' + [...(l.querySelector('.bd-lho') || { children: [] }).children].filter((c) => !/bd-p?ti/.test(c.className)).map((c) => c.textContent).join('')),
|
|
122
|
+
ms: (document.querySelector('#ibBody .bd-lh.pg .bd-pm2') || {}).textContent || '',
|
|
123
|
+
heads: [...document.querySelectorAll('#ibBody .bd-kh')].map((h) => h.dataset.colfold),
|
|
124
|
+
strips: [...document.querySelectorAll('#ibBody .bd-kstrip')].map((h) => h.dataset.colfold + ':' + h.querySelector('b').textContent),
|
|
125
|
+
cards: [...document.querySelectorAll('#ibBody .bd-kc .bd-bc .t')].map((b) => b.textContent),
|
|
126
|
+
cols: getComputedStyle(document.querySelector('#ibBody .bd-kb')).gridTemplateColumns.split(' ').length,
|
|
127
|
+
}));
|
|
128
|
+
ok('K programs are swimlanes, then the product: a lane head for Project Ascent, then one for IDPF', k.lanes.join('|') === 'pg:Project Ascent|pd:IDPF', JSON.stringify(k.lanes));
|
|
129
|
+
ok('K the program lane shows its next milestones merged into one counted diamond with their dates', /Pilot live \+2/.test(k.ms) && /Nov 18–21/.test(k.ms), k.ms);
|
|
130
|
+
ok('K the columns with cards are open; empty ones, and Monitor and Evaluate with nothing for you, are strips with their count', k.heads.join() === 'triage,discover' && k.strips.join() === 'plan:0,prioritize:0,build:0,deliver:0,monitor:1,evaluate:20' && k.cols === 8, JSON.stringify(k));
|
|
131
|
+
ok('K each card sits in its lane: the program\'s two, then the product\'s one', k.cards.join() === 'Legacy IdP sunset,Descope feature parity,Usage-based billing', JSON.stringify(k.cards));
|
|
132
|
+
await p.click('#ibBody .bd-kstrip[data-colfold="plan"]');
|
|
133
|
+
await p.click('#ibBody .bd-kh[data-colfold="triage"]');
|
|
134
|
+
const k2 = await p.evaluate(() => ({ plan: !!document.querySelector('#ibBody .bd-kh[data-colfold="plan"]'), triage: (document.querySelector('#ibBody .bd-kstrip[data-colfold="triage"] b') || {}).textContent, st: JSON.parse(localStorage.getItem('pmos.board.cols') || '{}') }));
|
|
135
|
+
ok('K any column folds to a strip with its count and opens again; the choice is stored', k2.plan && k2.triage === '2' && k2.st.plan === 'open' && k2.st.triage === 'fold', JSON.stringify(k2));
|
|
136
|
+
await p.reload(); await p.waitForSelector('#ibBody .bd-kb');
|
|
137
|
+
ok('K a folded column stays folded across a reload', await p.evaluate(() => !!document.querySelector('#ibBody .bd-kstrip[data-colfold="triage"]') && !!document.querySelector('#ibBody .bd-kh[data-colfold="plan"]')));
|
|
138
|
+
await p.click('#ibBody .bd-lh.pd [data-fold]');
|
|
139
|
+
ok('K a product lane folds to its head', await p.evaluate(() => [...document.querySelectorAll('#ibBody .bd-kc .bd-bc .t')].every((b) => b.textContent !== 'Usage-based billing') && !!document.querySelector('#ibBody .bd-lh.pd')));
|
|
140
|
+
await p.click('#ibBody .bd-lh.pg [data-prog]');
|
|
141
|
+
ok('O pressing the program swimlane dispatches bd:program and nothing else', (await events(p)).join() === 'project-ascent' && await p.evaluate(() => !/Initiative/.test(((window.czViewer && window.czViewer.current()) || {}).kind || '')));
|
|
142
|
+
ok('the Kanban threw nothing', !errors.length, errors.join('\n'));
|
|
143
|
+
await ctx.close();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* T timeline (PgTimeline) */
|
|
147
|
+
{
|
|
148
|
+
const { ctx, page: p, errors } = await open({ view: 'time', store: { 'pmos.board.span': 'quarter' } });
|
|
149
|
+
const t = await p.evaluate(() => ({
|
|
150
|
+
first: (document.querySelector('#ibBody .tg-body > .tg-r') || {}).className || '',
|
|
151
|
+
title: (document.querySelector('#ibBody .tg-pg .tg-pgo') || {}).textContent || '',
|
|
152
|
+
span: !!document.querySelector('#ibBody .tg-pg .tg-span'),
|
|
153
|
+
clu: [...document.querySelectorAll('#ibBody .tg-pg .tg-clu')].map((c) => c.textContent + '|' + c.getAttribute('aria-label')),
|
|
154
|
+
lab: [...document.querySelectorAll('#ibBody .tg-pg .tg-pdl')].map((l) => l.textContent),
|
|
155
|
+
kids: [...document.querySelectorAll('#ibBody .tg-kid .tg-n b')].map((b) => b.textContent),
|
|
156
|
+
oneLine: [...document.querySelectorAll('#ibBody .tg-n.ini2')].every((b) => !b.querySelector('small') && !!b.querySelector('.cz-dot')),
|
|
157
|
+
lgd: (document.querySelector('#bdChipset .tg-lgd') || {}).textContent || '',
|
|
158
|
+
}));
|
|
159
|
+
ok('T the program row comes first, with its title and products and a thin span over its initiatives\' dates', /tg-pg/.test(t.first) && /Project Ascent/.test(t.title) && /2 products/.test(t.title) && t.span, JSON.stringify(t));
|
|
160
|
+
ok('T three milestones within a week merge into one counted diamond labelled "Pilot live +2 · Nov 18–21"', t.clu.length === 1 && /^3\|3 program milestones from Nov 18 to 21: Pilot live, Pilot users invited, Support ready/.test(t.clu[0]) && t.lab.join() === 'Pilot live +2 · Nov 18–21', JSON.stringify(t));
|
|
161
|
+
ok('T the program\'s initiatives sit under it as one-line rows: a status dot and the name', t.kids.join() === 'Legacy IdP sunset,Descope feature parity' && t.oneLine, JSON.stringify(t));
|
|
162
|
+
ok('T a legend in the chip row names done, planned, the program milestone, Deliver or Evaluate and today', /Done in Jira/.test(t.lgd) && /Planned/.test(t.lgd) && /Program milestone/.test(t.lgd) && /Deliver or Evaluate/.test(t.lgd) && /Today/.test(t.lgd), t.lgd);
|
|
163
|
+
await p.click('#ibBody .tg-pg .tg-pgo');
|
|
164
|
+
// the program opens in the floating Viewer (shell A), which sits over the right of the timeline; close it before the next press
|
|
165
|
+
await p.keyboard.press('Escape'); await p.waitForFunction(() => { const v = document.querySelector('#czViewer'); return !v || v.hidden; });
|
|
166
|
+
await p.click('#ibBody .tg-pg .tg-clu');
|
|
167
|
+
ok('O the program row and its counted diamond dispatch bd:program and nothing else', (await events(p)).join() === 'project-ascent,project-ascent' && await p.evaluate(() => !/Initiative/.test(((window.czViewer && window.czViewer.current()) || {}).kind || '')));
|
|
168
|
+
ok('the timeline threw nothing', !errors.length, errors.join('\n'));
|
|
169
|
+
await ctx.close();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* L List (PgList) */
|
|
173
|
+
{
|
|
174
|
+
const { ctx, page: p } = await open({ view: 'list' });
|
|
175
|
+
const head = await p.evaluate(() => [...document.querySelectorAll('#ibBody .bd-lt.h [role="columnheader"]')].map((h) => h.textContent).join('|'));
|
|
176
|
+
ok('L the List has Product and Program columns after the initiative', /^Initiative · sorted by need\|Product\|Program\|Kind\|/.test(head), head);
|
|
177
|
+
await p.click('#ibBody [data-sort="program"]');
|
|
178
|
+
const L = await p.evaluate(() => ({ sort: document.querySelector('#ibBody [data-sort="program"]').getAttribute('aria-sort'), rows: [...document.querySelectorAll('#ibBody .bd-lt[data-row]')].map((r) => r.querySelector('.bd-ltn b').textContent + ':' + r.querySelectorAll('.bd-pt')[1].textContent) }));
|
|
179
|
+
ok('L pressing Program sorts by program: the program\'s rows first, a row with no program leaves the cell empty', L.sort === 'ascending' && L.rows[0].endsWith(':Project Ascent') && L.rows[1].endsWith(':Project Ascent') && L.rows[2] === 'Usage-based billing:', JSON.stringify(L));
|
|
180
|
+
await p.click('#ibBody [data-sort="product"]');
|
|
181
|
+
ok('L Product sorts too', await p.evaluate(() => document.querySelector('#ibBody [data-sort="product"]').getAttribute('aria-sort') === 'ascending' && [...document.querySelectorAll('#ibBody .bd-lt[data-row] .bd-pt:first-of-type')].every((c) => /IDPF/.test(c.textContent))));
|
|
182
|
+
await ctx.close();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* A All products (PgBoard, PgKanban, PgList): every product's board on one page; the program holds a sub-row per product */
|
|
186
|
+
{
|
|
187
|
+
const { ctx, page: p, errors } = await open({ qs: '', ws: 'idpf' });
|
|
188
|
+
await p.click('#crSw');
|
|
189
|
+
const items = await p.evaluate(() => [...document.querySelectorAll('#crMenu [data-sw]')].map((b) => b.textContent));
|
|
190
|
+
ok('A the product picker offers All products first, then each product', items[0] === 'All products' && items.length === 3, JSON.stringify(items));
|
|
191
|
+
await Promise.all([p.waitForNavigation(), p.click('#crMenu [data-sw="*|*"]')]);
|
|
192
|
+
await p.waitForSelector('#ibBody [data-key]'); await p.waitForTimeout(700);
|
|
193
|
+
const a = await p.evaluate(() => ({
|
|
194
|
+
url: location.search,
|
|
195
|
+
crumb: (document.querySelector('#crBoard') || {}).textContent || '',
|
|
196
|
+
band: (document.querySelector('#ibBody .bt-pg .bt-pgo') || {}).textContent || '',
|
|
197
|
+
subs: [...document.querySelectorAll('#ibBody .bt-psb')].map((x) => x.textContent.replace(/\s+/g, ' ').trim()),
|
|
198
|
+
kids: [...document.querySelectorAll('#ibBody .bt-kid .bt-nm b')].map((b) => b.textContent),
|
|
199
|
+
prods: [...document.querySelectorAll('#ibBody .bt-prd .bd-prdb span:not(.bd-ti):not(.bd-gd):not(.n)')].map((b) => b.textContent),
|
|
200
|
+
docs: getComputedStyle(document.querySelector('#tabDocs')).display === 'none', nw: document.querySelector('#newIni').hidden,
|
|
201
|
+
chips: [...document.querySelectorAll('#bdChipset .bd-chip')].map((c) => c.id).filter(Boolean),
|
|
202
|
+
}));
|
|
203
|
+
ok('A the picker goes to ?all=1 and the page says All products', a.url === '?all=1' && /All products/.test(a.crumb), JSON.stringify(a));
|
|
204
|
+
ok('A the program comes first and holds a sub-row per product with that product\'s initiatives', /Project Ascent/.test(a.band) && a.subs.length === 2 && /IDPF/.test(a.subs[0]) && a.kids.length === 3, JSON.stringify(a));
|
|
205
|
+
ok('A then one group per product with the rows no program holds', a.prods.length === 2 && a.prods[0] === 'IDPF', JSON.stringify(a));
|
|
206
|
+
ok('A documents, New initiative, Jira and asks work across products; only the sprint waits for a product to be picked', !a.docs && !a.nw && a.chips.includes('chJira') && a.chips.includes('chAsks') && !a.chips.includes('chSprint'), JSON.stringify(a));
|
|
207
|
+
const other = await p.evaluate(() => { const b = [...document.querySelectorAll('#ibBody .bt-kid .bt-nm')].pop(); return b ? b.dataset.key : null; });
|
|
208
|
+
ok('A each row keeps its own product in its key', /^[a-z-]+\//.test(other || ''), other);
|
|
209
|
+
await p.click('#ibTabs [data-v="list"]');
|
|
210
|
+
await p.waitForTimeout(300);
|
|
211
|
+
const L = await p.evaluate(() => [...document.querySelectorAll('#ibBody .bd-lt .bd-pt:first-of-type .bd-ell')].map((x) => x.textContent));
|
|
212
|
+
ok('A List: the Product column names each row\'s own product', new Set(L).size === 2, JSON.stringify(L));
|
|
213
|
+
ok('A the page threw nothing', !errors.length, errors.join('\n'));
|
|
214
|
+
await ctx.close();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Z zero is silence; the phone */
|
|
218
|
+
{
|
|
219
|
+
const { ctx, page: p } = await open({ programs: [] });
|
|
220
|
+
ok('Z with no program on the board: no group head, no band, and no grouping control', await p.evaluate(() => !document.querySelector('#ibBody .bt-pg, #ibBody .bt-prd') && document.querySelector('#bdGrpw').hidden));
|
|
221
|
+
await ctx.close();
|
|
222
|
+
const R = await open({ w: 390, h: 844 });
|
|
223
|
+
ok('Z on a phone the program is a head card with its next milestone, and nothing scrolls sideways', await R.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && !!document.querySelector('#ibBody .bt-pg .bd-pm') && getComputedStyle(document.querySelector('#ibBody .bt-pg .bt-spread')).display === 'none'));
|
|
224
|
+
await R.ctx.close();
|
|
225
|
+
}
|
|
226
|
+
finish();
|
|
227
|
+
})();
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/* board-shot.js — screenshots of the Board with Project Ascent (initiative program-hierarchy: PgBoard, PgBoardProduct, PgKanban, PgTimeline, PgList)
|
|
4
|
+
* at 1440x900 and 390x844 against the Board's program fixture (fixtures/board-premium-facts.js programFacts). Not a suite: a look at the page.
|
|
5
|
+
* OUT=<dir> names where the PNGs go (default: the state folder of this run). WS=microsites shoots the other product's board. */
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
|
+
const { findBrowser } = require('./lib/find-browser');
|
|
10
|
+
const T = require('./test-run').configure({ name: 'board-shot' });
|
|
11
|
+
const BP = require('./lib/board-premium.js');
|
|
12
|
+
const F = require('./fixtures/board-premium-facts.js');
|
|
13
|
+
const OUT = process.env.OUT || T.STATE_DIR;
|
|
14
|
+
const item = (o = {}) => ({ since: null, sinceFrom: null, days: null, skipped: [], parts: null, next: null, you: null, links: {}, drafted: [], gate: null, drift: [], deps: [], theme: null, tickets: {}, ...o });
|
|
15
|
+
const part = (name, done, you) => ({ name, done: !!done, you: !!you });
|
|
16
|
+
const TRAIL = { ok: true, at: '2026-10-17T09:12:00.000Z', usual: {}, themes: [], items: {
|
|
17
|
+
'legacy-idp-sunset': item({ days: 6, parts: [part('problem', 1), part('business case'), part('who asked'), part('success measure')], next: 'business case' }),
|
|
18
|
+
'descope-parity': item({ days: 12, parts: [part('problem', 1), part('scope', 1), part('risks', 1), part('your review', 0, 1), part('metrics'), part('rollout')], next: 'your review', you: { text: 'Your turn · review step', kind: 'you' } }),
|
|
19
|
+
'usage-billing': item({ days: 21, parts: [part('problem', 1), part('business case'), part('who asked'), part('success measure')], next: 'business case' }),
|
|
20
|
+
'eshop-inline-login': item({ days: 17 }),
|
|
21
|
+
'microsite-signin': item({ days: 4, parts: [part('scope', 1), part('timeline', 1), part('work breakdown', 0, 1)], next: 'work breakdown', you: { text: 'Your turn · approve 2 epics', kind: 'you' } }),
|
|
22
|
+
'psle-refresh': item({ days: 9 }),
|
|
23
|
+
} };
|
|
24
|
+
(async () => {
|
|
25
|
+
const { chromium } = require('playwright-core');
|
|
26
|
+
const srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
27
|
+
await T.waitForServer(T.BASE);
|
|
28
|
+
const browser = await chromium.launch({ executablePath: findBrowser() });
|
|
29
|
+
const ws = process.env.WS || 'idpf';
|
|
30
|
+
const model = (w) => BP.build(F.programFacts(w));
|
|
31
|
+
const errs = [];
|
|
32
|
+
const shots = (process.env.SHOTS || 'track,product,stages,time,list').split(',');
|
|
33
|
+
for (const [w, h, name] of [[1440, 900, '1440'], [390, 844, '390']]) {
|
|
34
|
+
for (const s of shots) {
|
|
35
|
+
if (name === '390' && (s === 'time' || s === 'product')) continue;
|
|
36
|
+
const ctx = await browser.newContext({ viewport: { width: w, height: h }, colorScheme: process.env.DARK ? 'dark' : 'light' });
|
|
37
|
+
await ctx.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: model(q.get('ws') || ws), as_of: Date.now() }) }); });
|
|
38
|
+
await ctx.route('**/api/programs', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, programs: F.programs() }) }));
|
|
39
|
+
await ctx.route('**/api/board-trail*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(TRAIL) }));
|
|
40
|
+
const v = s === 'product' ? 'track' : s;
|
|
41
|
+
await ctx.addInitScript(([v, s, phone]) => { try { localStorage.setItem(phone ? 'pmos.board.pview' : 'pmos.board.view', v); localStorage.setItem('pmos.board.grouping', s === 'product' ? 'product' : 'program'); } catch {} }, [v, s, name === '390']);
|
|
42
|
+
const p = await ctx.newPage();
|
|
43
|
+
p.on('pageerror', (e) => errs.push(name + ' ' + s + ': ' + e.message));
|
|
44
|
+
p.on('console', (m) => { if (m.type() === 'error' && !/Failed to load resource/.test(m.text())) errs.push(name + ' ' + s + ' console: ' + m.text()); });
|
|
45
|
+
await p.goto(T.BASE + '/premium-board.html' + (process.env.ALL ? '?all=1' : '?ws=' + ws + '&board=' + ws + (process.env.Q || '')));
|
|
46
|
+
await p.waitForTimeout(2500);
|
|
47
|
+
fs.mkdirSync(OUT, { recursive: true });
|
|
48
|
+
await p.screenshot({ path: path.join(OUT, 'board-' + s + '-' + name + (process.env.DARK ? '-dark' : '') + '.png') });
|
|
49
|
+
await ctx.close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
console.log(errs.join('\n') || 'no page errors');
|
|
53
|
+
await browser.close(); srv.kill('SIGKILL'); T.killTmux(); process.exit(0);
|
|
54
|
+
})();
|
|
@@ -35,7 +35,7 @@ const CUSTOM = [
|
|
|
35
35
|
const PAGES = {
|
|
36
36
|
board: { file: '/premium-board.html', api: '**/api/board-premium*', scope: 'board:w1', mk: (custom) => BP.build(BF.facts({ custom })), ready: '#ibBody .ini2', btn: '#addDoc', qs: '?theme=' },
|
|
37
37
|
// the initiative is a layout inside Home (premium-agreed-design): Add a document is in its Overview, a minimal form in the Viewer (Waiting for design)
|
|
38
|
-
initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '.hm-card [data-hm-ov]', btn: '#czViewer [data-
|
|
38
|
+
initiative: { file: '/premium.html', api: '**/api/initiative-premium*', scope: 'initiative:self-serve-v2', mk: (custom) => IP.build(IF.facts({ custom })), ready: '.hm-card [data-hm-ov]', btn: '#czViewer [data-hi-v="docs"]', qs: '?ini=self-serve-v2&ws=w1&board=w1&theme=' },
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
(async () => {
|
|
@@ -64,8 +64,11 @@ const PAGES = {
|
|
|
64
64
|
return { ctx, page, errors, posts, up, calls: () => calls, setCustom: (c) => { current = c; }, reply: (a) => { reply = a; } };
|
|
65
65
|
};
|
|
66
66
|
const txt = (p, s) => p.evaluate((q) => (document.querySelector(q) || {}).textContent || '', s);
|
|
67
|
+
const viaMore = async (pg, label) => { await pg.click('#czViewer:not([hidden]) [data-cz-vw="more"]'); await until(() => pg.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await pg.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${label}"))`); }; // the Overview's other views, Open the full record and Sprint sit under ⋯ (XvATasks)
|
|
67
68
|
// the Overview opens on Tasks; Add a document is on its Documents view (premium-uncovered-features, canvas InDocs)
|
|
68
|
-
|
|
69
|
+
// Documents is shell A (XvADocs): Add a document is under its ⋯, with Group by and Show
|
|
70
|
+
async function addDoc(page) { await page.click('#czViewer [data-cz-vw="more"]'); await page.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); }
|
|
71
|
+
async function docsView(page) { if (await until(() => page.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) [data-hi-v]')), 20000)) await (async (pg) => { if (await pg.$('#czViewer [data-hi-view="docs"]')) await pg.click('#czViewer [data-hi-view="docs"]'); else await viaMore(pg, 'Documents'); })(page); }
|
|
69
72
|
|
|
70
73
|
/* the Board (premium-uncovered-features, BdDocs): the Documents tab is a table with an Add a document form in the side panel;
|
|
71
74
|
the same route, the same fields, the same refusals */
|
|
@@ -75,37 +78,37 @@ const PAGES = {
|
|
|
75
78
|
if (!A.up) return finish(1);
|
|
76
79
|
ok('board A1 the Documents tab has an Add a document button', await p.evaluate(() => { const b = document.querySelector('#docBody #addDoc'); return !!b && b.textContent === 'Add a document'; }));
|
|
77
80
|
await p.click('#addDoc');
|
|
78
|
-
const form = await until(() => p.evaluate(() => { const f = document.querySelector('#
|
|
81
|
+
const form = await until(() => p.evaluate(() => { const f = document.querySelector('#czViewer form[data-form="adddoc"]'); return f ? { title: document.querySelector('#czViewer .cz-vw-title').textContent, seg: [...f.querySelectorAll('.bd-rad span')].map((x) => x.textContent), kinds: [...f.kind.options].map((o) => o.textContent), uOff: f.url.disabled, note: f.querySelector('.bd-amut').textContent, dlg: !!document.querySelector('#dlg.on') } : null; }));
|
|
79
82
|
ok('board A1 the side panel has the dialog\'s fields, and the old dialog stays shut', !!form && form.title === 'Add a document' && form.seg.join() === 'PMOS drafts it,I write it' && form.kinds.join() === 'In PMOS,Confluence,Google Docs,Google Slides' && form.uOff && !form.dlg, JSON.stringify(form));
|
|
80
83
|
ok('board A7 it says the document is saved and the linked page is not read', !!form && /saved on the board's record/.test(form.note) && /does not read or sync/.test(form.note), form && form.note);
|
|
81
|
-
const go = '#
|
|
84
|
+
const go = '#czViewer form[data-form="adddoc"] [type="submit"]';
|
|
82
85
|
await p.click(go); await sleep(120);
|
|
83
86
|
ok('board A4 an empty title is refused in the panel and posts nothing', /Give the document a title/.test(await txt(p, '#formM')) && A.posts.length === 0);
|
|
84
|
-
await p.fill('#
|
|
85
|
-
ok('board A1 the address field opens for a link kind', await p.evaluate(() => !document.querySelector('#
|
|
87
|
+
await p.fill('#czViewer input[name="title"]', 'UAT plan'); await p.selectOption('#czViewer select[name="kind"]', 'Confluence');
|
|
88
|
+
ok('board A1 the address field opens for a link kind', await p.evaluate(() => !document.querySelector('#czViewer input[name="url"]').disabled));
|
|
86
89
|
await p.click(go); await sleep(120);
|
|
87
90
|
ok('board A4 a link kind with no address is refused in the panel and posts nothing', /Paste the address of the Confluence page/.test(await txt(p, '#formM')) && A.posts.length === 0);
|
|
88
91
|
A.reply({ status: 409, body: { ok: false, error: '“UAT plan” is already on this board.' } });
|
|
89
|
-
await p.fill('#
|
|
90
|
-
ok('board A4 a refusal from the route is shown in the panel, which stays open', /already on this/.test(await txt(p, '#formM')) && await p.evaluate((g) => !document.querySelector('#
|
|
92
|
+
await p.fill('#czViewer input[name="url"]', 'https://example.atlassian.net/wiki/x'); await p.click(go); await sleep(300);
|
|
93
|
+
ok('board A4 a refusal from the route is shown in the panel, which stays open', /already on this/.test(await txt(p, '#formM')) && await p.evaluate((g) => !document.querySelector('#czViewer').hidden && !document.querySelector(g).disabled, go));
|
|
91
94
|
A.reply({ status: 200, body: { ok: true } }); const calls0 = A.calls();
|
|
92
|
-
await p.check('#
|
|
95
|
+
await p.check('#czViewer input[name="writer"][value="you"]'); await p.click(go); await sleep(500);
|
|
93
96
|
const last = A.posts[A.posts.length - 1], mint = await T.nonce(BASE);
|
|
94
97
|
const want = { ws: 'w1', scope: P.scope, title: 'UAT plan', writer: 'you', kind: 'Confluence', url: 'https://example.atlassian.net/wiki/x' };
|
|
95
98
|
ok('board A3 the press posts the entered fields to the one route, with the launch nonce and no writer field', last && last.path === '/api/custom-docs/add' && JSON.stringify(Object.keys(last.body).sort()) === JSON.stringify(Object.keys(want).sort()) && Object.keys(want).every((k) => last.body[k] === want[k] || k === 'ws') && !!mint && last.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in last.body), JSON.stringify(last && last.body));
|
|
96
99
|
ok('board A3 nothing else was posted', A.posts.every((x) => x.path === '/api/custom-docs/add'));
|
|
97
|
-
ok('board A1 the panel closes, the page reads again and says it was added', A.calls() > calls0 && await p.evaluate(() => document.querySelector('#
|
|
100
|
+
ok('board A1 the panel closes, the page reads again and says it was added', A.calls() > calls0 && await p.evaluate(() => document.querySelector('#czViewer').hidden && /is added to the board's documents/.test(document.querySelector('#bdToast').textContent)));
|
|
98
101
|
A.setCustom(CUSTOM); await p.reload(); await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready), 20000); await p.click('#tabDocs'); await sleep(300);
|
|
99
102
|
const rows = await p.evaluate(() => [...document.querySelectorAll('#docBody .bd-dt[data-docrow]')].map((r) => { const c = r.querySelectorAll('[role="cell"]'); return { id: r.dataset.docrow, t: r.querySelector('[data-opendoc]').textContent, s: c[1].textContent, when: c[2].textContent, by: c[3].textContent, btn: r.querySelectorAll('button').length }; }));
|
|
100
103
|
const uat = rows.find((r) => r.t === 'UAT plan'), con = rows.find((r) => r.t === 'Contract');
|
|
101
104
|
ok('board A5 an unlinked document reads Not started with the date it was added, who writes it, and no press but its title', uat && uat.s === 'Not started' && /18 Oct/.test(uat.when) && /You write it/.test(uat.by) && uat.btn === 1, JSON.stringify(uat));
|
|
102
105
|
ok('board A5 a linked document reads Linked and has no press but its title', con && con.s === 'Linked' && con.btn === 1, JSON.stringify(con));
|
|
103
106
|
await p.click(`#docBody [data-opendoc="${con.id}"]`);
|
|
104
|
-
ok('board A5 a linked document opens with its address as text', await until(() => p.evaluate(() => { const o = document.querySelector('#
|
|
107
|
+
ok('board A5 a linked document opens with its address as text', await until(() => p.evaluate(() => { const o = document.querySelector('#czViewer'); return !o.hidden && /Lives in Confluence: https:\/\/example\.atlassian\.net/.test(o.textContent) && !o.querySelector('a[href^="https://example"]'); })), await txt(p, '#czViewer'));
|
|
105
108
|
ok('board no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
106
109
|
await A.ctx.close();
|
|
107
110
|
const N = await open('board', { w: 390, h: 844 }); await N.page.click('#addDoc'); await sleep(300);
|
|
108
|
-
const fl = await N.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, add: Math.round(document.querySelector('#addDoc').getBoundingClientRect().height), go: Math.round(document.querySelector('#
|
|
111
|
+
const fl = await N.page.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, add: Math.round(document.querySelector('#addDoc').getBoundingClientRect().height), go: Math.round(document.querySelector('#czViewer form[data-form="adddoc"] [type="submit"]').getBoundingClientRect().height) }));
|
|
109
112
|
ok('board A8 at 390 px no sideways scroll with the form open, and its buttons are 44 px', !fl.over && fl.add >= 44 && fl.go >= 44, JSON.stringify(fl));
|
|
110
113
|
await N.ctx.close();
|
|
111
114
|
}
|
|
@@ -117,8 +120,9 @@ const PAGES = {
|
|
|
117
120
|
const dlgShut = () => p.evaluate(() => { const d = document.querySelector('#dlg'); return !d || !d.classList.contains('on'); });
|
|
118
121
|
ok(`${kind} 0 the page draws (Home with the initiative, its Overview open)`, A.up);
|
|
119
122
|
if (!A.up) return finish(1);
|
|
120
|
-
|
|
121
|
-
|
|
123
|
+
await p.click('#czViewer [data-cz-vw="more"]');
|
|
124
|
+
ok(`${kind} A1 the Overview's Documents view has Add a document under ⋯`, await p.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-menu button')].some((b) => /^Add a document/.test(b.textContent.trim()))));
|
|
125
|
+
await p.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
|
|
122
126
|
const form = await p.evaluate((V) => ({ open: !!document.querySelector(V + ' #adT'), title: (document.querySelector('#czVwTitle') || {}).textContent || '', wait: !!document.querySelector(V + ' .hx-wait'), phase: !!document.querySelector(V + ' #adPh'), seg: [...document.querySelectorAll(V + ' #adW button')].map((b) => b.textContent), kinds: [...document.querySelectorAll(V + ' #adK option')].map((o) => o.textContent), uOff: document.querySelector(V + ' #adU').disabled, note: (document.querySelector(V + ' [data-ad-note]') || {}).textContent || '' }), F);
|
|
123
127
|
ok(`${kind} A1 the form in the Viewer has the dialog's fields, with no "Waiting for design" tag (premium-uncovered-features), and the old dialog stays shut`, form.open && /^Add a document/.test(form.title) && !form.wait && form.phase === ini && form.seg.join() === 'PMOS drafts it,I write it' && form.kinds.join() === 'In PMOS,Confluence,Google Docs,Google Slides' && form.uOff && await dlgShut(), JSON.stringify(form));
|
|
124
128
|
ok(`${kind} A7 the form says the document is saved and the linked page is not read`, /saved on the (board|initiative)'s record/.test(form.note) && /does not read or sync/.test(form.note), form.note);
|
|
@@ -139,24 +143,25 @@ const PAGES = {
|
|
|
139
143
|
if (ini) want.phase = 'Plan';
|
|
140
144
|
ok(`${kind} A3 the press posts the entered fields to the one route, with the launch nonce and no writer field`, last && last.path === '/api/custom-docs/add' && JSON.stringify(Object.keys(last.body).sort()) === JSON.stringify(Object.keys(want).sort()) && Object.keys(want).every((k) => last.body[k] === want[k] || k === 'ws') && !!mint && last.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in last.body), JSON.stringify(last && last.body));
|
|
141
145
|
ok(`${kind} A3 nothing else was posted`, A.posts.every((x) => x.path === '/api/custom-docs/add'));
|
|
142
|
-
ok(`${kind} A1 the form closes, the initiative is read again and its Overview comes back`, await until(() => A.calls() > calls0) && await until(() => p.evaluate(() => !document.querySelector('#czViewer #adT') && !!document.querySelector('#czViewer [data-
|
|
146
|
+
ok(`${kind} A1 the form closes, the initiative is read again and its Overview comes back`, await until(() => A.calls() > calls0) && await until(() => p.evaluate(() => !document.querySelector('#czViewer #adT') && !!document.querySelector('#czViewer [data-hi-v="docs"]'))));
|
|
143
147
|
A.setCustom(CUSTOM.map((d) => Object.assign({}, d, { scope: P.scope }))); await p.reload();
|
|
144
148
|
await until(() => p.evaluate((s) => !!document.querySelector(s), P.ready), 20000); await p.click(P.ready); await docsView(p);
|
|
145
149
|
await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-ov-doc="custom:cd-2"]')), 20000);
|
|
146
150
|
// a row: the title, its state pill, then what it is (when, who writes it, where it lives) and the link as text (InDocs)
|
|
147
|
-
|
|
151
|
+
// shell A (XvADocs): a row is one press, its title then one quiet line (when, who writes it, the state) and the link as text
|
|
152
|
+
const rows = await p.evaluate(() => [...document.querySelectorAll('#czViewer [data-ov-doc]')].map((r) => { const w = r.querySelector('.w') || r, sub = [...w.querySelectorAll(':scope > span')].map((x) => x.textContent); return { t: (w.firstChild && w.firstChild.nodeType === 3 ? w.firstChild.textContent : '').trim(), meta: sub.filter((x) => !/: https?:/.test(x)).join(' · '), small: sub.filter((x) => /: https?:/.test(x)).join(' '), btn: r.querySelectorAll('button:not([disabled]):not([data-ov-none])').length, none: !!r.querySelector('[data-ov-none]') }; })); // a document with no file says so when pressed (testing fixes); it opens nothing
|
|
148
153
|
const uat = rows.find((r) => r.t === 'UAT plan'), con = rows.find((r) => r.t === 'Contract');
|
|
149
|
-
ok(`${kind} A5 an unlinked document reads Not started with the date it was added and no press`, uat &&
|
|
150
|
-
ok(`${kind} A5 a linked document reads Linked, shows its address as text and has no press`, con &&
|
|
154
|
+
ok(`${kind} A5 an unlinked document reads Not started with the date it was added and no press`, uat && /Not started/.test(uat.meta) && /added 18 Oct/.test(uat.meta) && /You write it/.test(uat.meta) && uat.btn === 0 && uat.none, JSON.stringify(uat));
|
|
155
|
+
ok(`${kind} A5 a linked document reads Linked, shows its address as text and has no press`, con && /Linked/.test(con.meta) && /Confluence: https:\/\/example\.atlassian\.net/.test(con.small) && con.btn === 0 && !/Up to date/.test(con.meta), JSON.stringify(con));
|
|
151
156
|
const sum = await txt(p, '#czViewer [data-ov-dsum]');
|
|
152
157
|
ok(`${kind} A5 the summary counts one linked and the up-to-date ones`, /1\s*linked/.test(sum) && /up to date/.test(sum), sum);
|
|
153
158
|
ok(`${kind} A5 a linked document is listed apart from the up-to-date ones (no Up to date on it, no Open press)`, !!con && !/Up to date/.test(con.meta) && con.btn === 0); // the old filter chips are not in the Agreed design
|
|
154
|
-
await p
|
|
159
|
+
await addDoc(p); await until(() => p.evaluate(() => !!document.querySelector('#czViewer #adT')));
|
|
155
160
|
await p.keyboard.press('Escape'); await sleep(250);
|
|
156
161
|
ok(`${kind} A8 Escape closes the form`, await p.evaluate(() => !document.querySelector('#czViewer #adT')));
|
|
157
162
|
ok(`${kind} no page error`, A.errors.length === 0, A.errors.join(' | '));
|
|
158
163
|
await A.ctx.close();
|
|
159
|
-
const N = await open(kind, { w: 390, h: 844 }); await N.page
|
|
164
|
+
const N = await open(kind, { w: 390, h: 844 }); await addDoc(N.page); await until(() => N.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
|
|
160
165
|
const floors = await N.page.evaluate(() => { const h = (s) => Math.round(document.querySelector('#czViewer ' + s).getBoundingClientRect().height); return { go: h('#adGo'), no: h('#adNo'), t: h('#adT'), k: h('#adK'), w: h('#adW button'), fs: getComputedStyle(document.querySelector('#czViewer #adT')).fontSize }; });
|
|
161
166
|
ok(`${kind} A8 at 390 px the presses and fields are at least 44 px and the fields do not zoom the page`, [floors.go, floors.no, floors.t, floors.k, floors.w].every((v) => v >= 44) && parseFloat(floors.fs) >= 16, JSON.stringify(floors));
|
|
162
167
|
ok(`${kind} A8 no sideways scroll at 390 px with the form open`, await N.page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1 && document.querySelector('#czViewer').getBoundingClientRect().right <= innerWidth + 1));
|
|
@@ -187,8 +192,9 @@ const PAGES = {
|
|
|
187
192
|
* the solid colour. The colours are read from the page's own tokens, so a theme is checked against itself. */
|
|
188
193
|
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
189
194
|
const R = await open('initiative', { w, h, theme: th });
|
|
190
|
-
|
|
191
|
-
await R.page.
|
|
195
|
+
await R.page.click('#czViewer [data-cz-vw="more"]'); // the press is a ⋯ menu item now (shell A): its font, and the round ⋯ it hangs from
|
|
196
|
+
const btn = await R.page.evaluate(() => { const cs = getComputedStyle(document.querySelector('#czViewer .cz-vw-menu button')), m = getComputedStyle(document.querySelector('#czViewer [data-cz-vw="more"]')); return { ff: cs.fontFamily, br: m.borderRadius }; });
|
|
197
|
+
await R.page.click('#czViewer .cz-vw-menu button:has-text("Add a document")'); await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer #adT')));
|
|
192
198
|
const g = await R.page.evaluate(() => {
|
|
193
199
|
const tok = (v, prop) => { const x = document.createElement('i'); x.style.setProperty(prop, 'var(' + v + ')'); document.querySelector('#czViewer').appendChild(x); const c = getComputedStyle(x)[prop === 'color' ? 'color' : 'backgroundColor']; x.remove(); return c; };
|
|
194
200
|
const cs = (s) => getComputedStyle(document.querySelector(s));
|