create-pmos 0.402.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 +13 -13
- package/payload/KIT-VERSION +1 -1
- 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/workspace/board-programs-test.js +6 -5
- package/workspace/briefing-premium-adddoc-test.js +28 -22
- package/workspace/briefing-premium-board-test.js +91 -73
- 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 +19 -17
- 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-test.js +4 -3
- package/workspace/changelog.json +12 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +24 -2
- package/workspace/guide/jira.md +38 -6
- package/workspace/home-rows-test.js +184 -0
- 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/routes-brief-page.js +8 -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/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +30 -24
- 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 +46 -23
- 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 +64 -55
- package/workspace/public/pm/bd-acts.js +1 -1
- package/workspace/public/pm/bd-asks.js +22 -7
- 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 +176 -191
- package/workspace/public/pm/cozy-board.css +5 -28
- 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 +9 -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 +11 -34
- 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-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 +122 -58
- package/workspace/public/pm/home-chat.js +11 -2
- 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 +6 -14
- 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 +3 -3
- package/workspace/public/pm/premium-board.js +73 -235
- 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/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 +0 -1
- package/workspace/server.js +4 -2
- package/workspace/skills/jira-push.skill +3 -3
- package/workspace/test-lists/prd-to-jira.json +6 -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
|
@@ -43,7 +43,8 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
43
43
|
const tap = (p, sel) => p.$eval('#czViewer ' + sel, (b) => b.click());
|
|
44
44
|
const text = (p) => p.evaluate(() => (document.querySelector('#czViewer') || {}).innerText || '');
|
|
45
45
|
const notesPosts = (S) => S.posts.filter((x) => x.path.startsWith('/api/notes/')).map((x) => x.path.replace('/api/notes/', ''));
|
|
46
|
-
|
|
46
|
+
// Viewer shell A: the state is the summary's line, "Recording · 01:05" or "Paused at 01:05"
|
|
47
|
+
const chip = (p) => p.evaluate(() => { const t = (document.querySelector('#czViewer .czs-sum .czs-line') || {}).textContent || ''; return /^Recording · /.test(t) ? 'Recording' : /^Paused at /.test(t) ? 'Paused' : t; });
|
|
47
48
|
const LIVE_URL = '/premium-viewer.html?open=meeting&event=ev-live&date=' + F.dayKey(W.LIVE);
|
|
48
49
|
const ALL = [];
|
|
49
50
|
const open = async (url, o) => { const X = await F.open(browser, BASE, url, { noLive: true, ...o }); ALL.push(X); return X; };
|
|
@@ -51,8 +52,8 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
51
52
|
/* R1 record */
|
|
52
53
|
const A = await open(LIVE_URL);
|
|
53
54
|
const p = A.page;
|
|
54
|
-
ok('R1 a meeting under way has Record', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .
|
|
55
|
-
await
|
|
55
|
+
ok('R1 a meeting under way has Record', await until(() => p.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="record"]')), 15000));
|
|
56
|
+
await F.more(p, 'What Record and Focus do');
|
|
56
57
|
ok('R1 More says what Record and Focus do', await until(async () => /stay on this machine|on this machine/i.test(await text(p)) && !!(await p.$('#czViewer .vz-why'))), (await text(p)).slice(0, 400));
|
|
57
58
|
ok('R1 nothing was sent to the notes routes before a press', notesPosts(A.S).length === 0);
|
|
58
59
|
await tap(p, '[data-a="record"]');
|
|
@@ -63,14 +64,14 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
63
64
|
await tap(p, '[data-a="recgo"]');
|
|
64
65
|
const made = await until(() => A.S.posts.find((x) => x.path === '/api/notes/new'));
|
|
65
66
|
ok('R1 "I told them, start" makes the note for the calendar event, then listens on it', made && JSON.stringify(made.body).includes('ev-live') && await until(() => notesPosts(A.S).join() === 'new,record'), JSON.stringify(made && made.body));
|
|
66
|
-
ok('R2 the card says Recording, with the clock and Stop', await until(async () => (await chip(p)) === 'Recording' && /Recording · \d{2}:\d{2}/.test(await text(p)) && !!(await p.$('#czViewer .
|
|
67
|
+
ok('R2 the card says Recording, with the clock and Stop', await until(async () => (await chip(p)) === 'Recording' && /Recording · \d{2}:\d{2}/.test(await text(p)) && !!(await p.$('#czViewer .czs-sum [data-a="stop"]'))));
|
|
67
68
|
ok('R3 no floating record chip is drawn while it records', !(await p.$('#recChip, #recCtl')));
|
|
68
69
|
|
|
69
70
|
/* R2 pause and resume */
|
|
70
|
-
await tap(p, '.
|
|
71
|
-
ok('R2 Pause pauses through the route and the card says Paused with Resume', await until(async () => (await chip(p)) === 'Paused' && /
|
|
71
|
+
await tap(p, '.czs-sum [data-a="pause"]');
|
|
72
|
+
ok('R2 Pause pauses through the route and the card says Paused with Resume', await until(async () => (await chip(p)) === 'Paused' && /Paused at \d{2}:\d{2}\s+Nothing is kept while paused\./.test(await text(p)) && !!(await p.$('#czViewer .czs-sum [data-a="resume"]'))));
|
|
72
73
|
ok('R3 no record chip while it is paused either', !(await p.$('#recChip, #recCtl')));
|
|
73
|
-
await tap(p, '.
|
|
74
|
+
await tap(p, '.czs-sum [data-a="resume"]');
|
|
74
75
|
ok('R2 Resume listens again on the same note, without asking for consent twice', await until(() => notesPosts(A.S).join() === 'new,record,pause,record') && !/Tell everyone first/.test(await text(p)));
|
|
75
76
|
|
|
76
77
|
/* R4 leaving while it records */
|
|
@@ -81,12 +82,12 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
81
82
|
ok('R4 leaving the page while it records makes the browser ask first, and staying pauses nothing', await until(() => dialog === 'beforeunload') && notesPosts(A.S).join() === 'new,record,pause,record', String(dialog));
|
|
82
83
|
|
|
83
84
|
/* R1 stop */
|
|
84
|
-
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .
|
|
85
|
-
await tap(p, '.
|
|
85
|
+
await until(() => p.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="stop"]')));
|
|
86
|
+
await tap(p, '.czs-sum [data-a="stop"]');
|
|
86
87
|
ok('R1 Stop asks first', await until(async () => /Stop for good/.test(await text(p))));
|
|
87
88
|
await tap(p, '[data-a="askno"]');
|
|
88
89
|
ok('R1 Not yet on the ask stops nothing', await until(async () => !/Stop for good/.test(await text(p))) && !notesPosts(A.S).includes('stop'));
|
|
89
|
-
await tap(p, '.
|
|
90
|
+
await tap(p, '.czs-sum [data-a="stop"]');
|
|
90
91
|
await tap(p, '[data-a="stopgo"]');
|
|
91
92
|
ok('R1 Stop for good ends the meeting through the route, and the card says so', await until(async () => notesPosts(A.S).includes('stop') && /Stopped\. The final notes are written now/.test(await text(p))));
|
|
92
93
|
ok('R10 the notes writes sent were new, record, pause, record, stop and nothing else', notesPosts(A.S).join() === 'new,record,pause,record,stop', notesPosts(A.S).join());
|
|
@@ -123,9 +124,10 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
123
124
|
/* R5 Focus */
|
|
124
125
|
const B = await open('/premium-viewer.html?open=meeting¬e=n2', { noLive: false, init: () => { window.__premiumHolding = { id: 'n2' }; } });
|
|
125
126
|
const q = B.page;
|
|
126
|
-
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-czs-fold="agenda"]')), 15000);
|
|
128
|
+
// Viewer kit (XvALive): the topic now is in the summary; the agenda with the minutes used and Change topic are the Agenda fold
|
|
129
|
+
if (await q.evaluate(() => document.querySelector('#czViewer [data-czs-fold="agenda"]').getAttribute('aria-expanded') !== 'true')) await tap(q, '[data-czs-fold="agenda"]');
|
|
130
|
+
ok('R5 Focus: Now on the topic, topic 2 of 3, and the agenda with the minutes used', await until(async () => { const t = await text(q); return /Now on: The Issue button, topic 2 of 3\./.test(t) && /One toolbar row/.test(t) && /Phone layout/.test(t) && /\d+ of 10/.test(t) && !(await q.$('#czViewer [data-cz-placeholder]')); }), (await text(q)).slice(0, 600));
|
|
129
131
|
const f0 = B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length;
|
|
130
132
|
ok('R5 Focus reads again while the meeting is live', await until(() => B.S.gets.filter((g) => g.startsWith('/api/meeting-focus')).length >= f0 + 2, 12000));
|
|
131
133
|
await tap(q, '[data-a="topic"]');
|
|
@@ -141,8 +143,10 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
141
143
|
/* R7 Replay */
|
|
142
144
|
const C = await open('/premium-viewer.html?open=meeting¬e=n1');
|
|
143
145
|
const r = C.page;
|
|
144
|
-
|
|
145
|
-
await
|
|
146
|
+
// Viewer kit (XvAReplay): no tabs; the replay card sits under the summary, the kept points are the "All N kept" fold, the lines the Transcript fold
|
|
147
|
+
const unfold = async (id) => { if (await r.evaluate((k) => document.querySelector(`#czViewer [data-czs-fold="${k}"]`).getAttribute('aria-expanded') !== 'true', id)) await tap(r, `[data-czs-fold="${id}"]`); };
|
|
148
|
+
ok('R7 a kept recording has the replay card under the summary', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzp-card .vzp-pl') && !document.querySelector('#czViewer [role="tablist"]')), 15000));
|
|
149
|
+
await unfold('kept');
|
|
146
150
|
const playing = () => r.evaluate(() => /^Pause/.test((document.querySelector('#czViewer .vzp-dt [data-a="play"]') || { getAttribute: () => '' }).getAttribute('aria-label') || ''));
|
|
147
151
|
ok('R7 Replay shows the player, the strip and the kept points (MtReplay)', await until(() => r.evaluate(() => !!document.querySelector('#czViewer .vzp-dt .vzp-strip') && document.querySelectorAll('#czViewer .vzp-kr').length > 0)));
|
|
148
152
|
await tap(r, '.vzp-dt [data-a="play"]');
|
|
@@ -157,16 +161,16 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
157
161
|
await r.$eval('#czViewer .vzp-dt .vzp-th[data-a="seekto"]', (b) => b.click());
|
|
158
162
|
ok('R7 a capture plays from its time, with the topic of that time', await until(async () => /^03:1\d$/.test(await pos()) && await r.evaluate(() => /Viewer beside the chat/.test((document.querySelector('#czViewer .vzp-top[aria-current="true"]') || {}).textContent || ''))), await pos());
|
|
159
163
|
await tap(r, '.vzp-dt [data-a="play"]');
|
|
160
|
-
/* R12 every line: the Transcript
|
|
161
|
-
await
|
|
164
|
+
/* R12 every line: the Transcript fold seeks the replay */
|
|
165
|
+
await unfold('tr');
|
|
162
166
|
ok('R12 the Transcript lists every line, each with its time to play from', await until(async () => /Saved views move in their own work-item\./.test(await text(r)) && !!(await r.$('#czViewer [data-a="trseek"][data-t="760000"]'))), (await text(r)).slice(0, 300));
|
|
163
167
|
await r.$eval('#czViewer [data-a="trseek"][data-t="760000"]', (b) => b.click());
|
|
164
|
-
ok('R12 a line plays from its time
|
|
168
|
+
ok('R12 a line plays from its time in the replay card', await until(async () => /^12:[45]\d$/.test(await pos())), await pos());
|
|
165
169
|
await C.ctx.close();
|
|
166
170
|
|
|
167
171
|
/* R11 floors */
|
|
168
172
|
const D = await open('/premium-viewer.html?open=meeting¬e=n2', { noLive: false, w: 390, h: 844, init: () => { window.__premiumHolding = { id: 'n2' }; } });
|
|
169
|
-
await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .
|
|
173
|
+
await until(() => D.page.evaluate(() => !!document.querySelector('#czViewer .czs-sum [data-a="stop"]')), 15000);
|
|
170
174
|
const fl = await D.page.evaluate(() => ({ over: document.documentElement.scrollWidth - innerWidth, chip: !!document.querySelector('#recChip, #recCtl') }));
|
|
171
175
|
ok('R11 at 390 px the live card has no sideways scroll and no floating record chip', fl.over <= 0 && !fl.chip, JSON.stringify(fl));
|
|
172
176
|
await D.ctx.close();
|
|
@@ -44,39 +44,41 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
44
44
|
const open = async (url, o) => { const X = await F.open(browser, BASE, url, { noLive: true, ...o }); ALL.push(X); return X; };
|
|
45
45
|
|
|
46
46
|
/* C1 the strip (on a Saturday or Sunday no day of the Mon–Fri strip is today, so none is pressed) */
|
|
47
|
-
const WEEKDAY = [1, 2, 3, 4, 5].includes(new Date().getDay());
|
|
48
47
|
const A = await open('/premium-viewer.html?open=calendar');
|
|
49
48
|
const p = A.page;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
// Viewer kit (XvACal): the calendar opens on the day, with today's summary first; the week and month are in ⋯
|
|
50
|
+
ok('C1 the calendar opens in the Viewer card on the day', await until(() => p.evaluate(() => document.querySelectorAll('#czViewer .vzc-dy').length === 5 && document.querySelectorAll('#czViewer .vzc-de').length > 0), 15000));
|
|
51
|
+
const weekday = ![0, 6].includes(new Date().getDay());
|
|
52
|
+
await until(() => p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].every((d) => d.getBoundingClientRect().height >= 44)), 8000); // the Meetings stylesheet loads after the day is drawn
|
|
53
53
|
const strip = await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].map((d) => ({ dow: d.querySelector('span').textContent, on: d.getAttribute('aria-pressed'), h: Math.round(d.getBoundingClientRect().height) })));
|
|
54
|
-
ok('C1 the strip has Monday to Friday and today is pressed', strip.map((d) => d.dow).join() === '
|
|
54
|
+
ok('C1 the strip has Monday to Friday and today is pressed on a weekday', strip.map((d) => d.dow).join() === 'MON,TUE,WED,THU,FRI' && strip.filter((d) => d.on === 'true').length === (weekday ? 1 : 0), JSON.stringify(strip));
|
|
55
55
|
ok('C1 each day button is at least 44 px', strip.every((d) => d.h >= 44), JSON.stringify(strip));
|
|
56
56
|
ok('C1 the week is read once when the page opens, for today\'s week, and Day reads nothing more', weekReads(A.S) === 1 && A.S.gets.some((g) => g.includes('view=week')), JSON.stringify(A.S.gets.filter((g) => g.startsWith('/api/calendar-views'))));
|
|
57
57
|
|
|
58
58
|
/* C2 the day */
|
|
59
59
|
const today = await text(p);
|
|
60
|
-
ok('C2
|
|
61
|
-
ok('C2 a row shows the time, the title
|
|
60
|
+
ok('C2 today\'s summary counts its meetings', /Today · \d+ meetings?/.test(today), today.slice(0, 400));
|
|
61
|
+
ok('C2 a row shows the time, the title and what it is about; the people are in the summary when it is next', /\d{2}:\d{2}\s+Rail review\s+Viewer/.test(today) && (!/Next: Rail review/.test(today) || /Next: Rail review with Sam, Wawan at \d{2}:\d{2}\./.test(today)), today.slice(0, 600));
|
|
62
62
|
await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => d.getAttribute('aria-pressed') === 'false' && /: 1 meeting$/.test(d.getAttribute('aria-label'))).click());
|
|
63
|
-
|
|
63
|
+
const list = () => p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-list, #czViewer .vzc-days ~ .vzc-mut')].map((e) => e.innerText).join('\n')); // the summary above stays today's
|
|
64
|
+
ok('C2 pressing a day lists that day only, with its count', await until(async () => { const t = await list(); return /1:1 with Dita/.test(t) && !/Rail review/.test(t) && /\b1 meeting\b/.test(t); }), await list());
|
|
64
65
|
ok('C2 another day of the same week is not read again', weekReads(A.S) === 1);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
else { await p.reload(); await until(() => p.evaluate(() => !!document.querySelector('#czViewer [data-c="view"][data-k="day"]')), 15000); await tap(p, '[data-c="view"][data-k="day"]'); }
|
|
66
|
+
if (weekday) await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-dy')].find((d) => /today/.test(d.getAttribute('aria-label'))).click());
|
|
67
|
+
else await F.more(p, 'Back to today'); // the strip is Monday to Friday
|
|
68
68
|
ok('C2 pressing today brings Today back unchanged', await until(async () => (await text(p)) === today));
|
|
69
69
|
|
|
70
70
|
/* C4 a meeting */
|
|
71
71
|
await p.evaluate(() => [...document.querySelectorAll('#czViewer .vzc-de')].find((r) => /Rail review/.test(r.textContent)).click());
|
|
72
|
-
ok('C4 a row opens the meeting card with its title and when', await until(async () =>
|
|
72
|
+
ok('C4 a row opens the meeting card with its title and when', await until(async () => /^Rail review · \d{2}:\d{2}$/.test(await p.textContent('#czViewer .cz-vw-title')) && /^(Starts in \d+ (min|h)|On now)/.test(await p.textContent('#czViewer .czs-line'))), (await text(p)).slice(0, 300));
|
|
73
73
|
ok('C4 the card reads Focus for that meeting, and no replay (it has no note)', await until(() => A.S.gets.some((g) => /meeting-focus\?event=ev-rail/.test(g))) && !A.S.gets.some((g) => /meeting-replay/.test(g)));
|
|
74
74
|
ok('C4 the card has no conversation and no tabs', await p.evaluate(() => !document.querySelector('#dlg, .stream, #vTabs')));
|
|
75
75
|
|
|
76
76
|
/* C6, C7, C8 the parts */
|
|
77
|
-
ok('C6 with no note the card is the prep:
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
ok('C6 with no note the card is the prep: the gist first, Record as an icon, the Agenda fold, and no tabs', /Agree the rail before the Commit\./.test(await p.textContent('#czViewer .czs-sum')) && !!(await p.$('#czViewer .czs-sum [data-a="record"]')) && !!(await p.$('#czViewer [data-czs-fold="agenda"]')) && !(await p.$('#czViewer [role="tablist"]')));
|
|
78
|
+
if (await p.evaluate(() => document.querySelector('#czViewer [data-czs-fold="mat"]').getAttribute('aria-expanded') !== 'true')) await tap(p, '[data-czs-fold="mat"]');
|
|
79
|
+
const mats = await p.evaluate(() => document.querySelector('#czViewer .vzm-mats').innerText);
|
|
80
|
+
ok('C7 the material fold lists each with its kind, how it opens and its topic; a deck has Present', /Rail PRD\s+PMOS document/.test(mats) && /Website · opens live · for The report panel/.test(mats) && !!(await p.$('#czViewer .vzm-mats [data-a="present"]')), mats);
|
|
81
|
+
ok('C8 with no recording the card offers no Replay', !(await p.$('#czViewer .vzp-card')));
|
|
80
82
|
|
|
81
83
|
/* C5 link it: a calendar meeting is linked for its whole series */
|
|
82
84
|
await tap(p, '[data-a="m-about"]');
|
|
@@ -97,7 +99,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
97
99
|
|
|
98
100
|
/* C8 a kept recording offers Replay */
|
|
99
101
|
const R = await open('/premium-viewer.html?open=meeting¬e=n1');
|
|
100
|
-
ok('C8 a kept recording offers Replay, and the card reads its replay', await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer
|
|
102
|
+
ok('C8 a kept recording offers Replay, and the card reads its replay', await until(() => R.page.evaluate(() => !!document.querySelector('#czViewer .vzp-card .vzp-pl')), 15000) && R.S.gets.some((g) => /meeting-replay\?note=n1/.test(g)));
|
|
101
103
|
await R.ctx.close();
|
|
102
104
|
|
|
103
105
|
/* C3 honest states */
|
|
@@ -105,7 +107,7 @@ const json = (r, b, status = 200) => r.fulfill({ status, contentType: 'applicati
|
|
|
105
107
|
await E.page.route('**/api/calendar-views*', (r) => { const w = W.week(); w.cells.forEach((c) => { c.events = []; }); return json(r, w); });
|
|
106
108
|
await E.page.route(/\/api\/notes(\?.*)?$/, (r) => json(r, { ok: true, notes: [], series_open: {} }));
|
|
107
109
|
await E.page.reload();
|
|
108
|
-
ok('C3 an empty
|
|
110
|
+
ok('C3 an empty day says so, and today\'s summary says no meetings', await until(async () => /No meetings on this day\./.test(await text(E.page)) && /Today · no meetings/.test(await text(E.page)) && !(await E.page.$('#czViewer .vzc-de'))), (await text(E.page)).slice(0, 400));
|
|
109
111
|
await E.page.route('**/api/calendar-views*', (r) => json(r, { ok: false, error: 'the calendar is not connected' }, 500));
|
|
110
112
|
await E.page.reload();
|
|
111
113
|
ok('C3 a failed read says the calendar was not read, with the reason, and draws no meeting', await until(async () => /The calendar was not read\. the calendar is not connected/.test(await text(E.page))) && !(await E.page.$('#czViewer .vzc-ev')), (await text(E.page)).slice(0, 300));
|
|
@@ -73,12 +73,17 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
|
|
|
73
73
|
// ready: the card is drawn from the board's row (kind · anchor) and, when the initiative reads, from its record (the ladder)
|
|
74
74
|
async function ready(page, full = true) { return until(() => page.evaluate((f) => !!document.querySelector('.hm-card [data-hm-ov]') && /·/.test((document.querySelector('.hm-card .hm-sw .k') || {}).textContent || '') && (!f || !!((document.querySelector('.hm-card .hm-lad b') || {}).textContent || '').trim()), full), 30000); }
|
|
75
75
|
const txt = (p, s) => p.evaluate((q) => ((document.querySelector(q) || {}).textContent || '').replace(/\s+/g, ' ').trim(), s);
|
|
76
|
-
// the Overview opens on Tasks,
|
|
77
|
-
const
|
|
76
|
+
// the Overview opens on Tasks; a phone keeps the Tasks, Documents and Stage switch, and in shell A on a desktop the other views sit under ⋯ (XvATasks); view names the one to show
|
|
77
|
+
const LABEL = { tasks: 'Tasks', docs: 'Documents', stage: 'Stage' };
|
|
78
|
+
const show = async (p, view) => {
|
|
79
|
+
if (await p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-view="${a[1]}"]`), [V, view])) await p.click(`${V} [data-hi-view="${view}"]`);
|
|
80
|
+
else { await p.click('#czViewer [data-cz-vw="more"]'); await until(() => p.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu'))); await p.click(`#czViewer .cz-vw-menu [role="menuitem"]:has(> span:first-child:text-is("${LABEL[view]}"))`); }
|
|
81
|
+
return until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-v="${a[1]}"]`), [V, view])); };
|
|
82
|
+
const moreLabels = (p) => p.evaluate(async () => { const b = document.querySelector('#czViewer [data-cz-vw="more"]'); if (!b) return []; b.click(); await new Promise((r) => setTimeout(r, 50)); const m = document.querySelector('#czViewer .cz-vw-menu'); const out = m ? [...m.querySelectorAll('[role="menuitem"] span:first-of-type')].map((x) => x.textContent) : []; b.click(); return out; });
|
|
78
83
|
const overview = async (p, view = 'stage') => {
|
|
79
84
|
if (!(await p.evaluate(() => { const b = document.querySelector('.hm-card [data-hm-ov]'); return !!b && !!b.offsetParent; }))) await p.click('#hmNeeds'); // a phone shows the list (and its card) in the sheet
|
|
80
85
|
await p.click('.hm-card [data-hm-ov]');
|
|
81
|
-
const s = await until(() => p.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-
|
|
86
|
+
const s = await until(() => p.evaluate((v) => { const o = document.querySelector(v); if (!o) return null; if (o.querySelector('[data-hi-v]')) return 'ok'; return /could not be read/.test(o.textContent) ? 'err' : null; }, V), 30000);
|
|
82
87
|
if (s === 'ok' && view) await show(p, view);
|
|
83
88
|
return !!s; };
|
|
84
89
|
const writes = (X) => X.posts.filter((x) => WRITES.test(x.path));
|
|
@@ -131,17 +136,19 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
|
|
|
131
136
|
ok('I7 a file opens as its page in the Viewer, not a dialog', await until(() => p.evaluate((v) => !!document.querySelector(v + ' .obody.vw[data-vw="doc:planning/prd/self-serve-v2-prd.md"]') && !(document.querySelector('#dlg') && !!document.querySelector('#dlg.on')), V), 15000));
|
|
132
137
|
|
|
133
138
|
/* I4 the Overview */
|
|
134
|
-
|
|
139
|
+
const i4 = await overview(p, null) && await p.evaluate((v) => /Tasks/.test(document.querySelector('#czViewer .cz-vw-kind').textContent) && !document.querySelector(v + ' [data-hi-view]') && !document.querySelector(v + ' .hx-wait'), V);
|
|
140
|
+
const i4m = await moreLabels(p);
|
|
141
|
+
ok('I4 the card\'s Overview press opens the initiative in the Viewer on its Tasks, with Documents and Stage under ⋯ on a desktop (XvATasks), and no Waiting for design marker', i4 && ['Group tasks by', 'Documents', 'Stage', 'Open the full record'].every((l) => i4m.includes(l)), JSON.stringify(i4m));
|
|
135
142
|
const tk = await p.evaluate((v) => { const o = document.querySelector(v); return { tasks: [...o.querySelectorAll('[data-ov-tkrow]')].map((r) => r.dataset.ovTkrow).sort(), checks: [...o.querySelectorAll('button[data-hi-chk]')].map((b) => b.dataset.hiChk).sort() }; }, V);
|
|
136
143
|
await show(p, 'stage');
|
|
137
144
|
const st = await p.evaluate((v) => { const o = document.querySelector(v); return { moves: [...o.querySelectorAll('[data-ov-move]')].map((b) => b.dataset.ovMove), cur: (o.querySelector('[data-ov-move][aria-pressed="true"]') || {}).textContent, life: [...o.querySelectorAll('[data-ov-life]')].map((b) => b.dataset.ovLife) }; }, V);
|
|
138
145
|
await show(p, 'docs');
|
|
139
|
-
const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc).sort(), draft: [...o.querySelectorAll('[data-ov-draft]')].map((b) => b.dataset.ovDraft).sort(), drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
|
|
146
|
+
const ov = await p.evaluate((v) => { const o = document.querySelector(v); return { docs: [...o.querySelectorAll('[data-ov-doc]')].map((d) => d.dataset.ovDoc).sort(), draft: [...o.querySelectorAll('[data-ov-draft], [data-czs-act^="draft:"], [data-ov-none]')].map((b) => b.dataset.ovDraft || b.dataset.ovNone || b.dataset.czsAct.slice(6)).sort(), pri: ((o.querySelector('.czs-pri[data-czs-act^="draft:"]') || {}).dataset || {}).czsAct || '', drafting: [...o.querySelectorAll('[data-ov-doc]')].filter((d) => /Drafting/.test(d.textContent)).map((d) => d.dataset.ovDoc), dread: [...o.querySelectorAll('[data-ov-dread]')].map((b) => b.dataset.ovDread), sum: (o.querySelector('[data-ov-dsum]') || {}).textContent || '' }; }, V);
|
|
140
147
|
const M = mk();
|
|
141
148
|
ok('I4 the Stage view lists the board\'s stages with the current one pressed, and the lifecycle presses', JSON.stringify(st.moves) === JSON.stringify(M.acts.stages) && st.cur === 'Build' && st.life.join() === 'on-hold,cancelled', JSON.stringify(st));
|
|
142
149
|
ok('I6 the tasks are the record\'s, and only a PMOS task has a check box it can change', JSON.stringify(tk.tasks) === JSON.stringify(M.tasks.rows.map((t) => t.key).sort()) && JSON.stringify(tk.checks) === JSON.stringify(M.tasks.rows.filter((t) => t.pmos && t.uid).map((t) => t.key).sort()), JSON.stringify(tk));
|
|
143
150
|
ok('I7 the core documents are the non-technical ones, with the engine\'s summary', JSON.stringify(ov.docs) === JSON.stringify(M.docs.rows.filter((d) => !d.tech).map((d) => d.key).sort()) && ov.sum === M.docs.cap, JSON.stringify(ov));
|
|
144
|
-
ok('I7 a document not started offers Draft it; a running one says Drafting and has no press; a draft offers Read', ov.draft.join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
|
|
151
|
+
ok('I7 a document not started offers Draft it (the summary\'s one primary drafts the first, the rest offer it from their row); a running one says Drafting and has no press; a draft offers Read', /^draft:(problem|research)$/.test(ov.pri) && [...new Set(ov.draft)].filter((k) => k === 'problem' || k === 'research').sort().join() === 'problem,research' && ov.drafting.join() === 'launch' && ov.dread.length === M.docs.rows.filter((d) => !d.tech && d.st === 'draft' && d.path && d.slot).length, JSON.stringify(ov));
|
|
145
152
|
|
|
146
153
|
/* I10 presses */
|
|
147
154
|
const mint = await T.nonce(BASE);
|
|
@@ -170,17 +177,22 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
|
|
|
170
177
|
await until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-hi-tmore="${a[1]}"]`), [V, pk]));
|
|
171
178
|
await p.click(`${V} [data-hi-tmore="${pk}"]`);
|
|
172
179
|
await until(() => p.evaluate(() => !!document.querySelector('.hi-pop[role="menu"]')));
|
|
173
|
-
await settle(() => p.click('.hi-pop[role="menu"] [role="menuitemradio"]:has(span:text-is("In progress"))'));
|
|
180
|
+
await settle(() => p.click('.hi-pop[role="menu"] [role="menuitemradio"]:has(> span:first-child:text-is("In progress"))'));
|
|
174
181
|
const ts = await until(() => A.posts.find((x) => x.path === '/api/boards/tasks/state'));
|
|
175
182
|
ok('I10 a status change posts the board, the task and the state, and nothing else', ts && Object.keys(ts.body).sort().join() === 'board,state,task,ws' && ts.body.state === 'In progress', JSON.stringify(ts && ts.body));
|
|
176
183
|
await show(p, 'docs');
|
|
177
|
-
await until(() => p.evaluate((v) => !!document.querySelector(v + ' [data-
|
|
178
|
-
await
|
|
184
|
+
await until(() => p.evaluate((v) => !!document.querySelector(v + ' .czs-pri[data-czs-act^="draft:"]'), V));
|
|
185
|
+
const first = await p.evaluate((v) => document.querySelector(v + ' .czs-pri[data-czs-act^="draft:"]').dataset.czsAct.slice(6), V);
|
|
186
|
+
await settle(() => p.click(`${V} .czs-pri[data-czs-act^="draft:"]`));
|
|
179
187
|
const dr = await until(() => A.posts.find((x) => x.path === '/api/core-docs/draft'));
|
|
180
|
-
ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else', dr && Object.keys(dr.body).sort().join() === 'key,scope,ws' && dr.body.scope === 'initiative:self-serve-v2' && dr.body.key ===
|
|
188
|
+
ok('I10 Draft it posts the workspace, the initiative scope and the key and nothing else', dr && Object.keys(dr.body).sort().join() === 'key,scope,ws' && dr.body.scope === 'initiative:self-serve-v2' && dr.body.key === first, JSON.stringify(dr && dr.body));
|
|
181
189
|
A.set({ status: 409, body: { ok: false, error: 'PMOS is already drafting this document.' } });
|
|
182
|
-
|
|
183
|
-
await p.
|
|
190
|
+
const other = first === 'problem' ? 'research' : 'problem';
|
|
191
|
+
await until(() => p.evaluate((a) => !!document.querySelector(a[0] + ` [data-ov-none="${a[1]}"], ` + a[0] + ` [data-czs-act="draft:${a[1]}"]`), [V, other]));
|
|
192
|
+
if (await p.evaluate((a) => !!document.querySelector(a[0] + ` [data-czs-act="draft:${a[1]}"]`), [V, other])) await p.click(`${V} [data-czs-act="draft:${other}"]`);
|
|
193
|
+
else {
|
|
194
|
+
await p.evaluate((a) => { const n = document.querySelector(a[0] + ` [data-ov-none="${a[1]}"]`); const f = n && !n.offsetParent && n.closest('.czs-sec') && n.closest('.czs-sec').querySelector('[data-czs-fold]'); if (f) f.click(); }, [V, other]); // its group is folded
|
|
195
|
+
await p.click(`${V} [data-ov-none="${other}"]`); await until(() => p.evaluate(() => !!document.querySelector('.hi-pop'))); await p.click('.hi-pop button:has-text("Draft it now")'); }
|
|
184
196
|
ok('I10 a refused press shows the route\'s reason in the Overview', await until(async () => /already drafting/.test(await txt(p, V + ' #ovMsg'))));
|
|
185
197
|
A.set({ status: 200, body: { ok: true } });
|
|
186
198
|
ok('I10 every press carried the launch nonce and no writer field', !!mint && writes(A).length >= 5 && writes(A).every((x) => x.headers['x-pmos-nonce'] === mint && !['by', 'via', 'at', 'actor', 'pm', 'nonce'].some((k) => k in x.body)), JSON.stringify(writes(A).map((x) => x.path)));
|
|
@@ -207,6 +219,7 @@ const WRITES = /^\/api\/(?:boards\/(?:move|tasks\/(?:add|state))|lifecycle|core-
|
|
|
207
219
|
{
|
|
208
220
|
const N = await open({ w: 390, h: 844 });
|
|
209
221
|
await overview(N.page, null);
|
|
222
|
+
ok('I4 a phone keeps the Tasks, Documents and Stage switch (PgTkList)', await N.page.evaluate((v) => [...document.querySelectorAll(v + ' [data-hi-view]')].map((b) => b.textContent).join() === 'Tasks,Documents,Stage', V));
|
|
210
223
|
const fls = [];
|
|
211
224
|
for (const view of ['tasks', 'docs', 'stage']) {
|
|
212
225
|
await show(N.page, view);
|
|
@@ -119,7 +119,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
119
119
|
ok('B1 Find narrows the goals as you type, and its close shows every goal again', fd === 'krm-up' && (await p.evaluate(() => document.querySelectorAll('#goalTbl [data-goal]').length)) === 5 && await p.evaluate(() => document.querySelector('#findRow').hidden), fd);
|
|
120
120
|
await p.click('#findB'); await p.fill('#findIn', 'activation'); await sleep(100); await p.click('#findRes [data-fo="goal"]');
|
|
121
121
|
const fo = await until(() => vw(p));
|
|
122
|
-
ok('B1 a goal found opens its detail, and Find closes', fo && fo.title === 'Partner activation' && await p.evaluate(() => document.querySelector('#findRow').hidden), JSON.stringify(fo));
|
|
122
|
+
ok('B1 a goal found opens its detail, and Find closes', fo && fo.title === 'KR 1.1 · Partner activation' && await p.evaluate(() => document.querySelector('#findRow').hidden), JSON.stringify(fo));
|
|
123
123
|
await vwClose(p);
|
|
124
124
|
await p.click('#viewChip'); const vm = await p.evaluate(() => ({ head: document.querySelector('#viewMenu .ins-mh').textContent, items: [...document.querySelectorAll('#viewMenu [data-view]')].map((b) => b.dataset.view + ((b.querySelector('.k') || {}).textContent ? ':' + b.querySelector('.k').textContent : '')).join(), nd: !!document.querySelector('#viewMenu [data-newdash]') })); await p.keyboard.press('Escape');
|
|
125
125
|
ok('B1 the Dashboard menu lists every view with the default one marked, then Delivery trends, then New dashboard (IsMenus)', vm.head === 'Dashboard' && vm.items === 'all:default,pd-1,p:Growth,p:Reliability,trends' && vm.nd, JSON.stringify(vm));
|
|
@@ -153,8 +153,9 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
153
153
|
await p.click('#goalTbl [data-budget="docs"] .nm');
|
|
154
154
|
const v = await until(() => vw(p));
|
|
155
155
|
ok('G1 a budget press opens its detail in the goal\'s frame: its reading, its cap, what it covers (IsGoal)', v && v.title === 'docs' && !v.wait && /documentation upkeep/.test(v.text) && /cap 20% of a quarter/.test(v.text) && /1 of 6 open on the Board/.test(v.text), JSON.stringify(v));
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
/* re-pointed (viewer-shell-a, XvAInsight): Moved by is a folding row under the summary, not a tab */
|
|
157
|
+
await p.click('#czViewer [data-czs-fold="bmoved"]'); await sleep(100);
|
|
158
|
+
ok('G1 its Moved by row lists the work anchored to it', /Docs search/.test(await txt('#czViewer [data-czs-id="bmoved"] .czs-body')));
|
|
158
159
|
await vwClose(p);
|
|
159
160
|
}
|
|
160
161
|
/* G1 a goal's detail (IsGoal): Readings with the chart, its target and the ship date of the work that moves it; the readings; Add a reading through
|
|
@@ -165,23 +166,34 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
165
166
|
await q.route('**/api/premium-dashboards/save', (r) => { saved.push(JSON.parse(r.request().postData() || '{}')); r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
|
|
166
167
|
await q.click('#goalTbl [data-goal="krm-act"] .nm');
|
|
167
168
|
const v = await until(() => vw(q));
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
/* re-pointed (viewer-shell-a, XvAInsight): the goal is the shell's summary card, the chart, then the folding rows Readings, Moved by and
|
|
170
|
+
* On your dashboards; Edit chart is under ⋯; Readings opens on a press */
|
|
171
|
+
await q.click('#czViewer [data-czs-fold="read"]'); await sleep(80);
|
|
172
|
+
const d = await q.evaluate(() => ({ kind: (document.querySelector('#czViewer .cz-vw-kind') || {}).textContent, tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), more: !!document.querySelector('#czViewer [data-cz-vw="more"]'), sub: document.querySelector('#czViewer .czs-line').textContent, pri: (document.querySelector('#czViewer .czs-pri') || {}).textContent, tg: (document.querySelector('#czViewer .ins-gch .tgl') || {}).textContent, ship: (document.querySelector('#czViewer .ins-gch .shipl') || {}).textContent, pts: document.querySelectorAll('#czViewer .ins-gch .pt').length, rows: document.querySelectorAll('#czViewer .ins-rd3').length, all: (document.querySelector('#czViewer [data-gx="all"]') || {}).textContent, moved: (document.querySelector('#czViewer [data-czs-fold="moved"] .czs-n') || {}).textContent, sw: [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join(), dlg: !!document.querySelector('#dlg') }));
|
|
173
|
+
ok('G1 on All goals a goal press opens its detail: the now and target line, Add a reading as the one primary, the rows Readings, Moved by and On your dashboards, and ⋯; no "Waiting for design" (XvAInsight)', v && v.title === 'KR 1.1 · Partner activation' && !v.wait && d.kind === 'Goal' && d.tabs === 'Readings,Moved by,On your dashboards' && d.more && d.sub === '28% now · target 50% by Dec 31' && d.pri === 'Add a reading' && /Down 2% since Oct 1\./.test(v.text) && !d.dlg, JSON.stringify([v, d]));
|
|
170
174
|
ok('G1 the chart draws each reading, the target with its value and the ship date of the work that moves it', d.tg === 'Target 50%' && d.ship === 'SSO for partners shipped' && d.pts === 4, JSON.stringify(d));
|
|
171
|
-
ok('G1 the newest three readings show with their source, then All 4 readings; Moved by
|
|
172
|
-
|
|
175
|
+
ok('G1 the newest three readings show with their source, then All 4 readings; Moved by counts the work', d.rows === 3 && d.all === 'All 4 readings' && d.moved === '2', JSON.stringify(d));
|
|
176
|
+
await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
|
|
177
|
+
const sw = await q.evaluate(() => [...document.querySelectorAll('#czViewer [data-gx="dash"]')].map((b) => b.getAttribute('aria-label') + ':' + b.getAttribute('aria-checked')).join());
|
|
178
|
+
ok('G1 On your dashboards has a switch for each saved dashboard, on where the goal is', sw === 'On Weekly partner review:true', sw);
|
|
179
|
+
await q.click('#czViewer [data-cz-vw="more"]'); await sleep(80);
|
|
180
|
+
const mi = await q.evaluate(() => [...document.querySelectorAll('.cz-vw-menu [role="menuitem"]')].map((b) => b.textContent.trim()).join('|'));
|
|
181
|
+
ok('G1 ⋯ holds Edit chart, then Copy link and Copy as text (xvMore order)', /^Edit chart\|Copy link\|Copy as text/.test(mi), mi);
|
|
182
|
+
await q.click('#czViewer .cz-vw-title'); await sleep(80); // a press outside the menu closes it
|
|
173
183
|
await q.click('#czViewer [data-gx="all"]'); ok('G1 All readings shows every reading', (await q.evaluate(() => document.querySelectorAll('#czViewer .ins-rd3').length)) === 4);
|
|
174
|
-
await q.click('#czViewer [data-
|
|
184
|
+
await q.click('#czViewer [data-czs-act="add"]'); await q.fill('#czViewer [data-rdf] [name="v"]', '31'); await q.click('#czViewer [data-rdf] button[type="submit"]'); await until(() => sent.length > 0, 4000);
|
|
175
185
|
ok('G1 Add a reading posts the date and the number to the KR metric reading route', sent.length === 1 && sent[0].rid === 'krm-act' && sent[0].value === 31 && sent[0].at === '2026-10-18' && sent[0].ws === 'w1', JSON.stringify(sent));
|
|
176
186
|
await until(() => q.evaluate(() => !!document.querySelector('#czViewer [data-gx="dash"]')), 4000);
|
|
177
187
|
await q.click('#czViewer [data-gx="dash"]'); await until(() => saved.length > 0, 4000);
|
|
178
188
|
ok('G1 the dashboard switch saves that dashboard without the goal', saved[0] && saved[0].id === 'pd-1' && saved[0].charts.join() === 'krm-ttfc,krm-gone' && saved[0].ws === 'w1', JSON.stringify(saved));
|
|
179
|
-
await q.
|
|
180
|
-
|
|
189
|
+
if (!(await q.evaluate(() => { const b = document.querySelector('#czViewer [data-czs-fold="moved"]'); return b && b.getAttribute('aria-expanded') === 'true'; }))) await q.click('#czViewer [data-czs-fold="moved"]');
|
|
190
|
+
await sleep(100);
|
|
191
|
+
ok('G1 Moved by lists the initiatives on their lifecycle track', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="moved"] .ins-ini').length)) === 2);
|
|
181
192
|
await vwClose(q);
|
|
182
193
|
await q.click('#goalTbl [data-goal="krm-nps"] .nm'); await until(() => vw(q));
|
|
183
|
-
const e1 = await txt('#czViewer .ins-etr', q);
|
|
184
|
-
|
|
194
|
+
const e1 = await txt('#czViewer .ins-etr', q), p1 = await txt('#czViewer .czs-pri', q);
|
|
195
|
+
/* re-pointed (viewer-shell-a): Add a reading is the summary card's one primary, so the empty trend does not repeat it */
|
|
196
|
+
ok('G1 a goal with one reading says a trend needs 2 readings and where the next comes from, with Add a reading (IsMenus)', /A trend needs 2 readings\./.test(e1) && p1 === 'Add a reading', e1 + ' | ' + p1);
|
|
185
197
|
await R.ctx.close();
|
|
186
198
|
}
|
|
187
199
|
/* G1 the period (AgInsPeriod) */
|
|
@@ -367,7 +379,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
367
379
|
ok('L3 a dashboard card opens Goals on that view', (await txt('#viewName', q)) === 'Reliability' && (await q.evaluate(() => document.querySelector('#tabGoals').getAttribute('aria-selected'))) === 'true' && (await q.evaluate(() => [...document.querySelectorAll('#goalTbl [data-goal]')].map((r) => r.dataset.goal).join())) === 'krm-up,krm-churn');
|
|
368
380
|
await q.click('#tabLibrary'); await q.locator('#listRows [data-rpt]').first().click(); // a report file with no setup opens straight in the reader
|
|
369
381
|
ok('L4 a report opens in the page\'s reader, not the console (premium-report-read R1; re-pointed by premium-agreed-design: the reader is the report panel in the Viewer card)', await until(() => q.evaluate(() => !!document.querySelector('#czViewer:not([hidden]) .vz-rp0')), 5000) && /premium-insights\.html/.test(q.url()), q.url());
|
|
370
|
-
ok('L4 a draft report has Issue in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 [data-
|
|
382
|
+
ok('L4 a draft report has Issue in the reader, so nothing sends you to the console to issue it', await until(() => q.evaluate(() => !!document.querySelector('#czViewer .vz-rp0 .czs-sum [data-czs-act="issue"]')), 8000) && await q.evaluate(() => !document.querySelector('#czViewer a[href*="console.html"]')));
|
|
371
383
|
await R.ctx.close();
|
|
372
384
|
const lead = { 'planning/reports/biweekly/2026-10-14.md': 'Activation slipped to 28% this fortnight.' };
|
|
373
385
|
const R2 = await open({ model: mk({ leads: lead }) });
|
|
@@ -515,7 +527,7 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
515
527
|
const pf = await until(async () => { const x = await q.evaluate(() => ({ name: document.querySelector('#prodName').textContent, groups: [...document.querySelectorAll('#goalTbl .ins-grp')].map((g) => g.querySelector('[role="cell"]').textContent), rows: document.querySelectorAll('#goalTbl [data-goal]').length, brief: document.querySelector('#brief').textContent, budgets: document.querySelectorAll('#goalTbl [data-budget]').length })); return x.groups.includes('Billing') ? x : null; }, 6000);
|
|
516
528
|
ok('M1 Portfolio reads the other product once and groups every goal by product; budgets stay with their product', !!pf && pf.name === 'Portfolio' && pf.groups.slice(0, 2).join() === 'pmos,Billing' && pf.rows === 6 && /^Portfolio: 6 goals across 2 products/.test(pf.brief) && pf.budgets === 0 && asked.length === 1, JSON.stringify(pf));
|
|
517
529
|
await q.click('#goalTbl [data-goal="w2~krm-inv"] .nm'); const gv = await until(() => vw(q));
|
|
518
|
-
ok('M1 a goal of another product opens its detail, named with its product and not on this product\'s dashboards', gv &&
|
|
530
|
+
ok('M1 a goal of another product opens its detail, named with its product and not on this product\'s dashboards', gv && /Invoices paid on time$/.test(gv.title) && /Billing/.test(gv.text) && !(await q.evaluate(() => document.querySelector('#czViewer [data-gx="dash"], #czViewer [data-gx="chart"]'))), JSON.stringify(gv));
|
|
519
531
|
await vwClose(q);
|
|
520
532
|
await q.click('#prodPick'); await q.click('#prodMenu [data-board="w1"]'); await sleep(150);
|
|
521
533
|
ok('M1 picking the open product again leaves Portfolio', (await txt('#prodName', q)) === 'pmos' && (await q.evaluate(() => document.querySelectorAll('#goalTbl [data-goal]').length)) === 5);
|
|
@@ -525,10 +537,11 @@ const BMR = { ok: true, state: 'ready', model: { tiles: [
|
|
|
525
537
|
{
|
|
526
538
|
const R = await open({ w: 390, h: 844 }), q = R.page;
|
|
527
539
|
await q.click('#goalCards [data-goal="krm-act"]'); await until(() => vw(q));
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
540
|
+
/* re-pointed (viewer-shell-a, XvAInsight): on a phone it is the same shell, full screen: the summary with Add a reading, the chart, the rows */
|
|
541
|
+
const ph = await q.evaluate(() => { const v = document.querySelector('#czViewer').getBoundingClientRect(), b = document.querySelector('#czViewer .cz-vw-body'); return { w: Math.round(v.width), tabs: [...document.querySelectorAll('#czViewer .czs-row b')].map((t) => t.textContent).join(), first: b.firstElementChild.className, add: (document.querySelector('#czViewer .czs-pri') || {}).textContent, over: document.documentElement.scrollWidth > innerWidth }; });
|
|
542
|
+
ok('P1 on a phone the goal detail covers the screen: the summary with Add a reading first, then Readings, Moved by and On your dashboards', ph.w === 390 && ph.tabs === 'Readings,Moved by,On your dashboards' && ph.first === 'czs-sum' && ph.add === 'Add a reading' && !ph.over, JSON.stringify(ph));
|
|
543
|
+
await q.click('#czViewer [data-czs-fold="dash"]'); await sleep(80);
|
|
544
|
+
ok('P1 the On your dashboards row holds the switches', (await q.evaluate(() => document.querySelectorAll('#czViewer [data-czs-id="dash"] [data-gx="dash"]').length)) === 1);
|
|
532
545
|
await vwClose(q);
|
|
533
546
|
await q.click('#tabLibrary'); await q.click('#listRows [data-setup]');
|
|
534
547
|
const sh = await until(() => q.evaluate(() => { const s = document.querySelector('#repSheet'); return s ? { title: s.querySelector('.ins-h3').textContent, btns: [...s.querySelectorAll('button, a')].map((b) => b.textContent).join(','), viewer: !!document.querySelector('#czViewer:not([hidden])'), bottom: Math.round(innerHeight - s.getBoundingClientRect().bottom) } : null; }), 4000);
|
|
@@ -61,14 +61,14 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
61
61
|
if (await page.isVisible('#moreBtn')) { await page.click('#moreBtn'); await page.click('#bdMetrics'); } else await page.click('#ibBody [data-open="metrics"]'); // re-pointed: Metrics is in the ⋯ menu (desktop) or the phone's plain row
|
|
62
62
|
return { ctx, page, errors, calls: () => calls };
|
|
63
63
|
};
|
|
64
|
-
const tilesOf = (pg) => pg.evaluate(() => [...document.querySelectorAll('#
|
|
64
|
+
const tilesOf = (pg) => pg.evaluate(() => [...document.querySelectorAll('#czViewer .bd-met')].map((t) => ({ k: t.dataset.met, s: [...t.querySelector('summary').children].map((c) => c.textContent), look: t.classList.contains('look') })));
|
|
65
65
|
|
|
66
66
|
/* C1 */
|
|
67
67
|
const A = await open(), p = A.page;
|
|
68
68
|
const shown = await until(async () => { const t = await tilesOf(p); return t.length === 4 ? t : null; });
|
|
69
69
|
ok('C1 the Metrics link under the track opens the board\'s four measures in the side panel', !!shown);
|
|
70
70
|
if (!shown) return finish(1);
|
|
71
|
-
const place = await p.evaluate(() => ({ t: document.querySelector('#
|
|
71
|
+
const place = await p.evaluate(() => ({ t: document.querySelector('#czViewer .cz-vw-title').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-insights.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
|
|
72
72
|
ok('C1 it is a side panel that says which repository it counts and links to Insights; no old dialog', place.t === 'Metrics' && /^counted from idpf/.test(place.cap) && /Targets and longer ranges are on Insights/.test(place.ins || '') && !place.dlg, JSON.stringify(place));
|
|
73
73
|
|
|
74
74
|
/* C2 */
|
|
@@ -84,10 +84,10 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/* C4 the definition and the values by week */
|
|
87
|
-
await p.click('#
|
|
88
|
-
const d = await p.evaluate(() => { const t = document.querySelector('#
|
|
87
|
+
await p.click('#czViewer .bd-met[data-met="corrections"] summary');
|
|
88
|
+
const d = await p.evaluate(() => { const t = document.querySelector('#czViewer .bd-met[data-met="corrections"]'); return { open: t.open, def: t.querySelector(':scope > .bd-amut').textContent, wk: t.querySelectorAll('.bd-kv b').length, vals: [...t.querySelectorAll('.bd-kv b')].map((b) => b.textContent) }; });
|
|
89
89
|
ok('C4 a measure opens its definition and its values by week; a week with too few runs is not kept', d.open && /per 100 agent runs/.test(d.def) && d.wk === 8 && d.vals[7] === '10' && d.vals[0] === 'Not kept yet', JSON.stringify(d));
|
|
90
|
-
ok('C4 the panel holds no press that records anything', await p.evaluate(() => !document.querySelector('#
|
|
90
|
+
ok('C4 the panel holds no press that records anything', await p.evaluate(() => !document.querySelector('#czViewer form, #czViewer [data-act]')));
|
|
91
91
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
92
92
|
await A.ctx.close();
|
|
93
93
|
|
|
@@ -98,7 +98,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
98
98
|
ok('C5 while the workflow is derived Blocked says Reading, and the panel asks again until it is filled', await until(async () => /^Reading/.test(await idle())) && await until(async () => (await idle()) === '1', 9000) && R.calls() >= 2, String(R.calls()));
|
|
99
99
|
await R.ctx.close();
|
|
100
100
|
const F2 = await open({ answers: () => ({ status: 500, body: { ok: false, state: 'error', error: 'the repository could not be read' } }) });
|
|
101
|
-
ok('C5 a failed read says why and draws no tile', await until(() => F2.page.evaluate(() => /The reason: the repository could not be read/.test((document.querySelector('#metW') || {}).textContent || '') && !document.querySelector('#
|
|
101
|
+
ok('C5 a failed read says why and draws no tile', await until(() => F2.page.evaluate(() => /The reason: the repository could not be read/.test((document.querySelector('#metW') || {}).textContent || '') && !document.querySelector('#czViewer .bd-met'))));
|
|
102
102
|
await F2.ctx.close();
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
106
106
|
for (const theme of ['light', 'dark']) {
|
|
107
107
|
const R = await open({ w: 390, h: 844, theme }), q = R.page;
|
|
108
108
|
await until(async () => (await tilesOf(q)).length === 4);
|
|
109
|
-
const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#
|
|
109
|
+
const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#czViewer .bd-met summary')].filter((b) => b.getBoundingClientRect().height < 44).length }));
|
|
110
110
|
ok(`C6 at 390 px (${theme}) the panel does not scroll sideways and every measure is 44 px or more`, !m.over && m.small === 0, JSON.stringify(m));
|
|
111
111
|
ok(`C6 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
|
|
112
112
|
await R.ctx.close();
|
|
@@ -123,7 +123,7 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
123
123
|
await pg.goto(BASE + '/premium-board.html');
|
|
124
124
|
await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 40000); await sleep(800);
|
|
125
125
|
await pg.click('#moreBtn'); await pg.click('#bdMetrics');
|
|
126
|
-
ok('C7 the real PMOS board opens its Metrics panel with four measures and no script error', await until(() => pg.evaluate(() => document.querySelectorAll('#
|
|
126
|
+
ok('C7 the real PMOS board opens its Metrics panel with four measures and no script error', await until(() => pg.evaluate(() => document.querySelectorAll('#czViewer .bd-met').length === 4), 30000) && errs.length === 0, errs.join(' | '));
|
|
127
127
|
await ctx.close();
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -224,12 +224,13 @@ const vw = () => { const v = document.querySelector('#czViewer:not([hidden])');
|
|
|
224
224
|
/* R8, R11, R12 on a phone, both themes */
|
|
225
225
|
for (const theme of ['light', 'dark']) {
|
|
226
226
|
const P = await open({ w: 390, h: 844, theme, touch: true });
|
|
227
|
-
// Home A + C (HvAC,
|
|
227
|
+
// Home A + C (HvAC, XvAPhDay): the list folds "Not in an initiative" on a phone; every next step is in Your day, which "Good morning" opens
|
|
228
228
|
await until(() => P.page.evaluate(() => { const l = document.querySelector('#hmList'); return l && getComputedStyle(l).display !== 'none' && !!document.querySelector('#hmList .hv-sub'); }));
|
|
229
229
|
const top = await P.page.evaluate(() => (document.querySelector('#hmList .hv-sub') || {}).textContent || '');
|
|
230
|
+
// Your day is an item in the Viewer, full screen on a phone (XvAPhDay): Your move lists the same rows
|
|
230
231
|
await P.page.click('#hmList [data-hm-day]');
|
|
231
|
-
const rows = await until(() => P.page.evaluate((sel) => document.querySelectorAll('#
|
|
232
|
-
await P.page.
|
|
232
|
+
const rows = await until(() => P.page.evaluate((sel) => document.querySelectorAll('#czViewer:not([hidden]) .hd-move ' + sel.replace('#hmList ', '')).length, NEEDS));
|
|
233
|
+
await P.page.evaluate(() => window.czViewer.close());
|
|
233
234
|
const tn = /(\d+) (?:is|are) yours/.exec(top);
|
|
234
235
|
ok(`R8 (${theme}) on a phone the list is the page; "N are yours" counts the next steps Your day lists`, rows >= MODEL.list.rows.length && !!tn && +tn[1] >= rows && await P.page.evaluate(() => document.body.classList.contains('hm-plist')), JSON.stringify({ top, rows }));
|
|
235
236
|
const small = await P.page.evaluate(() => [...document.querySelectorAll('#hmTop button, #hmList .hm-rm, #hmFoot button, #hmFoot label')].filter((b) => b.offsetParent !== null).map((b) => b.getBoundingClientRect()).filter((r) => r.height && r.height < 43.5).length);
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.403.0",
|
|
4
|
+
"at": "2026-10-24T03:40:15.576Z",
|
|
5
|
+
"f": 2,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1033,
|
|
9
|
+
"t": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)",
|
|
10
|
+
"s": "Viewer shell A, Home rows, meetings, reports and PRD to Jira (second kit)"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"v": "0.402.0",
|
|
4
16
|
"at": "2026-10-24T03:05:59.743Z",
|
|
@@ -82,9 +82,15 @@ function install(page, o = {}) {
|
|
|
82
82
|
}),
|
|
83
83
|
page.route('**/api/notes/series?*', (r) => json(r, { ok: true, series: { key: 'viewer-sync', meetings: [{ id: 'n0', at: '2026-10-15T10:00:00Z', decided: 1, steps: 3 }, { id: 'n1', at: W.NOTE.meeting.start, decided: 2, steps: 3 }] } })),
|
|
84
84
|
page.route('**/api/notes/search*', (r) => json(r, { ok: true, ids: ['n4'], hits: [{ id: 'n4', snip: '…which teams use saved views for teams every week…', open: true }] })),
|
|
85
|
+
page.route('**/api/meeting-points/*', (r) => { // a correction and its Undo (the answers lib/meeting-learn.js gives)
|
|
86
|
+
const b = post(r); if (/forget$/.test(new URL(r.request().url()).pathname)) return json(r, { ok: true });
|
|
87
|
+
const phrase = require('../lib/meeting-learn.js').phraseOf(b.orig && b.orig.text, b.text);
|
|
88
|
+
S.edits = { ...(S.edits || {}), [b.id]: { kind: b.kind, text: b.text, orig: b.orig } };
|
|
89
|
+
return json(r, { ok: true, edits: S.edits, lesson: b.learn === false ? null : { id: 'l0123456789', phrase, kind: b.kind, meaning: b.text, orig: b.orig }, check: [] });
|
|
90
|
+
}),
|
|
85
91
|
page.route('**/api/meeting-points*', (r) => {
|
|
86
92
|
if (r.request().method() === 'POST') { const b = post(r); (b.ids || []).forEach((id) => { if (b.verdict) S.points[id] = b.verdict; else delete S.points[id]; }); return json(r, { ok: true, points: S.points }); }
|
|
87
|
-
return json(r, { ok: true, points: S.points });
|
|
93
|
+
return json(r, { ok: true, points: S.points, edits: S.edits || {}, lessons: [] });
|
|
88
94
|
}),
|
|
89
95
|
page.route('**/api/notes/new', (r) => {
|
|
90
96
|
const b = post(r), id = 'new' + (++S.made);
|
|
@@ -128,6 +134,12 @@ function install(page, o = {}) {
|
|
|
128
134
|
shots: [{ t: 190000, why: 'Viewer beside the chat' }, { t: 895000, why: 'Diff approve button' }, { t: 1470000, why: 'Print preview' }],
|
|
129
135
|
lines: [{ t: 190000, who: 'Dita', text: 'The Viewer sits beside the chat now.' }, { t: 760000, who: 'You', text: 'Saved views move in their own work-item.' }, { t: 894000, who: 'Ana', text: 'Yes, approve the diff from the Viewer.' }, { t: 1499000, who: 'Ana', text: 'I will add the print view by Friday.' }] })),
|
|
130
136
|
page.route('**/api/meeting-material/suggest*', (r) => json(r, { ok: true, suggested: [{ kind: 'pmos-doc', ref: 'planning/runs/phone.md', title: 'Run log · phone test', meta: 'Run log' }, { kind: 'pmos-deck', ref: 'decks/release.md', title: 'Release deck', meta: 'Deck · 6 slides' }], found: [{ kind: 'pmos-doc', ref: 'planning/prd/rail.md', title: 'Rail PRD', meta: 'PRD' }] })),
|
|
137
|
+
page.route('**/api/meeting-material/file*', (r) => { // Upload a file: the bytes are counted, the stored name answered (lib/meeting-files.js names it)
|
|
138
|
+
if (r.request().method() !== 'POST') return r.fulfill({ status: 200, contentType: 'image/png', body: Buffer.alloc(0) });
|
|
139
|
+
const name = new URL(r.request().url()).searchParams.get('name') || 'file', buf = r.request().postDataBuffer() || Buffer.alloc(0);
|
|
140
|
+
S.posts.push({ path: '/api/meeting-material/file', body: { name, size: buf.length } });
|
|
141
|
+
return json(r, { ok: true, name: '20261024T090000-' + name.replace(/[^\w.-]+/g, '-'), kind: /\.png$/i.test(name) ? 'image' : 'pdf', size: buf.length });
|
|
142
|
+
}),
|
|
131
143
|
page.route('**/api/meeting-material*', (r) => (r.request().method() === 'POST' ? (post(r), json(r, { ok: true })) : json(r, { ok: true, key: 'k', items: [], topics: [{ text: 'One toolbar row' }] }))),
|
|
132
144
|
page.route('**/api/viewer-meeting?*', (r) => {
|
|
133
145
|
const u = new URL(r.request().url()), topics = u.searchParams.getAll('topic');
|
|
@@ -184,4 +196,14 @@ async function open(browser, base, url, o = {}) {
|
|
|
184
196
|
}
|
|
185
197
|
const until = async (fn, ms = 10000, step = 100) => { const t0 = Date.now(); for (;;) { let v; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await new Promise((r) => setTimeout(r, step)); } };
|
|
186
198
|
|
|
187
|
-
|
|
199
|
+
/** ⋯ in the Viewer's header (Viewer shell A): its rows as text, and, with label, press the row whose words start with it. null: no such row. */
|
|
200
|
+
async function more(page, label) {
|
|
201
|
+
await page.$eval('#czViewer [data-cz-vw="more"]', (b) => b.click());
|
|
202
|
+
await until(() => page.evaluate(() => !!document.querySelector('#czViewer .cz-vw-menu')), 5000);
|
|
203
|
+
const rows = await page.evaluate(() => [...document.querySelectorAll('#czViewer .cz-vw-menu [role="menuitem"]')].map((b) => b.innerText.replace(/\n/g, ' ').trim()));
|
|
204
|
+
if (!label) { await page.keyboard.press('Escape'); return rows; }
|
|
205
|
+
const hit = await page.evaluate((l) => { const b = [...document.querySelectorAll('#czViewer .cz-vw-menu [role="menuitem"]')].find((x) => x.querySelector('span').textContent.startsWith(l)); if (b) b.click(); return !!b; }, label);
|
|
206
|
+
if (!hit) await page.keyboard.press('Escape');
|
|
207
|
+
return hit ? rows : null;
|
|
208
|
+
}
|
|
209
|
+
module.exports = { open, until, more, RECORDER, install, world, REPORT, REPORT_PATH, dayKey, iso };
|