create-pmos 0.397.0 → 0.399.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 -25
- 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/briefing-premium-adddoc-test.js +105 -52
- package/workspace/briefing-premium-board-test.js +284 -128
- package/workspace/briefing-premium-calendar-2-test.js +135 -198
- package/workspace/briefing-premium-calendar-3-test.js +143 -418
- package/workspace/briefing-premium-calendar-test.js +85 -196
- package/workspace/briefing-premium-doc-edit-test.js +99 -83
- package/workspace/briefing-premium-initiative-test.js +175 -290
- package/workspace/briefing-premium-insights-test.js +414 -219
- package/workspace/briefing-premium-metrics-test.js +55 -97
- package/workspace/briefing-premium-products-test.js +44 -28
- package/workspace/briefing-premium-sources-test.js +70 -49
- package/workspace/briefing-premium-test.js +155 -648
- package/workspace/briefing-premium-work-test.js +88 -283
- package/workspace/changelog.json +24 -0
- package/workspace/ev-everywhere-test.js +210 -0
- package/workspace/fixtures/board-premium-trail.js +32 -0
- package/workspace/fixtures/premium-viewer-fixtures.js +187 -0
- package/workspace/guide/briefing-premium.md +3 -1
- package/workspace/guide/home.md +68 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/lib/agent-roles.js +71 -0
- package/workspace/lib/board-grill.js +63 -0
- package/workspace/lib/board-premium.js +121 -24
- package/workspace/lib/board-trail.js +223 -0
- package/workspace/lib/home-work-item.js +58 -0
- package/workspace/lib/initiative-layout.js +77 -0
- package/workspace/lib/insights-goals.js +196 -0
- package/workspace/lib/insights-premium.js +64 -15
- package/workspace/lib/insights-records.js +115 -0
- package/workspace/lib/jira-tickets.js +1 -1
- package/workspace/lib/meeting-points.js +52 -0
- package/workspace/lib/news-for-you.js +88 -0
- package/workspace/lib/notes-series.js +29 -6
- package/workspace/lib/report-confirm.js +48 -0
- package/workspace/lib/route-modules.js +12 -0
- package/workspace/lib/routes-board-docs.js +46 -0
- package/workspace/lib/routes-board-grill.js +90 -0
- package/workspace/lib/routes-board-trail.js +33 -0
- package/workspace/lib/routes-home-desk.js +176 -0
- package/workspace/lib/routes-home-review.js +108 -0
- package/workspace/lib/routes-initiative-layout.js +57 -0
- package/workspace/lib/routes-insights-premium.js +16 -4
- package/workspace/lib/routes-insights-records.js +133 -0
- package/workspace/lib/routes-meeting-points.js +37 -0
- package/workspace/lib/routes-news.js +57 -0
- package/workspace/lib/routes-notes.js +3 -1
- package/workspace/lib/routes-report-confirm.js +31 -0
- package/workspace/lib/routes-search.js +38 -0
- package/workspace/lib/routes-viewer.js +108 -0
- package/workspace/lib/search-index.js +176 -0
- package/workspace/lib/transcript-steps.js +123 -0
- package/workspace/lib/viewer-meeting.js +205 -0
- package/workspace/lib/viewer-report.js +89 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +128 -82
- package/workspace/premium-briefing-depth-test.js +104 -90
- package/workspace/premium-chat-attach-test.js +54 -63
- package/workspace/premium-chat-chart-tab-test.js +37 -37
- package/workspace/premium-chat-context-test.js +19 -18
- package/workspace/premium-chat-goal-view-test.js +23 -23
- package/workspace/premium-chat-notes-test.js +26 -31
- package/workspace/premium-chat-report-tab-test.js +46 -28
- package/workspace/premium-chat-term-test.js +16 -16
- package/workspace/premium-chat-viewer-test.js +60 -59
- package/workspace/premium-core-doc-issue-test.js +52 -43
- package/workspace/premium-html-viewer-test.js +14 -17
- package/workspace/premium-phone-card-test.js +10 -3
- package/workspace/premium-phone-room-test.js +41 -35
- package/workspace/premium-report-read-test.js +152 -197
- package/workspace/premium-viewer-download-test.js +19 -22
- package/workspace/premium-viewer-flicker-test.js +11 -16
- package/workspace/premium-viewer-share-test.js +6 -9
- package/workspace/premium-viewer-test.js +41 -60
- package/workspace/premium-vw-backlog-test.js +53 -33
- package/workspace/premium-vw-cal-test.js +97 -128
- package/workspace/premium-vw-copy-test.js +17 -33
- package/workspace/premium-vw-doc-test.js +17 -10
- package/workspace/premium-vw-item-test.js +50 -49
- package/workspace/premium-vw-jira-test.js +53 -27
- package/workspace/premium-vw-meet-test.js +115 -187
- package/workspace/premium-vw-notes-test.js +88 -109
- package/workspace/premium-vw-rec-test.js +71 -194
- package/workspace/premium-vw-slides-test.js +46 -50
- package/workspace/premium-welcome-test.js +3 -2
- package/workspace/premium-work-depth-test.js +61 -53
- package/workspace/public/pm/bd-acts.js +383 -0
- package/workspace/public/pm/bd-asks.js +261 -0
- package/workspace/public/pm/bd-pop.js +59 -0
- package/workspace/public/pm/bd-span.js +222 -82
- package/workspace/public/pm/bd-stages.js +25 -11
- package/workspace/public/pm/bd-views.js +169 -0
- package/workspace/public/pm/c3-doc-sheet.js +1 -1
- package/workspace/public/pm/c3-md.js +3 -395
- package/workspace/public/pm/c3-phone-detail.js +1 -1
- package/workspace/public/pm/c3-phone-model.js +3 -68
- package/workspace/public/pm/chat-term.js +3 -3
- package/workspace/public/pm/cozy-board.css +798 -230
- package/workspace/public/pm/cozy-ev.css +228 -0
- package/workspace/public/pm/cozy-evmodel.js +106 -0
- package/workspace/public/pm/cozy-evui.js +47 -0
- package/workspace/public/pm/cozy-home.css +570 -142
- package/workspace/public/pm/cozy-home.js +5 -3
- package/workspace/public/pm/cozy-insights.css +437 -170
- package/workspace/public/pm/cozy-md.js +396 -0
- package/workspace/public/pm/cozy-nav.js +104 -29
- package/workspace/public/pm/cozy-news.js +140 -0
- package/workspace/public/pm/cozy-placeholder.js +26 -0
- package/workspace/public/pm/cozy-search.js +203 -0
- package/workspace/public/pm/cozy-settings.js +198 -0
- package/workspace/public/pm/cozy-sources.js +89 -0
- package/workspace/public/pm/cozy-today.css +217 -0
- package/workspace/public/pm/cozy-viewer.css +3 -3
- package/workspace/public/pm/cozy-viewer.js +145 -0
- package/workspace/public/pm/cozy-vw-mtg.css +350 -0
- package/workspace/public/pm/cozy-vw-rp.css +152 -0
- package/workspace/public/pm/cozy-vw.css +485 -0
- package/workspace/public/pm/cozy.css +83 -1
- package/workspace/public/pm/home-adddoc.js +48 -0
- package/workspace/public/pm/home-app.js +1179 -0
- package/workspace/public/pm/home-around.js +413 -0
- package/workspace/public/pm/home-chat.js +512 -0
- package/workspace/public/pm/home-data.js +312 -0
- package/workspace/public/pm/home-dictate.js +54 -0
- package/workspace/public/pm/home-draft.js +68 -0
- package/workspace/public/pm/home-ini-model.js +190 -0
- package/workspace/public/pm/home-ini.css +171 -0
- package/workspace/public/pm/home-ini.js +456 -0
- package/workspace/public/pm/home-list.js +276 -0
- package/workspace/public/pm/home-more.js +132 -0
- package/workspace/public/pm/home-phone-card.js +109 -0
- package/workspace/public/pm/home-review.js +104 -0
- package/workspace/public/pm/home-task.js +67 -0
- package/workspace/public/pm/home-today.js +144 -0
- package/workspace/public/pm/home-work.js +547 -0
- package/workspace/public/pm/phone-moment.js +69 -0
- package/workspace/public/pm/pm-work-view.js +1 -1
- package/workspace/public/pm/premium-attach.js +4 -0
- package/workspace/public/pm/premium-board.js +548 -395
- package/workspace/public/pm/premium-chart-tab.js +109 -62
- package/workspace/public/pm/premium-deck.js +3 -3
- package/workspace/public/pm/premium-first.js +23 -21
- package/workspace/public/pm/premium-insights.js +1102 -581
- package/workspace/public/pm/premium-meeting.js +61 -549
- package/workspace/public/pm/premium-mtg-present.js +138 -0
- package/workspace/public/pm/premium-mtg-replay.js +142 -0
- package/workspace/public/pm/premium-notes.js +1 -1
- package/workspace/public/pm/premium-report-frame.css +20 -0
- package/workspace/public/pm/premium-report-read.js +669 -476
- package/workspace/public/pm/premium-report-tab.js +116 -67
- package/workspace/public/pm/premium-shell.js +76 -123
- package/workspace/public/pm/premium-viewer.js +22 -1
- package/workspace/public/pm/premium-vw-cal.js +277 -48
- package/workspace/public/pm/premium-vw-doc.css +6 -0
- package/workspace/public/pm/premium-vw-doc.js +40 -2
- package/workspace/public/pm/premium-vw-file.js +2 -2
- package/workspace/public/pm/premium-vw-meet.js +6 -83
- package/workspace/public/pm/premium-vw-mtg.js +958 -0
- package/workspace/public/pm/premium-vw-notes.js +116 -68
- package/workspace/public/pm/premium-vw-open.js +35 -0
- package/workspace/public/pm/premium-vw-page.js +16 -0
- package/workspace/public/pm/premium-vw-rec.js +11 -218
- package/workspace/public/pm/premium-vw-slides.css +5 -0
- package/workspace/public/pm/premium-vw-slides.js +44 -8
- package/workspace/public/pm/rp-parts.js +269 -0
- package/workspace/public/pm/term-view.js +22 -0
- package/workspace/public/premium-board.html +29 -70
- package/workspace/public/premium-initiative.html +8 -48
- package/workspace/public/premium-insights.html +26 -64
- package/workspace/public/premium-viewer.html +20 -0
- package/workspace/public/premium.html +18 -107
- package/workspace/r/m1.png +0 -0
- package/workspace/r/m2.png +0 -0
- package/workspace/r/m3.png +0 -0
- package/workspace/r/nl.png +0 -0
- package/workspace/server.js +18 -3
- package/workspace/test-files.json +1 -0
- package/workspace/test-lists/home-libs.json +9 -0
- package/workspace/test-lists/initiative-layout.json +9 -0
- package/workspace/test-lists/premium-report-read.json +1 -1
- package/workspace/test-lists/premium-uncovered-meetings.json +9 -0
- package/workspace/test-lists/premium-uncovered-reports.json +9 -0
- package/workspace/test-lists/premium-vw-agreed.json +9 -0
- package/workspace/test-lists/premium-vw-notes.json +1 -1
- package/workspace/test-lists/uf-everywhere.json +15 -0
- package/workspace/test-lists/uf-home.json +9 -0
- package/workspace/test-lists/uncovered-board.json +9 -0
- package/workspace/public/pm/premium-work.js +0 -729
- package/workspace/public/pm/premium.js +0 -1146
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
/* briefing-premium-metrics-test.js — the Metrics card of the premium Board (initiative briefing-premium-metrics; planning/prd/briefing-premium-metrics-prd.md M1 to M10).
|
|
4
4
|
* Serves the real page from the real server. The Board's answer and the card's answer are served from fixtures (the card's model is built by
|
|
5
5
|
* lib/board-metrics-premium.js from made-up runs, commits and initiatives); the last blocks ask the real route and compare the card with the mockup.
|
|
6
|
-
* C1 place
|
|
6
|
+
* C1 place · C2 tiles · C4 definition and values by week · C5 pending and failure · C6 floors · C7 the real route · C9 targets on the Board · C10 the Insights twin
|
|
7
|
+
* Re-pointed for the Agreed Board (premium-agreed-design): the Agreed design has no Metrics frame, so the Board keeps the card's function as a plain
|
|
8
|
+
* panel (pm/bd-acts.js), tagged "Waiting for design", opened from the quiet Metrics link under the stage track. The charts, the week reader (C3), the
|
|
9
|
+
* dialog with its agent (C4) and the card's geometry (C8) were parts of the retired card: the definition and the values by week stay, in a fold;
|
|
10
|
+
* charts, targets and longer ranges live on Insights (Delivery trends), which C10 checks. */
|
|
7
11
|
const fs = require('fs');
|
|
8
12
|
const path = require('path');
|
|
9
13
|
const { spawn } = require('child_process');
|
|
@@ -44,161 +48,115 @@ const ready = (model) => ({ status: 200, body: { ok: true, state: 'ready', model
|
|
|
44
48
|
await T.waitForServer(BASE);
|
|
45
49
|
browser = await chromium.launch({ executablePath: exe });
|
|
46
50
|
|
|
47
|
-
const open = async ({ w = 1280, h = 900, theme = 'light', answers = null } = {}) => {
|
|
51
|
+
const open = async ({ w = 1280, h = 900, theme = 'light', answers = null, url = '/premium-board.html' } = {}) => {
|
|
48
52
|
const ctx = await browser.newContext({ viewport: { width: w, height: h } });
|
|
49
|
-
await ctx.addInitScript(() => { try { localStorage.setItem('pmos.premium.openAs', 'popup'); } catch { /* none */ } });
|
|
50
53
|
const page = await ctx.newPage();
|
|
51
|
-
const errors = []
|
|
54
|
+
const errors = []; let calls = 0;
|
|
52
55
|
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
53
56
|
await page.route('**/api/board-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.facts()), as_of: Date.now() }) }));
|
|
57
|
+
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: '{"ok":false}' }));
|
|
54
58
|
await page.route('**/api/board-metrics-premium*', (r) => { calls++; const a = answers ? answers(calls) : ready(metrics()); return r.fulfill({ status: a.status, contentType: 'application/json', body: JSON.stringify(a.body) }); });
|
|
55
|
-
await page.
|
|
56
|
-
await page.route('**/api/briefing-premium/**', (r) => { const rq = r.request(); if (rq.method() === 'GET') return r.fulfill({ contentType: 'application/json', body: JSON.stringify(thread) }); posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); return r.fulfill({ contentType: 'application/json', body: '{"ok":true}' }); });
|
|
57
|
-
await page.goto(BASE + '/premium-board.html?theme=' + theme);
|
|
59
|
+
await page.goto(BASE + url + (url.includes('?') ? '&' : '?') + 'theme=' + theme);
|
|
58
60
|
await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 20000);
|
|
59
|
-
await page.
|
|
60
|
-
return { ctx, page, errors,
|
|
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
|
+
return { ctx, page, errors, calls: () => calls };
|
|
61
63
|
};
|
|
64
|
+
const tilesOf = (pg) => pg.evaluate(() => [...document.querySelectorAll('#peek .bd-met')].map((t) => ({ k: t.dataset.met, s: [...t.querySelector('summary').children].map((c) => c.textContent), look: t.classList.contains('look') })));
|
|
62
65
|
|
|
63
66
|
/* C1 */
|
|
64
67
|
const A = await open(), p = A.page;
|
|
65
|
-
const shown = await until(() =>
|
|
66
|
-
ok('C1
|
|
68
|
+
const shown = await until(async () => { const t = await tilesOf(p); return t.length === 4 ? t : null; });
|
|
69
|
+
ok('C1 the Metrics link under the track opens the board\'s four measures in the side panel', !!shown);
|
|
67
70
|
if (!shown) return finish(1);
|
|
68
|
-
const place = await p.evaluate(() => ({
|
|
69
|
-
ok('C1
|
|
71
|
+
const place = await p.evaluate(() => ({ t: document.querySelector('#pkTitle').textContent, cap: document.querySelector('#metW .bd-amut').textContent, ins: (document.querySelector('#metW a[href^="/premium-insights.html"]') || {}).textContent, dlg: !!document.querySelector('#dlg.on') }));
|
|
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));
|
|
70
73
|
|
|
71
74
|
/* C2 */
|
|
72
|
-
const
|
|
73
|
-
ok('C2 the first tile is the latest week with its run count, and how it changed',
|
|
74
|
-
ok('C2 merges, blocked and idle are counted; blocked and idle
|
|
75
|
-
|
|
76
|
-
ok('C2 only Week is available; Day and Month are disabled', per === 'Day:false:true|Week:true:|Month:false:true', per);
|
|
77
|
-
ok('C2 Day and Month hold no count, so only Week shows, as one quiet chip (premium-calmer-first-screen)', await p.evaluate(() => [...document.querySelectorAll('#perTabs button')].filter((b) => getComputedStyle(b).display !== 'none').map((b) => b.textContent).join() === 'Week'));
|
|
78
|
-
ok('C2 no target, on-target chip, dashed line or demo label is drawn; the lead line says no measure has a target', await p.evaluate(() => !document.querySelector('#cMet .mchip.ok, #cMet .tg, #cMet .tgl') && !/on target|demo|dashed/i.test(document.querySelector('#metBody').textContent) && /No measure here has a target/.test(document.querySelector('#metHint').textContent)));
|
|
79
|
-
const look = await p.evaluate(() => ({ chips: [...document.querySelectorAll('#metBody .mt1')].map((t) => (t.querySelector('.mchip') || {}).textContent || ''), off: [...document.querySelectorAll('#metBody .mt1')].map((t) => t.classList.contains('off')), lead: (document.querySelector('#metHint .mflag') || {}).textContent || '', ins: (document.querySelector('#metHint a#metIns') || {}).getAttribute ? document.querySelector('#metHint a#metIns').getAttribute('href') : '' }));
|
|
80
|
-
ok('C2 the tiles that need a look carry the chip and the orange outline; the lead line counts them and links to Insights', JSON.stringify(look.off) === JSON.stringify(tiles.map((t) => /\b(warn|bad)\b/.test(t.cls))) && look.chips.every((c, i) => (c === 'Needs a look') === look.off[i]) && look.lead === look.off.filter(Boolean).length + ' of 4 need a look.' && /^\/premium-insights\.html\?ws=/.test(look.ins), JSON.stringify(look));
|
|
75
|
+
const t0 = shown;
|
|
76
|
+
ok('C2 the first tile is the latest week with its run count, and how it changed', t0[0].k === 'corrections' && t0[0].s[0] === 'Corrections per 100 runs' && t0[0].s[1] === '10.0' && /^week to .+, 10 runs$/.test(t0[0].s[2]) && t0[0].s[3] === 'Down 15.0 vs last week', JSON.stringify(t0[0]));
|
|
77
|
+
ok('C2 merges, blocked and idle are counted; blocked and idle say plainly that their history starts today', t0[1].s[1] === '3' && t0[2].s[1] === '1' && t0[2].s[2] === 'of 3 open · history starts today' && t0[3].s[1] === '1' && t0[3].s[2] === 'of 3 open · history starts today', JSON.stringify(t0));
|
|
78
|
+
ok('C2 no target and no on-target chip is drawn when none is set; a measure that needs a look says so', !t0.some((x) => x.s.some((y) => /target/i.test(y))) && t0.filter((x) => x.look).every((x) => x.s.includes('Needs a look')), JSON.stringify(t0));
|
|
81
79
|
{
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
ok('C2 a source that cannot be read says Not read and why, with no number and no chart', t.length === 4 && t.every((x) => x.startsWith('Not read/')) && /agent-runs\.jsonl could not be read in idpf/.test(t[0]) && !(await R.page.evaluate(() => document.querySelector('#metBody svg'))), JSON.stringify(t));
|
|
80
|
+
const R = await open({ answers: () => ready(metrics({ runs: null, commits: null, inits: null })) });
|
|
81
|
+
const t = await until(async () => { const a = await tilesOf(R.page); return a.length === 4 ? a : null; }) || [];
|
|
82
|
+
ok('C2 a source that cannot be read says Not read and why, with no number', t.length === 4 && t.every((x) => x.s[1] === 'Not read') && /agent-runs\.jsonl could not be read in idpf/.test(t[0].s[2]), JSON.stringify(t));
|
|
86
83
|
await R.ctx.close();
|
|
87
84
|
}
|
|
88
85
|
|
|
89
|
-
/*
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
ok('
|
|
94
|
-
const mid = await at(0.841);
|
|
95
|
-
ok('C3 moving over a counted week reads its value and run count', /^\d+\.\d$/.test(mid.v) && / · 12 runs$/.test(mid.c), JSON.stringify(mid));
|
|
96
|
-
await p.mouse.move(5, 5); await sleep(200);
|
|
97
|
-
const back = await p.evaluate(() => ({ v: document.querySelector('#metBody .mch .mval').textContent, hv: document.querySelector('#metBody .mch').classList.contains('hv') }));
|
|
98
|
-
ok('C3 leaving the chart returns to the latest week', back.v === '10.0' && !back.hv, JSON.stringify(back));
|
|
99
|
-
await p.locator('#metBody .mch').first().focus(); await p.keyboard.press('ArrowLeft'); await sleep(100);
|
|
100
|
-
ok('C3 the arrow keys read the week before', await p.evaluate(() => document.querySelector('#metBody .mch .mval').textContent === '25.0' || /^\d+\.\d$/.test(document.querySelector('#metBody .mch .mval').textContent)));
|
|
101
|
-
await p.locator('#metBody .mch').first().blur();
|
|
102
|
-
|
|
103
|
-
/* C4 */
|
|
104
|
-
await p.locator('#metBody .mt1').first().click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(500);
|
|
105
|
-
const dlg = await p.evaluate(() => ({ title: document.querySelector('#dTitle').textContent, sub: document.querySelector('#dSub').textContent, grid: [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'), vals: document.querySelectorAll('#oMain .vtb div').length, def: document.querySelector('#oMain .lede').textContent, ask: document.querySelector('#askF').hidden }));
|
|
106
|
-
ok('C4 a tile opens its definition, its values by week and the repository it counted, with the read-only agent beside it', dlg.title === 'Corrections per 100 runs' && dlg.sub === 'idpf' && /Now\|10\.0/.test(dlg.grid) && /Better when\|Lower/.test(dlg.grid) && /Source\|idpf/.test(dlg.grid) && dlg.vals === 8 && /per 100 agent runs/.test(dlg.def) && dlg.ask === false, JSON.stringify(dlg));
|
|
107
|
-
ok('C4 the dialog holds no press that records anything', await p.evaluate(() => !document.querySelector('#oMain button, #oMain .dmcta')));
|
|
108
|
-
A.setThread({ ok: true, working: false, turns: [] }); await p.fill('#askIn', 'Why did it fall?'); const n0 = A.posts.length; await p.press('#askIn', 'Enter');
|
|
109
|
-
ok('C4 a question posts the metric\'s key and the text', await until(() => A.posts.length > n0 && A.posts[A.posts.length - 1].path === '/api/briefing-premium/ask' && A.posts[A.posts.length - 1].body.key === 'board:metric-corrections' && A.posts[A.posts.length - 1].body.text === 'Why did it fall?'), JSON.stringify(A.posts.slice(-1)));
|
|
110
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
111
|
-
await p.evaluate(() => { if (document.querySelector('#popMet').hidden) document.querySelector('#miMet').click(); }); // the dialog's close leaves the Metrics popover shut
|
|
112
|
-
await p.locator('#metBody .mt1').nth(2).click(); await until(() => p.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(400);
|
|
113
|
-
ok('C4 Blocked opens its definition, and the weeks before its history started read Not kept yet', await p.evaluate(() => { const v = [...document.querySelectorAll('#oMain .vtb div b')].map((b) => b.textContent); return document.querySelector('#dTitle').textContent === 'Blocked' && /blocked step/.test(document.querySelector('#oMain .lede').textContent) && v.length === 8 && v.slice(0, 7).every((x) => x === 'Not kept yet') && v[7] === '1'; }));
|
|
114
|
-
await p.keyboard.press('Escape'); await until(() => p.evaluate(() => !document.querySelector('#dlg').classList.contains('on')));
|
|
115
|
-
await p.$eval('#perTabs [data-per="day"]', (b) => b.click()); ok('C4 a disabled period says why and changes nothing', await until(() => p.evaluate(() => /by week only/.test(document.querySelector('#toast').textContent))) && await p.evaluate(() => document.querySelector('#perTabs [data-per="week"]').getAttribute('aria-pressed') === 'true'));
|
|
86
|
+
/* C4 the definition and the values by week */
|
|
87
|
+
await p.click('#peek .bd-met[data-met="corrections"] summary');
|
|
88
|
+
const d = await p.evaluate(() => { const t = document.querySelector('#peek .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
|
+
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('#peek form, #peek [data-act]')));
|
|
116
91
|
ok('0 no page error', A.errors.length === 0, A.errors.join(' | '));
|
|
117
92
|
await A.ctx.close();
|
|
118
93
|
|
|
119
94
|
/* C5 */
|
|
120
95
|
{
|
|
121
96
|
const R = await open({ answers: (c) => (c < 2 ? ready(metrics({ inits: null, initsPending: true })) : ready(metrics())) });
|
|
122
|
-
const idle =
|
|
123
|
-
ok('C5 while the workflow is derived Blocked
|
|
97
|
+
const idle = async () => { const t = await tilesOf(R.page); return t[2] ? t[2].s[1] : ''; };
|
|
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()));
|
|
124
99
|
await R.ctx.close();
|
|
125
100
|
const F2 = await open({ answers: () => ({ status: 500, body: { ok: false, state: 'error', error: 'the repository could not be read' } }) });
|
|
126
|
-
ok('C5 a failed read says why and draws no tile', await until(() => F2.page.evaluate(() =>
|
|
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('#peek .bd-met'))));
|
|
127
102
|
await F2.ctx.close();
|
|
128
103
|
}
|
|
129
104
|
|
|
130
105
|
/* C6 */
|
|
131
106
|
for (const theme of ['light', 'dark']) {
|
|
132
107
|
const R = await open({ w: 390, h: 844, theme }), q = R.page;
|
|
133
|
-
await until(() =>
|
|
134
|
-
const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#
|
|
135
|
-
ok(`C6 at 390 px (${theme}) the
|
|
108
|
+
await until(async () => (await tilesOf(q)).length === 4);
|
|
109
|
+
const m = await q.evaluate(() => ({ over: document.documentElement.scrollWidth > innerWidth + 1, small: [...document.querySelectorAll('#peek .bd-met summary')].filter((b) => b.getBoundingClientRect().height < 44).length }));
|
|
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
|
+
ok(`C6 no page error at 390 px (${theme})`, R.errors.length === 0, R.errors.join(' | '));
|
|
136
112
|
await R.ctx.close();
|
|
137
113
|
}
|
|
138
114
|
|
|
139
115
|
/* C7 the real route */
|
|
140
116
|
{
|
|
141
117
|
const home = await fetch(BASE + '/api/board-metrics-premium').then((r) => r.json());
|
|
142
|
-
ok('C7 the real route gives the home workspace
|
|
118
|
+
ok('C7 the real route gives the home workspace its measures', home.ok === true && home.state === 'ready', JSON.stringify(home).slice(0, 300));
|
|
143
119
|
const post = await fetch(BASE + '/api/board-metrics-premium', { method: 'POST', headers: await T.pressHeaders(BASE), body: '{}' }).then((r) => r.status);
|
|
144
120
|
ok('C7 the route is read-only', post === 405, String(post));
|
|
145
121
|
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), pg = await ctx.newPage(), errs = [];
|
|
146
122
|
pg.on('pageerror', (e) => errs.push(String(e)));
|
|
147
123
|
await pg.goto(BASE + '/premium-board.html');
|
|
148
|
-
await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 40000); await sleep(
|
|
149
|
-
|
|
124
|
+
await until(() => pg.evaluate(() => document.querySelectorAll('#ibBody .ini2').length > 0), 40000); await sleep(800);
|
|
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('#peek .bd-met').length === 4), 30000) && errs.length === 0, errs.join(' | '));
|
|
150
127
|
await ctx.close();
|
|
151
128
|
}
|
|
152
129
|
|
|
153
|
-
/* C9 a target set on Insights
|
|
130
|
+
/* C9 a target set on Insights shows on the Board */
|
|
154
131
|
{
|
|
155
132
|
const R = await open({ answers: () => ready(metrics({ targets: { corrections: { target: 12 }, merges: { target: 5 } } })) }), q = R.page;
|
|
156
|
-
await until(() => q
|
|
157
|
-
|
|
158
|
-
ok('C9 a measure
|
|
159
|
-
ok('C9 a measure
|
|
160
|
-
ok('C9 a measure with no target draws no dashed line, and the lead line says the line is the target set on Insights', !t[2].tg && !t[3].tg && await q.evaluate(() => /The dashed line is the target set on Insights/.test(document.querySelector('#metHint').textContent)), JSON.stringify(t.slice(2)));
|
|
161
|
-
await q.locator('#metBody .mt1').first().click(); await until(() => q.evaluate(() => document.querySelector('#dlg').classList.contains('on'))); await sleep(300);
|
|
162
|
-
ok('C9 the dialog names the target and the gap', await q.evaluate(() => { const g = [...document.querySelectorAll('#oMain .kv2 span')].map((s) => s.textContent).join('|'); return /Target\|12\.0/.test(g) && /Gap\|On target/.test(g); }));
|
|
133
|
+
const t = await until(async () => { const a = await tilesOf(q); return a.length === 4 ? a : null; }) || [];
|
|
134
|
+
ok('C9 a measure on target says On target with its target', t[0] && t[0].s.includes('On target · target 12.0') && !t[0].look, JSON.stringify(t[0]));
|
|
135
|
+
ok('C9 a measure off target says its gap and is outlined', t[1] && t[1].s.includes('2 short · target 5') && t[1].look, JSON.stringify(t[1]));
|
|
136
|
+
ok('C9 a measure with no target shows none', t[2] && !t[2].s.some((y) => /target/.test(y)) && !t[3].s.some((y) => /target/.test(y)), JSON.stringify(t.slice(2)));
|
|
163
137
|
ok('C9 no page error', R.errors.length === 0, R.errors.join(' | '));
|
|
164
138
|
await R.ctx.close();
|
|
165
139
|
}
|
|
166
140
|
|
|
167
|
-
/* C10 the Insights page shows the same measures, and a target saved there is sent for the Board */
|
|
141
|
+
/* C10 the Insights page shows the same measures (Delivery trends), and a target saved there is sent for the Board */
|
|
168
142
|
{
|
|
169
143
|
const IP = require('./lib/insights-premium.js'), IF = require('./fixtures/insights-premium-facts.js');
|
|
170
|
-
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), q = await ctx.newPage(), errs = [], saves = []
|
|
171
|
-
let tg = {};
|
|
144
|
+
const ctx = await browser.newContext({ viewport: { width: 1280, height: 900 } }), q = await ctx.newPage(), errs = [], saves = [];
|
|
172
145
|
q.on('pageerror', (e) => errs.push(String((e && e.message) || e)));
|
|
173
146
|
await q.route('**/api/insights-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: IP.build(IF.facts()), as_of: 1 }) }));
|
|
174
|
-
await q.route('**/api/board-metrics-premium*', (r) =>
|
|
175
|
-
await q.route('**/api/board-metric-targets/save', (r) => {
|
|
147
|
+
await q.route('**/api/board-metrics-premium*', (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(ready(metrics()).body) }));
|
|
148
|
+
await q.route('**/api/board-metric-targets/save', (r) => { saves.push(JSON.parse(r.request().postData() || '{}')); return r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, targets: {} }) }); });
|
|
176
149
|
await q.route('**/api/briefing-premium/**', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":true,"turns":[],"working":false}' }));
|
|
177
150
|
await q.goto(BASE + '/premium-insights.html');
|
|
178
|
-
const
|
|
179
|
-
ok('C10 Insights
|
|
180
|
-
|
|
181
|
-
await q.
|
|
182
|
-
|
|
183
|
-
await q.
|
|
184
|
-
ok('C10
|
|
185
|
-
await q.fill('#bmT', '5'); await q.click('#bmGo');
|
|
186
|
-
ok('C10 Save target sends the measure and the number for this board', await until(() => saves.length === 1) && saves[0].ws === 'w1' && saves[0].key === 'merges' && saves[0].target === '5', JSON.stringify(saves));
|
|
187
|
-
ok('C10 the card redraws with the target: its gap chip, dashed line and outline', await until(() => q.evaluate(() => { const t = document.querySelectorAll('#bmBody .mt1')[1]; return t && (t.querySelector('.mchip') || {}).textContent === '2 short' && !!t.querySelector('svg .tg') && t.classList.contains('off'); })));
|
|
151
|
+
const v = await until(async () => { const x = await q.evaluate(() => Object.fromEntries([...document.querySelectorAll('#bmBody [data-tile]')].map((e) => [e.dataset.tile, e.querySelector('.v').textContent]))); return x.corrections && x.corrections !== 'Reading' ? x : null; }, 20000);
|
|
152
|
+
ok('C10 Insights\' Delivery trends show the Board\'s measures with the same values', !!v && v.corrections === '10.0' && v.merges === '3' && v.idle === '1', JSON.stringify(v));
|
|
153
|
+
// premium-uncovered-features (IsTarget): a tile opens the target popover under it, and the number goes to the Board's target route.
|
|
154
|
+
await q.route('**/api/insights-records/tile', (r) => r.fulfill({ contentType: 'application/json', body: '{"ok":true,"tiles":{}}' }));
|
|
155
|
+
await q.click('#bmBody [data-tile="merges"]'); await until(() => q.evaluate(() => !!document.querySelector('#tgPop #tgV')));
|
|
156
|
+
await q.fill('#tgV', '5'); await q.click('#tgSet');
|
|
157
|
+
ok('C10 a target saved on Insights goes to the Board\'s target route, for this board', await until(() => saves.length === 1) && saves[0].key === 'merges' && saves[0].target === 5, JSON.stringify(saves));
|
|
188
158
|
ok('C10 no page error', errs.length === 0, errs.join(' | '));
|
|
189
159
|
await ctx.close();
|
|
190
160
|
}
|
|
191
|
-
|
|
192
|
-
/* C8 the card keeps every part of the mockup's card, in the Agreed design's type (premium-agreed-design: the Board is drawn to the AgBoard frames,
|
|
193
|
-
so the card no longer copies the retired briefing mockup's geometry and type; the same parts are checked, each drawn and visible) */
|
|
194
|
-
{
|
|
195
|
-
const SEL = [['card', '#cMet'], ['heading', '#hMet'], ['hint', '#cMet .mhint'], ['note', '#cMet .note'], ['t1', '#cMet .mt1:nth-child(1)'], ['t1val', '#cMet .mt1:nth-child(1) .mval'], ['t1cap', '#cMet .mt1:nth-child(1) .mwk'], ['t1chg', '#cMet .mt1:nth-child(1) .mchg'], ['t1svg', '#cMet .mt1:nth-child(1) svg'], ['t1line', '#cMet .mt1:nth-child(1) .ln2'], ['t1dot', '#cMet .mt1:nth-child(1) .dt'], ['t1foot', '#cMet .mt1:nth-child(1) .mfoot'], ['t3', '#cMet .mt1:nth-child(3)']];
|
|
196
|
-
for (const [w, h] of [[1280, 900], [390, 844]]) for (const th of ['light', 'dark']) {
|
|
197
|
-
const R = await open({ w, h, theme: th }); await until(() => R.page.evaluate(() => document.querySelectorAll('#metBody .mt1').length === 4)); await sleep(500);
|
|
198
|
-
const c = await R.page.evaluate((pairs) => { const miss = []; for (const [n, q] of pairs) { const e = document.querySelector(q); const r = e && e.getBoundingClientRect(); if (!e || ((!r.width || !r.height) && !e.closest('#metFold'))) miss.push(n); } /* the hint and the note sit in the card's info fold (premium-calmer-first-screen) */ return { miss, font: getComputedStyle(document.querySelector('#cMet')).fontFamily, over: document.documentElement.scrollWidth > innerWidth + 1 }; }, SEL);
|
|
199
|
-
ok(`C8 the Metrics card draws every part, in Nunito, with no sideways scroll at ${w} px, ${th}`, c.miss.length === 0 && /Nunito/.test(c.font) && !c.over, JSON.stringify(c));
|
|
200
|
-
await R.ctx.close();
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
161
|
return finish();
|
|
204
162
|
})().catch((e) => { console.error(e); finish(1); });
|
|
@@ -21,6 +21,9 @@ const T = require('./test-run').configure({ name: 'briefing-premium-products' })
|
|
|
21
21
|
|
|
22
22
|
const BASE = T.BASE;
|
|
23
23
|
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
24
|
+
/* premium-agreed-design: Home has no header line and no picker chip. The product picker is Home's minimal Products card in the Viewer
|
|
25
|
+
* (home-more.js openProducts, "Waiting for design"), opened from the place menu's More; it holds the header's line (#hxSnap), the count
|
|
26
|
+
* (#hxCount), one switch per workspace and Back to the default. The rows are Home's Needs-you rows; a row's product leads its hint. */
|
|
24
27
|
const until = async (fn, ms = 15000, step = 150) => { const t0 = Date.now(); for (;;) { let v = null; try { v = await fn(); } catch { v = null; } if (v) return v; if (Date.now() - t0 > ms) return v; await sleep(step); } };
|
|
25
28
|
const results = [];
|
|
26
29
|
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 300) : ''}`); };
|
|
@@ -80,43 +83,55 @@ const product = (name, cond) => {
|
|
|
80
83
|
const page = await ctx.newPage(); const errors = [];
|
|
81
84
|
page.on('pageerror', (e) => errors.push(String(e.message || e)));
|
|
82
85
|
await page.goto(BASE + '/premium.html' + q, { waitUntil: 'domcontentloaded' });
|
|
83
|
-
await page.waitForSelector('#
|
|
86
|
+
await page.waitForSelector('#hmList .hm-pg', { state: 'attached', timeout: 30000 }); // a group of the one list (premium-uncovered-features)
|
|
84
87
|
return { ctx, page, errors };
|
|
85
88
|
};
|
|
86
|
-
//
|
|
89
|
+
// the picker: the place menu's More, then Products; the card opens in the Viewer and reads the products
|
|
87
90
|
const pick = async (page) => {
|
|
88
|
-
if (!(await page.isVisible('#
|
|
89
|
-
|
|
91
|
+
if (!(await page.isVisible('#czViewer #hxCount'))) {
|
|
92
|
+
await page.click('#czFab'); await page.click('[data-cz-more]');
|
|
93
|
+
await page.click('#hmMenu [role="menuitem"]:has-text("Products")');
|
|
94
|
+
await page.waitForSelector('#czViewer #hxCount', { state: 'visible', timeout: 10000 });
|
|
95
|
+
}
|
|
90
96
|
};
|
|
91
|
-
const
|
|
97
|
+
const pickText = (page) => page.textContent('#czViewer #hxCount');
|
|
98
|
+
// premium-uncovered-features (canvas HmProducts): another product is a closed group of the one list ("IDPF · 1 your turn"); open it to see its rows
|
|
99
|
+
const openGroups = (page) => page.evaluate(() => { document.querySelectorAll('#hmList [data-hm-pg][aria-expanded="false"]').forEach((b) => b.click()); });
|
|
100
|
+
const rowsOf = async (page) => { await openGroups(page).catch(() => {}); return rowsOf0(page); };
|
|
101
|
+
const rowsOf0 = (page) => page.$$eval('#hmList .hm-r[data-id^="n:decision:"]', (els) => els.map((e) => ({ key: e.dataset.id.slice(2), tag: (e.closest('section.hm-pg') || e).getAttribute('aria-label') || '', title: e.querySelector('.hm-rt b').textContent })));
|
|
92
102
|
|
|
93
103
|
{
|
|
94
104
|
const { ctx, page, errors } = await open();
|
|
95
105
|
await until(async () => (await rowsOf(page)).length === 2, 20000);
|
|
96
106
|
const rows = await rowsOf(page);
|
|
97
|
-
ok('P6 each row
|
|
98
|
-
const snap = await page.textContent('#snap');
|
|
99
|
-
ok('P1 the header names what is read and what is not', /IDPF and microsites/.test(snap) && /not included/.test(snap) && /\b[Pp][Mm][Oo][Ss]\b|pmos/i.test(snap), snap);
|
|
100
|
-
ok('P2 the picker says how many of the workspaces are on', (await page.textContent('#pick')).replace(/\s+/g, '') === 'Products2of3', await page.textContent('#pick'));
|
|
107
|
+
ok('P6 each row sits in its product\'s group', rows.length === 2 && rows.map((r) => r.tag).sort().join() === 'IDPF,microsites', JSON.stringify(rows));
|
|
101
108
|
await pick(page);
|
|
102
|
-
const
|
|
103
|
-
ok('
|
|
104
|
-
|
|
105
|
-
ok('
|
|
109
|
+
const snap = await until(async () => { const t = await page.textContent('#czViewer #hxSnap').catch(() => ''); return t || null; }, 10000) || '';
|
|
110
|
+
ok('P1 the Products card names what is read and what is not', /IDPF and microsites/.test(snap) && /not included/.test(snap) && /\b[Pp][Mm][Oo][Ss]\b|pmos/i.test(snap), snap);
|
|
111
|
+
ok('P1 the Products card is marked Waiting for design', /Waiting for design/.test(await page.textContent('#czViewer')));
|
|
112
|
+
ok('P2 the picker says how many of the workspaces are on', (await pickText(page)).replace(/\s+/g, '') === 'Products2of3', await pickText(page));
|
|
113
|
+
const items = await page.$$eval('#czViewer .hx-sw[data-ws]', (els) => els.map((e) => ({ name: e.getAttribute('aria-label'), on: e.getAttribute('aria-checked'), h: Math.round(e.closest('.hx-row').getBoundingClientRect().height) })));
|
|
114
|
+
ok('P2 the card lists every workspace, the home one included, switched off', items.length === 3 && items.filter((i) => i.on === 'true').length === 2 && items.some((i) => i.on === 'false' && /home/.test(i.name)), JSON.stringify(items));
|
|
115
|
+
ok('P13 each workspace\'s line is at least 42 px high', items.every((i) => i.h >= 42), JSON.stringify(items.map((i) => i.h)));
|
|
106
116
|
// untick microsites: its row leaves, the setting is saved
|
|
107
|
-
await page.click(`#
|
|
117
|
+
await page.click(`#czViewer .hx-sw[data-ws="${wB.id}"]`);
|
|
108
118
|
ok('P4 an unticked product\'s row leaves the list', await until(async () => { const r = await rowsOf(page); return r.length === 1 && r[0].tag === 'IDPF'; }, 20000));
|
|
109
119
|
const saved = (await json('GET', '/api/settings')).body.settings.find((s) => s.key === 'ws.briefing.include');
|
|
110
120
|
ok('P3 the choice is saved as a list of workspace ids', saved && JSON.stringify(saved.value) === JSON.stringify([wA.id]), JSON.stringify(saved));
|
|
111
|
-
ok('P2 the count in the picker follows', (await
|
|
112
|
-
|
|
121
|
+
ok('P2 the count in the picker follows', !!(await until(async () => (await pickText(page)).replace(/\s+/g, '') === 'Products1of3', 10000)), await pickText(page));
|
|
122
|
+
await page.focus(`#czViewer .hx-sw[data-ws="${wA.id}"]`); await page.keyboard.press('Enter');
|
|
123
|
+
ok('P13 keyboard: Enter on a switch flips it', !!(await until(async () => (await page.getAttribute(`#czViewer .hx-sw[data-ws="${wA.id}"]`, 'aria-checked')) === 'false', 10000)));
|
|
124
|
+
await page.focus(`#czViewer .hx-sw[data-ws="${wA.id}"]`).catch(() => {}); await page.keyboard.press('Enter');
|
|
125
|
+
await until(async () => (await page.getAttribute(`#czViewer .hx-sw[data-ws="${wA.id}"]`, 'aria-checked')) === 'true', 10000);
|
|
126
|
+
await page.keyboard.press('Escape');
|
|
127
|
+
ok('P13 keyboard: Escape closes the card', !!(await until(() => page.evaluate(() => !window.czViewer.isOpen()), 3000)));
|
|
113
128
|
ok('P3 the choice survives a reload', await (async () => { await page.reload({ waitUntil: 'domcontentloaded' }); return until(async () => { const r = await rowsOf(page); return r.length === 1 && r[0].tag === 'IDPF' ? 1 : 0; }, 20000); })());
|
|
114
129
|
// tick the home workspace
|
|
115
|
-
await pick(page); await page.click(`#
|
|
116
|
-
ok('P3
|
|
130
|
+
await pick(page); await page.click(`#czViewer .hx-sw[data-ws="${home.id}"]`);
|
|
131
|
+
ok('P3 switching the home workspace on reads it', await until(async () => (await page.getAttribute(`#czViewer .hx-sw[data-ws="${home.id}"]`, 'aria-checked')) === 'true' && new RegExp(home.name + ' and IDPF|IDPF and ' + home.name, 'i').test(await page.textContent('#czViewer #hxSnap')), 20000), await page.textContent('#czViewer #hxSnap').catch(() => ''));
|
|
117
132
|
// back to the default
|
|
118
|
-
await page.click('#
|
|
119
|
-
ok('P3 Back to the default reads every product but the home one again', await until(async () => (await rowsOf(page)).length === 2
|
|
133
|
+
await page.click('#czViewer [data-reset]');
|
|
134
|
+
ok('P3 Back to the default reads every product but the home one again', await until(async () => (await rowsOf(page)).length === 2 && (await pickText(page)).replace(/\s+/g, '') === 'Products2of3', 20000), await pickText(page));
|
|
120
135
|
ok('P3 and the saved choice is gone', (await json('GET', '/api/settings')).body.settings.find((s) => s.key === 'ws.briefing.include').changed === false);
|
|
121
136
|
ok('no page error', errors.length === 0, errors.join(' | '));
|
|
122
137
|
await ctx.close();
|
|
@@ -127,11 +142,11 @@ const product = (name, cond) => {
|
|
|
127
142
|
const { ctx, page } = await open();
|
|
128
143
|
await until(async () => (await rowsOf(page)).length === 2, 20000);
|
|
129
144
|
const key = (await rowsOf(page)).find((r) => r.tag === 'IDPF').key;
|
|
130
|
-
await page.click(`#
|
|
131
|
-
await page.waitForSelector('#
|
|
132
|
-
await page.click('#
|
|
133
|
-
await page.fill('#
|
|
134
|
-
await page.click('#
|
|
145
|
+
await page.click(`#hmList [data-hm-sel="n:${key}"]`);
|
|
146
|
+
await page.waitForSelector('#hmLog [data-dc-opt]'); // the decision card in the chat (canvas HmDecide)
|
|
147
|
+
await page.click('#hmLog [data-dc-opt="extend"]');
|
|
148
|
+
await page.fill('#dcWhy', 'IDPF moves the date.');
|
|
149
|
+
await page.click('#hmLog [data-dc-rec]');
|
|
135
150
|
ok('P9 the press is recorded and the IDPF row leaves, the microsites row stays', await until(async () => { const r = await rowsOf(page); return r.length === 1 && r[0].tag === 'microsites' ? 1 : 0; }, 20000), JSON.stringify(await rowsOf(page)));
|
|
136
151
|
const dA = fs.readFileSync(path.join(rootA, 'pm-decisions.md'), 'utf8'), dB = fs.readFileSync(path.join(rootB, 'pm-decisions.md'), 'utf8');
|
|
137
152
|
ok('P9 the decision is in IDPF\'s journal and not in the other product\'s or the home one\'s', /KC9/.test(dA) && /IDPF moves the date/.test(dA) && !/KC9/.test(dB) && !/IDPF moves the date/.test(fs.readFileSync(path.join(home.root, 'pm-decisions.md'), 'utf8')));
|
|
@@ -158,15 +173,16 @@ const product = (name, cond) => {
|
|
|
158
173
|
const { ctx, page } = await open({ w, h: 800, theme: th });
|
|
159
174
|
await until(async () => (await rowsOf(page)).length >= 1, 20000);
|
|
160
175
|
await pick(page);
|
|
161
|
-
const o = await page.evaluate(() => ({ sw: document.documentElement.scrollWidth, cw: document.documentElement.clientWidth, menu: (() => { const r = document.querySelector('#
|
|
162
|
-
ok(`P13 at ${w} px, ${th}: no sideways scroll with the
|
|
176
|
+
const o = await page.evaluate(() => ({ sw: document.documentElement.scrollWidth, cw: document.documentElement.clientWidth, menu: (() => { const r = document.querySelector('#czViewer').getBoundingClientRect(); return { l: Math.round(r.left), r: Math.round(r.right) }; })() }));
|
|
177
|
+
ok(`P13 at ${w} px, ${th}: no sideways scroll with the Products card open, and the card stays on screen`, o.sw <= o.cw && o.menu.l >= 0 && o.menu.r <= o.cw, JSON.stringify(o));
|
|
163
178
|
await ctx.close();
|
|
164
179
|
}
|
|
165
180
|
|
|
166
181
|
{
|
|
167
182
|
// the narrowed view (P12): the one-workspace page, with a way back
|
|
168
183
|
const { ctx, page } = await open({ q: '?ws=' + encodeURIComponent(wB.id) });
|
|
169
|
-
|
|
184
|
+
await pick(page);
|
|
185
|
+
ok('P12 ?ws= shows that one workspace and a link back to the picked products', await until(async () => (await page.$('#czViewer #pickAll')) !== null, 20000) && (await page.getAttribute('#czViewer #pickAll', 'href')) === '/premium.html');
|
|
170
186
|
await ctx.close();
|
|
171
187
|
}
|
|
172
188
|
return finish();
|