create-pmos 0.692.0 → 0.693.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 +9 -3
- 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/adler-moments-test.js +3 -35
- package/workspace/adler-seasons-test.js +1 -1
- package/workspace/briefing-premium-adddoc-test.js +1 -1
- package/workspace/briefing-premium-board-test.js +1 -1
- package/workspace/briefing-premium-doc-edit-test.js +1 -1
- package/workspace/briefing-premium-work-test.js +2 -2
- package/workspace/changelog.json +8 -2
- package/workspace/chat-asks-test.js +1 -1
- package/workspace/core-docs-workflow-test.js +1 -1
- package/workspace/ev-everywhere-test.js +3 -14
- package/workspace/guide/home.md +1 -1
- package/workspace/guide/layout.md +2 -2
- package/workspace/guide/settings-and-switches.md +0 -1
- package/workspace/impact-screens-test.js +2 -47
- package/workspace/ini-workflow-test.js +1 -1
- package/workspace/live-pill-round-test.js +6 -18
- package/workspace/milestone-suggest-test.js +4 -28
- package/workspace/news-viewers-test.js +3 -29
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/premium-board-actions-test.js +2 -2
- package/workspace/premium-briefing-depth-test.js +4 -4
- package/workspace/premium-chat-attach-test.js +3 -2
- package/workspace/premium-chat-chart-tab-test.js +8 -7
- package/workspace/premium-chat-context-test.js +3 -1
- package/workspace/premium-chat-goal-view-test.js +3 -1
- package/workspace/premium-chat-line-test.js +8 -6
- package/workspace/premium-chat-report-tab-test.js +13 -5
- package/workspace/premium-chat-term-test.js +2 -2
- package/workspace/premium-chat-viewer-test.js +10 -16
- package/workspace/premium-core-doc-issue-test.js +7 -2
- package/workspace/premium-discuss-landing-test.js +9 -5
- package/workspace/premium-html-viewer-test.js +7 -3
- package/workspace/premium-link-suggest-test.js +6 -10
- package/workspace/premium-phone-card-test.js +2 -2
- package/workspace/premium-viewer-download-test.js +1 -1
- package/workspace/premium-viewer-flicker-test.js +1 -1
- package/workspace/premium-viewer-share-test.js +2 -2
- package/workspace/premium-viewer-test.js +1 -1
- package/workspace/premium-vw-cal-test.js +1 -1
- package/workspace/premium-vw-copy-test.js +3 -3
- package/workspace/premium-vw-doc-test.js +1 -1
- package/workspace/premium-vw-item-test.js +1 -1
- package/workspace/premium-work-depth-test.js +2 -2
- package/workspace/program-charter-test.js +1 -12
- package/workspace/program-leave-test.js +2 -2
- package/workspace/program-order-test.js +3 -65
- package/workspace/project-onboard-flow-test.js +5 -5
- package/workspace/public/pm/cozy-home.css +0 -6
- package/workspace/public/pm/cozy-panels.js +2 -6
- package/workspace/public/pm/cozy-popup.css +1 -0
- package/workspace/public/pm/cozy-popup.js +15 -2
- package/workspace/public/pm/cozy-today-page.css +1 -1
- package/workspace/public/pm/cozy-today.css +0 -14
- package/workspace/public/pm/cozy-viewer.js +14 -38
- package/workspace/public/pm/goal-chat.js +2 -2
- package/workspace/public/pm/home-app.js +8 -67
- package/workspace/public/pm/home-chat.js +1 -1
- package/workspace/public/pm/home-ses-name.js +3 -2
- package/workspace/public/pm/home-today.js +4 -18
- package/workspace/public/premium-intelligence.html +1 -1
- package/workspace/public/premium-viewer.html +1 -1
- package/workspace/public/premium-workflows.html +1 -1
- package/workspace/ready-dash-ui-test.js +1 -1
- package/workspace/rename-test.js +2 -2
- package/workspace/server.js +11 -12
- package/workspace/session-names-test.js +34 -56
- package/workspace/sort-order-test.js +2 -71
- package/workspace/split-merge-ui-test.js +1 -1
- package/workspace/stage-card-tasks-test.js +1 -1
- package/workspace/stage-card-test.js +1 -1
- package/workspace/task-card-test.js +1 -1
- package/workspace/task-press-test.js +1 -1
- package/workspace/task-views-test.js +1 -1
- package/workspace/test-lists/adler-seasons-art.json +3 -6
- package/workspace/test-lists/batch18-asks.json +1 -1
- package/workspace/test-lists/briefing-premium.json +1 -11
- package/workspace/test-lists/premium-agreed-viewer.json +1 -1
- package/workspace/test-run.js +0 -2
- package/workspace/test-timings.json +0 -4
- package/workspace/tk-tasks-test.js +3 -17
- package/workspace/viewer-trail-test.js +2 -2
- package/workspace/workflows-setup-test.js +4 -2
- package/workspace/adler-seasons-art-test.js +0 -116
- package/workspace/briefing-premium-initiative-test.js +0 -289
- package/workspace/briefing-premium-products-test.js +0 -209
- package/workspace/briefing-premium-sources-test.js +0 -250
- package/workspace/briefing-premium-test.js +0 -282
- package/workspace/home-other-product-test.js +0 -197
- package/workspace/home-pill-test.js +0 -138
- package/workspace/home-railcard-test.js +0 -196
- package/workspace/home-rows-test.js +0 -389
- package/workspace/panels-test.js +0 -454
- package/workspace/public/premium.html +0 -48
- package/workspace/test-lists/batch18-panels.json +0 -9
- package/workspace/test-lists/home-railcard.json +0 -9
- package/workspace/test-lists/home-sessions-pill.json +0 -6
- package/workspace/test-lists/viewer-home-rows.json +0 -9
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* sort-order-test.js — sort or arrange
|
|
3
|
+
/* sort-order-test.js — sort or arrange the Board by hand, the ONE order Work reads too (batch 14 item 8, option A; canvas SoAHomePhone,
|
|
4
4
|
* SoABoardPhone, SoADesk). Serves the real pages from the real server; GET /api/programs answers Project Ascent (fixtures/program-ascent.js)
|
|
5
5
|
* and /api/settings is answered here from one layout, so Home reads what the Board saved. order-model.test.js covers the sorting itself.
|
|
6
6
|
* B Board: the sort button in the header; the programs and products follow the layout; dragging a product's header saves My order and
|
|
7
7
|
* the toast has Undo; the menu's Name A to Z sorts and the button says so; a move out of another sort keeps the order on screen
|
|
8
|
-
*
|
|
9
|
-
* P phone: the button fits the header, no sideways scroll, no grip shows, and a held product header drags */
|
|
8
|
+
* Home's list read the same order; its checks went with Home's page (home-desk-layout-delete). */
|
|
10
9
|
const path = require('path');
|
|
11
10
|
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
12
11
|
const { spawn } = require('child_process');
|
|
@@ -134,73 +133,5 @@ const route = async (page) => {
|
|
|
134
133
|
await ctx.close();
|
|
135
134
|
}
|
|
136
135
|
|
|
137
|
-
/* H — Home reads the same layout */
|
|
138
|
-
const home = async (o = {}) => {
|
|
139
|
-
const ctx = await browser.newContext({ viewport: { width: o.w || 1440, height: o.h || 900 }, hasTouch: !!o.touch, isMobile: !!o.touch });
|
|
140
|
-
const page = await ctx.newPage();
|
|
141
|
-
const errors = [];
|
|
142
|
-
page.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
143
|
-
const json = (body) => (r) => r.fulfill({ contentType: 'application/json', body: JSON.stringify(body) });
|
|
144
|
-
await page.route(/\/api\/briefing-premium(\?.*)?$/, json({ ok: true, state: 'ready', model: B.build(HF.facts()), as_of: Date.now() }));
|
|
145
|
-
await page.route('**/api/briefing-premium/thread**', json({ ok: true, turns: [], working: false }));
|
|
146
|
-
await page.route('**/api/board-premium*', (r) => { const q = new URL(r.request().url()).searchParams; r.fulfill({ contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: BP.build(F.programFacts(q.get('ws') || 'idpf')), as_of: Date.now() }) }); });
|
|
147
|
-
await page.route('**/api/board-trail*', (r) => r.fulfill({ status: 500, contentType: 'application/json', body: JSON.stringify({ ok: false, error: 'not in this check' }) }));
|
|
148
|
-
await route(page);
|
|
149
|
-
const am = new Date(); am.setHours(10, 0, 0, 0); await page.clock.setFixedTime(am);
|
|
150
|
-
await page.goto(BASE + '/premium.html?theme=light');
|
|
151
|
-
await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-po-list="@top"] > [data-po-id]') && document.body.dataset.hmTop === '1'), 20000);
|
|
152
|
-
await page.waitForTimeout(300);
|
|
153
|
-
return { ctx, page, errors };
|
|
154
|
-
};
|
|
155
|
-
{
|
|
156
|
-
const { ctx, page: p, errors } = await home();
|
|
157
|
-
const hk = await top(p, '#hmList');
|
|
158
|
-
const shared = boardTop.filter((k) => hk.includes(k));
|
|
159
|
-
ok('H Home lists the programs and products in the Board\'s order', shared.length >= 2 && hk.filter((k) => boardTop.includes(k)).join() === shared.join(), JSON.stringify({ hk, boardTop }));
|
|
160
|
-
const btn = await p.evaluate(() => { const b = document.querySelector('#hmList .hm-hd [data-so-btn]'); return b ? b.getAttribute('aria-label') : null; });
|
|
161
|
-
ok('H the same sort button sits in Home\'s header and says the sort now', btn === 'Sort. Now: My order', String(btn));
|
|
162
|
-
const own = await p.evaluate(() => [...document.querySelectorAll('#hmList [data-po-list^="@p:"]')].length);
|
|
163
|
-
ok('H a product\'s initiatives are one list the grip arranges', own >= 1, String(own));
|
|
164
|
-
if (process.env.SHOTS) { await p.hover('#hmList [data-po-list="@top"] > [data-po-id]:last-child .hv-gh'); await p.screenshot({ path: process.env.SHOTS + '/home-desk.png' }); }
|
|
165
|
-
// drag the last group to the top on Home: the Board would read it the same way
|
|
166
|
-
const last = hk[hk.length - 1];
|
|
167
|
-
await p.hover(`#hmList [data-po-list="@top"] > [data-po-id="${last}"] .hv-gh`);
|
|
168
|
-
const g = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${last}"] > .so-grip`).boundingBox();
|
|
169
|
-
const t0 = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${hk[0]}"]`).boundingBox();
|
|
170
|
-
const n0 = posts.length;
|
|
171
|
-
if (g) { await p.mouse.move(g.x + g.width / 2, g.y + g.height / 2); await p.mouse.down(); await p.mouse.move(g.x + g.width / 2, t0.y + 6, { steps: 8 }); await p.mouse.up(); }
|
|
172
|
-
await until(async () => (await top(p, '#hmList'))[0] === last);
|
|
173
|
-
ok('H the header grip moves a group on Home: one save, first in the shared order', !!g && posts.length === n0 + 1 && LAY.top[0] === last && (await top(p, '#hmList'))[0] === last, JSON.stringify({ g, top: LAY.top }));
|
|
174
|
-
ok('H no page error', !errors.length, errors.join(' | '));
|
|
175
|
-
await ctx.close();
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* P — a phone */
|
|
179
|
-
{
|
|
180
|
-
const { ctx, page: p, errors } = await home({ w: 390, h: 844, touch: true });
|
|
181
|
-
const fit = await p.evaluate(() => { const b = document.querySelector('#hmList .hm-hd [data-so-btn]'); const r = b && b.getBoundingClientRect(); return r ? r.right <= window.innerWidth && r.width >= 32 : false; });
|
|
182
|
-
ok('P phone: the sort button fits Home\'s header', fit);
|
|
183
|
-
const grips = await p.evaluate(() => [...document.querySelectorAll('#hmList [data-po-grip]')].filter((g) => getComputedStyle(g).display !== 'none').length);
|
|
184
|
-
ok('P phone: no grip shows (hold instead)', grips === 0, String(grips));
|
|
185
|
-
const hk = await top(p, '#hmList');
|
|
186
|
-
// the top of Home (Your move, Waiting on others) sits above the groups: bring them into view first
|
|
187
|
-
await p.evaluate((k) => document.querySelector(`#hmList [data-po-list="@top"] > [data-po-id="${k}"]`).scrollIntoView({ block: 'center' }), hk[hk.length - 1]);
|
|
188
|
-
const s = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${hk[hk.length - 1]}"] .hv-gh`).boundingBox();
|
|
189
|
-
const t = await p.locator(`#hmList [data-po-list="@top"] > [data-po-id="${hk[0]}"]`).boundingBox();
|
|
190
|
-
const cdp = await ctx.newCDPSession(p);
|
|
191
|
-
const pt = (y) => [{ x: s.x + s.width / 2, y }];
|
|
192
|
-
const n0 = posts.length;
|
|
193
|
-
await cdp.send('Input.dispatchTouchEvent', { type: 'touchStart', touchPoints: pt(s.y + s.height / 2) });
|
|
194
|
-
await sleep(600);
|
|
195
|
-
const lifted = await p.evaluate((k) => !!document.querySelector(`[data-po-list="@top"] > [data-po-id="${k}"].po-lift`), hk[hk.length - 1]);
|
|
196
|
-
for (let k = 1; k <= 6; k++) await cdp.send('Input.dispatchTouchEvent', { type: 'touchMove', touchPoints: pt(s.y + s.height / 2 - ((s.y + s.height / 2 - (t.y + 6)) * k) / 6) });
|
|
197
|
-
if (process.env.SHOTS) await p.screenshot({ path: process.env.SHOTS + '/home-phone-drag.png' });
|
|
198
|
-
await cdp.send('Input.dispatchTouchEvent', { type: 'touchEnd', touchPoints: [] });
|
|
199
|
-
await until(() => posts.length === n0 + 1);
|
|
200
|
-
ok('P phone: hold a group\'s header, it lifts; drag it up and the order saves', lifted && posts.length === n0 + 1 && LAY.top[0] === hk[hk.length - 1], JSON.stringify({ lifted, top: LAY.top, hk }));
|
|
201
|
-
ok('P phone: no sideways scroll', await p.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth + 1));
|
|
202
|
-
ok('P phone: no page error', !errors.length, errors.join(' | '));
|
|
203
|
-
await ctx.close();
|
|
204
|
-
}
|
|
205
136
|
finish();
|
|
206
137
|
})();
|
|
@@ -142,7 +142,7 @@ const shot = (p, name) => (SHOTS ? p.screenshot({ path: path.join(SHOTS, name) }
|
|
|
142
142
|
const p = await ctx.newPage();
|
|
143
143
|
const errors = [];
|
|
144
144
|
p.on('pageerror', (e) => errors.push(String((e && e.message) || e)));
|
|
145
|
-
await p.goto(`${BASE}/
|
|
145
|
+
await p.goto(`${BASE}/today.html?theme=light&ws=${ws}&ini=fx-full`);
|
|
146
146
|
const g = await until(() => p.evaluate(() => { const s = document.querySelector('#czViewer .sm-gone'); return s ? s.textContent : null; }), 30000);
|
|
147
147
|
ok('H the merged one leads with Merged · <day> and where its work went', !!g && /^Merged · /.test(g.trim()) && /are now in /.test(g), g);
|
|
148
148
|
await shot(p, 'home-merged.png');
|
|
@@ -103,7 +103,7 @@ const TICKETS = [{ key: 'IDPF-3387', title: 'Refactor the AppAuthService', statu
|
|
|
103
103
|
if (p === '/api/boards/tasks/order') { const from = S.order[b.section] || []; S.order[b.section] = b.tasks; return json(r, { ok: true, from }); }
|
|
104
104
|
return json(r, { ok: true });
|
|
105
105
|
});
|
|
106
|
-
if (where === 'home') await page.goto(BASE + '/
|
|
106
|
+
if (where === 'home') await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
107
107
|
if (where === 'home') await until(() => page.evaluate(() => document.body.dataset.hmTop === '1'), 20000); // the top of Home has read its two sources
|
|
108
108
|
else {
|
|
109
109
|
await page.goto(BASE + '/premium-board.html?theme=' + theme);
|
|
@@ -117,7 +117,7 @@ async function pure() {
|
|
|
117
117
|
for (const p of ['**/api/boards/move', '**/api/initiative-layout', '**/api/boards/ini-auto']) await page.route(p, (r) => (r.request().method() === 'POST' ? json(r, { ok: true, auto: false, held: [], by: 'stage', names: [], of: {}, stage: {}, sets: [] }) : r.fallback()));
|
|
118
118
|
if (sessions) await page.route(/\/api\/sessions(\?.*)?$/, (r) => json(r, { sessions }));
|
|
119
119
|
if (trail) await page.route('**/api/board-trail*', (r) => json(r, trail));
|
|
120
|
-
await page.goto(BASE + '/
|
|
120
|
+
await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
121
121
|
if (w <= 760) await everyPart(page);
|
|
122
122
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer [data-hi-v="page"] .iv-mc')), 30000);
|
|
123
123
|
return { ctx, page, errors, posts, up };
|
|
@@ -165,7 +165,7 @@ async function pure() {
|
|
|
165
165
|
}
|
|
166
166
|
return json(r, { ok: true, from: {}, item: {} });
|
|
167
167
|
});
|
|
168
|
-
await page.goto(BASE + '/
|
|
168
|
+
await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
169
169
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer')), 30000);
|
|
170
170
|
return { ctx, page, errors, posts, up };
|
|
171
171
|
};
|
|
@@ -92,7 +92,7 @@ const back = (p) => p.evaluate(() => { const b = document.querySelector('#czView
|
|
|
92
92
|
browser = besidePage(classicBoard(await chromium.launch({ executablePath: exe })));
|
|
93
93
|
|
|
94
94
|
/* Home: the initiative's page in the Viewer */
|
|
95
|
-
const H = await page('/
|
|
95
|
+
const H = await page('/today.html?ini=' + ID + '&ws=w1&board=w1&theme=light');
|
|
96
96
|
const hp = H.p;
|
|
97
97
|
const up = await until(() => hp.evaluate((v) => !!document.querySelector(v + ' [data-hi-v="page"] .iv-mc'), V), 30000);
|
|
98
98
|
ok('T0 Home opens the initiative\'s page', up);
|
|
@@ -350,7 +350,7 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
350
350
|
// the layout answers as the server does once a pick saves (the write's own wording is initiative-layout.test.js's)
|
|
351
351
|
await page.route('**/api/initiative-layout*', (r) => { const rq = r.request(); if (rq.method() === 'POST') { const b = JSON.parse(rq.postData() || '{}'); posts.push({ path: '/api/initiative-layout', body: b }); layout = { ...layout, by: b.grouping || b.by, picked: true }; } json(r, layout); });
|
|
352
352
|
await page.route(/\/api\/(boards\/|lifecycle)/, (r) => { const rq = r.request(); if (rq.method() !== 'GET') posts.push({ path: new URL(rq.url()).pathname, body: JSON.parse(rq.postData() || '{}') }); json(r, { ok: true }); });
|
|
353
|
-
if (where === 'home') await page.goto(BASE + '/
|
|
353
|
+
if (where === 'home') await page.goto(BASE + '/today.html?ini=self-serve-v2&ws=w1&board=w1&theme=' + theme);
|
|
354
354
|
else {
|
|
355
355
|
await page.goto(BASE + '/premium-board.html?theme=' + theme);
|
|
356
356
|
await until(() => page.evaluate(() => document.querySelectorAll('#ibBody .ini2, #ibBody .bt-l').length > 0), 20000);
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "Batch 18 item 8-B, Adler dressed for the season: the charms, their scenes and where they show (pm/cozy-adler.js charms and charmScene, the tap popover, Your day's scene and greeting, the chat face, first run, the Board's win). adler-seasons-art.test.js is pure
|
|
2
|
+
"_comment": "Batch 18 item 8-B, Adler dressed for the season: the charms, their scenes and where they show (pm/cozy-adler.js charms and charmScene, the tap popover, Your day's scene and greeting, the chat face, first run, the Board's win). adler-seasons-art.test.js is pure. Its browser suite drove Your day on Home's list and went with Home's page (home-desk-layout-delete).",
|
|
3
3
|
"modules": [
|
|
4
4
|
"adler-seasons-art.test.js"
|
|
5
5
|
],
|
|
6
|
-
"panels": [
|
|
7
|
-
"adler-seasons-art-test.js"
|
|
8
|
-
],
|
|
6
|
+
"panels": [],
|
|
9
7
|
"seconds": {
|
|
10
|
-
"adler-seasons-art.test.js": 1
|
|
11
|
-
"adler-seasons-art-test.js": 30
|
|
8
|
+
"adler-seasons-art.test.js": 1
|
|
12
9
|
}
|
|
13
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "batch 18 item 2-A: the asks in the Viewer (start / blocked, decision, waited, source) on the one pattern, canvas In development OvA1Start, OvA1After, OvA2Decide, OvA3Waited, OvA4Source, OvA11Dark, OvA12Edges, OvA10Desk. The model in node; the
|
|
2
|
+
"_comment": "batch 18 item 2-A: the asks in the Viewer (start / blocked, decision, waited, source) on the one pattern, canvas In development OvA1Start, OvA1After, OvA2Decide, OvA3Waited, OvA4Source, OvA11Dark, OvA12Edges, OvA10Desk. The model in node; the browser suites that pressed them through Home's list went with Home's page (home-desk-layout-delete).",
|
|
3
3
|
"modules": ["home-need.test.mjs"],
|
|
4
4
|
"seconds": { "home-need.test.mjs": 1 }
|
|
5
5
|
}
|
|
@@ -1,37 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Initiative briefing-premium: the premium Briefing page, served from a fixture model, checked against the mockup; and its reply box against the real server with a stub claude. premium-welcome-test.js is retired (initiative claude-onboarding-build): /premium-welcome.html now redirects to the Home setup conversation, which project-onboard-flow-test.js covers.",
|
|
3
3
|
"panels": [
|
|
4
|
-
"briefing-premium-test.js",
|
|
5
4
|
"briefing-premium-work-test.js",
|
|
6
5
|
"briefing-premium-board-test.js",
|
|
7
6
|
"briefing-premium-insights-test.js",
|
|
8
|
-
"briefing-premium-initiative-test.js",
|
|
9
7
|
"briefing-premium-adddoc-test.js",
|
|
10
8
|
"briefing-premium-doc-edit-test.js",
|
|
11
9
|
"briefing-premium-calendar-test.js",
|
|
12
10
|
"briefing-premium-calendar-2-test.js",
|
|
13
11
|
"briefing-premium-calendar-3-test.js",
|
|
14
|
-
"briefing-premium-products-test.js",
|
|
15
|
-
"home-other-product-test.js",
|
|
16
|
-
"briefing-premium-sources-test.js",
|
|
17
12
|
"briefing-premium-metrics-test.js",
|
|
18
13
|
"briefing-premium-agent-server.test.js"
|
|
19
14
|
],
|
|
20
15
|
"seconds": {
|
|
21
|
-
"briefing-premium-test.js": 60,
|
|
22
16
|
"briefing-premium-work-test.js": 80,
|
|
23
17
|
"briefing-premium-board-test.js": 120,
|
|
24
18
|
"briefing-premium-insights-test.js": 90,
|
|
25
|
-
"briefing-premium-initiative-test.js": 120,
|
|
26
19
|
"briefing-premium-adddoc-test.js": 120,
|
|
27
20
|
"briefing-premium-doc-edit-test.js": 90,
|
|
28
21
|
"briefing-premium-calendar-test.js": 90,
|
|
29
22
|
"briefing-premium-calendar-2-test.js": 90,
|
|
30
23
|
"briefing-premium-calendar-3-test.js": 120,
|
|
31
|
-
"briefing-premium-products-test.js": 90,
|
|
32
|
-
"briefing-premium-sources-test.js": 90,
|
|
33
24
|
"briefing-premium-metrics-test.js": 120,
|
|
34
|
-
"briefing-premium-agent-server.test.js": 40
|
|
35
|
-
"home-other-product-test.js": 60
|
|
25
|
+
"briefing-premium-agent-server.test.js": 40
|
|
36
26
|
}
|
|
37
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "Initiative premium-agreed-design, area viewer (I1): the pure header card of the premium initiative page. The
|
|
2
|
+
"_comment": "Initiative premium-agreed-design, area viewer (I1): the pure header card of the premium initiative page. The initiative opens in the popup (premium-vw-item-test.js); the Viewer's Jira ticket (V1) in premium-vw-jira*.",
|
|
3
3
|
"modules": [
|
|
4
4
|
"premium-initiative-head.test.js"
|
|
5
5
|
],
|
package/workspace/test-run.js
CHANGED
|
@@ -116,8 +116,6 @@ function configure({ name = 'run', port = null } = {}) {
|
|
|
116
116
|
// A private tmux socket, never the PM's own ('pmos'), so a suite cannot reach their sessions.
|
|
117
117
|
const tmuxSock = `pmos-${name}-${process.pid}`;
|
|
118
118
|
process.env.PMOS_TMUX_SOCK = tmuxSock;
|
|
119
|
-
// Home stays at /premium.html in the suites (server.js sends a bare desk Home to Today otherwise): they test the Home that still ships
|
|
120
|
-
process.env.PMOS_DESK_HOME = 'keep';
|
|
121
119
|
|
|
122
120
|
const chosen = Number(port) > 0 ? Number(port) : claimEphemeralPort();
|
|
123
121
|
|
|
@@ -24,18 +24,14 @@
|
|
|
24
24
|
"briefing-premium-doc-edit-test.js": 40,
|
|
25
25
|
"briefing-premium-doc-edit.test.js": 1,
|
|
26
26
|
"briefing-premium-drafts.test.js": 1,
|
|
27
|
-
"briefing-premium-initiative-test.js": 27,
|
|
28
27
|
"briefing-premium-initiative.test.js": 1,
|
|
29
28
|
"briefing-premium-insights-test.js": 58,
|
|
30
29
|
"briefing-premium-insights.test.js": 1,
|
|
31
30
|
"briefing-premium-metrics-test.js": 24,
|
|
32
31
|
"briefing-premium-metrics.test.js": 1,
|
|
33
|
-
"briefing-premium-products-test.js": 38,
|
|
34
32
|
"briefing-premium-products.test.js": 1,
|
|
35
33
|
"briefing-premium-reports.test.js": 1,
|
|
36
|
-
"briefing-premium-sources-test.js": 36,
|
|
37
34
|
"briefing-premium-sources.test.js": 1,
|
|
38
|
-
"briefing-premium-test.js": 26,
|
|
39
35
|
"briefing-premium-work-test.js": 18,
|
|
40
36
|
"briefing-premium-work.test.js": 1,
|
|
41
37
|
"briefing-premium-writes.test.js": 1,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* nothing reaches Jira or the repository. Screenshots go to TK_SHOTS when set.
|
|
8
8
|
* G1 the group icon and its menu · T1 By epic by itself, the send icon, the sent state · T2 the drafted ticket · T3 the Send sheet, its one
|
|
9
9
|
* labeled Send · G2 Your groups: drag between, ⋯, New group · G3 Timeline and Kanban draw the groups · G4 the phone · G5 the Board's panel
|
|
10
|
-
* · G6 the old panel is gone
|
|
10
|
+
* · G6 the old panel is gone (New → A task was Home's list head: home-desk-layout-delete) */
|
|
11
11
|
const fs = require('fs');
|
|
12
12
|
const { classicBoard } = require('./lib/classic-board'); // these checks are about the four Board views, not Work (work-one-view)
|
|
13
13
|
const path = require('path');
|
|
@@ -117,7 +117,7 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
117
117
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv .iv-th')), 20000);
|
|
118
118
|
return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
|
|
119
119
|
}
|
|
120
|
-
await page.goto(BASE + '/
|
|
120
|
+
await page.goto(BASE + '/today.html?ini=' + I + '&ws=w1&board=w1&theme=' + theme);
|
|
121
121
|
if (w <= 760) await everyPart(page);
|
|
122
122
|
const up = await until(() => page.evaluate(() => !!document.querySelector('#czViewer .iv-mc')), 30000);
|
|
123
123
|
return { ctx, page, errors, posts, up, set: (v) => { cur = v; } };
|
|
@@ -241,7 +241,7 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
241
241
|
await q.click('.ig-pop [role="menuitem"]:has-text("Rename")');
|
|
242
242
|
await q.fill('.ig-pop input', 'Legal and filing');
|
|
243
243
|
await q.keyboard.press('Enter');
|
|
244
|
-
const rn = await until(() => lastPost(B, '/api/initiative-layout'));
|
|
244
|
+
const rn = await until(() => { const x = lastPost(B, '/api/initiative-layout'); return x && x.body.kind === 'rename' ? x : null; });
|
|
245
245
|
ok('G2 Rename writes the new name', !!rn && rn.body.kind === 'rename' && rn.body.from === 'Legal' && rn.body.to === 'Legal and filing', JSON.stringify(rn && rn.body));
|
|
246
246
|
await openMore(q);
|
|
247
247
|
const gm2 = await until(() => q.evaluate(() => { const m = document.querySelector('.ig-pop [role="menu"]'); return m ? m.textContent.replace(/\s+/g, ' ') : null; }));
|
|
@@ -313,19 +313,5 @@ const everyPart = async (pg) => { await pg.waitForSelector('#czViewer .pw-ph', {
|
|
|
313
313
|
await E.ctx.close();
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
/* G6 · New → Task opens the initiative with the cursor in the Tasks field (XtaA4NewTask) */
|
|
317
|
-
{
|
|
318
|
-
const N = await open({ layout: { by: 'stage', picked: true } }), n = N.page;
|
|
319
|
-
await n.click('[data-hm-new]');
|
|
320
|
-
await n.click('#hmMenu [data-hm-mi]:has-text("Task")').catch(() => n.click('[data-hm-mi]:has-text("Task")'));
|
|
321
|
-
// with an initiative open, Task adds there at once (batch 14 item 10); from all work it asks which initiative first
|
|
322
|
-
const pick = await n.$('#hmMenu:not([hidden]) [data-hm-mi]:has-text("Self-serve onboarding v2")');
|
|
323
|
-
if (pick && await pick.isVisible()) await pick.click();
|
|
324
|
-
ok('G6 New → A task: the page with the Tasks field open, the cursor in it', await until(() => n.evaluate(() => { const f = document.querySelector('#czViewer [data-hi-v="page"] #ivAddTask'); return !!f && document.activeElement === f; }), 15000));
|
|
325
|
-
ok('G6 no old Tasks view: no #ovTask anywhere', !(await n.$('#ovTask')));
|
|
326
|
-
await shot(n, 'new-task-1440.png');
|
|
327
|
-
ok('0 New → A task: no page error', !N.errors.length, N.errors.join(' | '));
|
|
328
|
-
await N.ctx.close();
|
|
329
|
-
}
|
|
330
316
|
finish();
|
|
331
317
|
})();
|
|
@@ -46,7 +46,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
46
46
|
const S = { errors: [] };
|
|
47
47
|
page.on('pageerror', (e) => S.errors.push(String((e && e.message) || e)));
|
|
48
48
|
await page.route('**/api/briefing-premium*', (r) => r.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ ok: true, state: 'ready', model: B.build(F.facts()), as_of: Date.now() }) }));
|
|
49
|
-
await page.goto(BASE + '/
|
|
49
|
+
await page.goto(BASE + '/today.html?theme=light');
|
|
50
50
|
S.up = await until(() => page.evaluate(() => document.querySelectorAll('#hmList .hm-r').length > 0 && !!window.czViewer), 20000);
|
|
51
51
|
await page.evaluate(() => {
|
|
52
52
|
const item = (x) => ({ id: 't:' + x, kind: 'Ticket', title: 'Item ' + x, icon: 'jira',
|
|
@@ -96,7 +96,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
96
96
|
// the trail list: hover ← on a desk
|
|
97
97
|
await page.hover('#czViewer [data-cz-vw="back"]');
|
|
98
98
|
const list = await until(() => page.evaluate(() => { const m = document.querySelector('#czViewer .cz-vw-trail'); return m ? [...m.querySelectorAll('button')].map((b) => b.textContent.trim() + (b.classList.contains('here') ? '*' : '')) : null; }), 3000);
|
|
99
|
-
ok('L hovering ← lists the trail, newest first, ending at the page it started on', JSON.stringify(list) === '["Item D*","Item B","Item A","
|
|
99
|
+
ok('L hovering ← lists the trail, newest first, ending at the page it started on', JSON.stringify(list) === '["Item D*","Item B","Item A","Today"]', JSON.stringify(list));
|
|
100
100
|
await page.click('#czViewer .cz-vw-trail [data-cz-vw-go="-2"]');
|
|
101
101
|
s = await at(page, 'Item A');
|
|
102
102
|
ok('L a press in the list jumps there, and → leads back along it', s && s.fwd === 'Forward to Item B' && JSON.stringify(s.trail.ahead) === '["Item B","Item D"]', JSON.stringify(s));
|
|
@@ -121,7 +121,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
121
121
|
ok('M one numbered list across To do, In progress, Done and the dashed Won\'t do · Archived column', M.cols.join('|') === "To do|In progress|Done|Won't do · Archived" && M.nums === '1,2,3,4,5,6,7,8,9,10' && M.todo.join() === 'Triage' && M.done.join() === '◆ Review', JSON.stringify(M));
|
|
122
122
|
ok('M Optional is dashed, Only when names its words, ◆ marks a milestone', M.opt && /Only when value over \$50k/.test(M.only), M.only);
|
|
123
123
|
ok('M Add a stage per column; every stage but Triage drags', M.adds === 3 && M.drag === 9 && M.triageDrag === null, JSON.stringify([M.adds, M.drag]));
|
|
124
|
-
ok('M the old address lands on
|
|
124
|
+
ok('M the old address lands on Today with Settings › Workspaces › Workflows open, wide; the address forgets ?settings and ?wf', M.where[0] === '/today.html' && !/settings=|wf=/.test(M.where[1]) && M.where[2] && M.where[3] && /^Workspaces/.test(M.where[4] || '') && M.where[5] === 'Workflows', JSON.stringify(M.where));
|
|
125
125
|
await shot(p, 'wf-model-1440');
|
|
126
126
|
|
|
127
127
|
/* ── S a stage in the Viewer (WfAStage) ── */
|
|
@@ -288,6 +288,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
288
288
|
const ask = await until(() => N.posts.find((x) => x.path === '/api/briefing-premium/ask'));
|
|
289
289
|
ok('N a message goes to the chat under a pop:workflow key, with the New workflow context', ask && /^pop:workflow:new-/.test(ask.body.key) && /workflow-setup skill/.test(JSON.stringify(ask.body.context || '')), JSON.stringify(ask && ask.body));
|
|
290
290
|
N.db.draft = F.draft();
|
|
291
|
+
// on Today the chat is the popup's (home-page-retire): close it, as the PM would, before going to Settings
|
|
292
|
+
if (await q.isVisible('.cz-pop')) { await q.keyboard.press('Escape'); await until(() => q.evaluate(() => !document.querySelector('.cz-pop:not([hidden])') || getComputedStyle(document.querySelector('.cz-pop')).display === 'none'), 3000); }
|
|
291
293
|
await openWf(q);
|
|
292
294
|
await until(() => q.evaluate(() => /Vendor onboarding/.test((document.querySelector('#wfList [data-wf="new"]') || {}).innerText || '')));
|
|
293
295
|
ok('N the draft waits in Settings › Workflows as its row, by its name', await q.evaluate(() => /Vendor onboarding\s*draft/.test(document.querySelector('#wfList [data-wf="new"]').innerText)));
|
|
@@ -357,7 +359,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
357
359
|
await g.click('#evSettings [data-ev-sub=""]');
|
|
358
360
|
ok('G ← goes back to Workspaces, the dialog its usual size, and the row "Workflows ›" is there', await until(() => g.evaluate(() => !document.querySelector('#evSettings #wfMain') && !document.querySelector('#evSettings').classList.contains('ev-wide') && !!document.querySelector('#evSettings [data-ev-sub="workflows"]'))));
|
|
359
361
|
await g.click('#evSettings [data-ev-sub="workflows"]');
|
|
360
|
-
ok('G the row opens the sub-panel in place, not a page', await until(() => g.evaluate(() => document.querySelectorAll('#evSettings .wf-card').length > 0 && location.pathname === '/
|
|
362
|
+
ok('G the row opens the sub-panel in place, not a page', await until(() => g.evaluate(() => document.querySelectorAll('#evSettings .wf-card').length > 0 && location.pathname === '/today.html')));
|
|
361
363
|
await g.click('#evSettings [data-ev-close]');
|
|
362
364
|
ok('G no page error in Settings', G.errors.length === 0, G.errors.join(' | '));
|
|
363
365
|
await G.ctx.close();
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
/* adler-seasons-art-test.js — Adler dressed for the season, in the real Home (feedback batch 18 item 8-B; canvas AsPlaces, AsSet2Tap).
|
|
4
|
-
* The real Home from the real server, at 390 px with touch and at 1280 px; the board and briefing are the fixtures. The page's clock is
|
|
5
|
-
* 09:30 on Deepavali (8 Nov 2026), and the calendar module (pm/cozy-seasons.js, 8-A's) is stubbed to answer Deepavali, so this suite tests
|
|
6
|
-
* 8-B's half only. POST /api/settings is recorded.
|
|
7
|
-
* Y1 Your day opens on the Deepavali scene (the charm's sky, the diya), and the greeting wishes it: "Happy Deepavali"
|
|
8
|
-
* Y2 the scene fits the sheet: no sideways scroll, and the scene is as wide as the card
|
|
9
|
-
* T1 a press on the scene says "Dressed for Deepavali." with two named icons; no toast said he dressed up
|
|
10
|
-
* T2 "Not this one" saves the calendar's setting (POST /api/settings) and the scene goes plain at once
|
|
11
|
-
* N no page error
|
|
12
|
-
* PMOS_SHOTS=<dir> also saves the screenshots. */
|
|
13
|
-
const path = require('path');
|
|
14
|
-
const fs = require('fs');
|
|
15
|
-
const { spawn } = require('child_process');
|
|
16
|
-
const { findBrowser } = require('./lib/find-browser');
|
|
17
|
-
const T = require('./test-run').configure({ name: 'adler-seasons-art' });
|
|
18
|
-
const BRP = require('./lib/briefing-premium.js');
|
|
19
|
-
const BRF = require('./fixtures/briefing-premium-facts.js');
|
|
20
|
-
const BP = require('./lib/board-premium.js');
|
|
21
|
-
const BF = require('./fixtures/board-premium-facts.js');
|
|
22
|
-
|
|
23
|
-
const BASE = T.BASE;
|
|
24
|
-
const SHOTS = process.env.PMOS_SHOTS || '';
|
|
25
|
-
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
26
|
-
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 sleep(step); } };
|
|
27
|
-
const results = [];
|
|
28
|
-
const ok = (name, cond, extra = '') => { results.push({ name, cond: !!cond }); console.log(`${cond ? '✓' : '✗'} ${name}${!cond && extra !== '' ? ' — ' + String(extra).slice(0, 600) : ''}`); };
|
|
29
|
-
let srv = null; let browser = null;
|
|
30
|
-
const finish = async (code) => {
|
|
31
|
-
if (browser) await browser.close().catch(() => {});
|
|
32
|
-
if (srv) { try { srv.kill('SIGKILL'); } catch { /* gone */ } }
|
|
33
|
-
T.killTmux();
|
|
34
|
-
const bad = results.filter((x) => !x.cond).length;
|
|
35
|
-
console.log(`\n${results.length - bad}/${results.length} adler-seasons-art assertions passed`);
|
|
36
|
-
process.exit(code !== undefined ? code : (bad ? 1 : 0));
|
|
37
|
-
};
|
|
38
|
-
process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
39
|
-
|
|
40
|
-
// 8-A's calendar, as the page imports it: Deepavali, the day itself; "Not this one" names one setting row
|
|
41
|
-
const SEASONS = `export const charmToday = () => ({ key: 'deepavali', name: 'Deepavali', until: '2026-11-10T23:59:59', today: true });
|
|
42
|
-
export const skipThisYear = (key, now) => ({ key: 'adler.dress.skip', value: key + ':' + now.getFullYear() });`;
|
|
43
|
-
|
|
44
|
-
(async () => {
|
|
45
|
-
const exe = process.env.PMOS_CHROME || findBrowser();
|
|
46
|
-
if (!exe) { console.log('✗ no Chrome/Chromium on this machine — the adler-seasons-art suite cannot run'); return finish(1); }
|
|
47
|
-
let chromium;
|
|
48
|
-
try { ({ chromium } = require('playwright-core')); } catch { console.log('✗ playwright-core is not installed'); return finish(1); }
|
|
49
|
-
srv = spawn(process.execPath, [path.join(__dirname, 'server.js')], { cwd: __dirname, stdio: 'ignore', env: T.env({ PMOS_WS_PORT: String(T.PORT) }) });
|
|
50
|
-
await T.waitForServer(BASE);
|
|
51
|
-
browser = await chromium.launch({ executablePath: exe });
|
|
52
|
-
if (SHOTS) fs.mkdirSync(SHOTS, { recursive: true });
|
|
53
|
-
const BRIEF = BRP.build(BRF.facts());
|
|
54
|
-
// a calm day: the fixture's two blocked rows would make Your day say the news plainly instead of the wish (home-day.js, concerned
|
|
55
|
-
// replaces it). The suite passed without this only while Home's reads were too slow to land before the press (page speed, 2026-10-29).
|
|
56
|
-
if (BRIEF.list && Array.isArray(BRIEF.list.rows)) BRIEF.list.rows = BRIEF.list.rows.filter((r) => r.kind !== 'blocked');
|
|
57
|
-
const BOARD = BP.build(BF.facts());
|
|
58
|
-
|
|
59
|
-
for (const [tag, vp] of [['390', { width: 390, height: 844, hasTouch: true, isMobile: true }], ['1280', { width: 1280, height: 860 }]]) {
|
|
60
|
-
const { width, height, ...rest } = vp;
|
|
61
|
-
const ctx = await browser.newContext({ viewport: { width, height }, ...rest });
|
|
62
|
-
const page = await ctx.newPage();
|
|
63
|
-
const errors = [], posts = [], toasts = [];
|
|
64
|
-
page.on('pageerror', (e) => errors.push(String(e)));
|
|
65
|
-
page.on('request', (rq) => { if (rq.method() === 'POST') posts.push({ path: new URL(rq.url()).pathname, body: rq.postData() || '' }); });
|
|
66
|
-
const json = (rq, b) => rq.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(b) });
|
|
67
|
-
await page.clock.setFixedTime(new Date(2026, 10, 8, 9, 30));
|
|
68
|
-
await page.route(/\/api\/board-premium(\?.*)?$/, (rq) => json(rq, { ok: true, state: 'ready', model: BOARD, as_of: Date.now() }));
|
|
69
|
-
await page.route(/\/api\/briefing-premium(\?.*)?$/, (rq) => json(rq, { ok: true, state: 'ready', model: BRIEF, as_of: Date.now() }));
|
|
70
|
-
await page.route('**/api/briefing-premium/**', (rq) => json(rq, { ok: true, turns: [], working: false }));
|
|
71
|
-
await page.route(/\/pm\/cozy-seasons\.js(\?.*)?$/, (rq) => rq.fulfill({ status: 200, contentType: 'text/javascript', body: SEASONS }));
|
|
72
|
-
await page.route(/\/api\/settings$/, (rq) => (rq.request().method() === 'POST' ? json(rq, { ok: true }) : rq.continue()));
|
|
73
|
-
await page.exposeFunction('__toast', (t) => toasts.push(t));
|
|
74
|
-
await page.addInitScript(() => {
|
|
75
|
-
document.addEventListener('DOMContentLoaded', () => { const t = document.getElementById('toast'); if (t) new MutationObserver(() => { if (t.classList.contains('on')) window.__toast(t.textContent); }).observe(t, { attributes: true }); });
|
|
76
|
-
});
|
|
77
|
-
await page.goto(BASE + '/premium.html');
|
|
78
|
-
await until(() => page.evaluate(() => !!document.querySelector('#hmList [data-hm-day]')), 30000);
|
|
79
|
-
// the calendar answers once Settings > Adler is read (cozy-nav's loadPrefs); wait for the charm before opening the day
|
|
80
|
-
await until(() => page.evaluate(() => import('/pm/cozy-adler.js').then((A) => !!A.dress())), 15000);
|
|
81
|
-
|
|
82
|
-
/* Y1-Y2 */
|
|
83
|
-
await page.click('#hmList [data-hm-day]');
|
|
84
|
-
const y1 = await until(() => page.evaluate(() => {
|
|
85
|
-
const b = document.querySelector('#czViewer .yd-open'); const sc = b && b.querySelector('.yd-scene svg.ad-scene');
|
|
86
|
-
if (!sc) return null;
|
|
87
|
-
const r = sc.getBoundingClientRect(), card = b.getBoundingClientRect();
|
|
88
|
-
return { charm: sc.classList.contains('ch-deepavali'), sky: !!sc.querySelector('.adg-deepavali0'), diya: !!sc.querySelector('image[href$="/diya.png"]'), line: b.querySelector('.yd-ht b').textContent,
|
|
89
|
-
w: Math.round(r.width), cw: Math.round(card.width), h: Math.round(r.height), scroll: document.documentElement.scrollWidth - innerWidth };
|
|
90
|
-
}), 15000);
|
|
91
|
-
ok(`Y1 ${tag} Your day opens on the Deepavali scene with the diya, and wishes it`, y1 && y1.charm && y1.sky && y1.diya && /^Happy Deepavali\b/.test(y1.line), JSON.stringify(y1));
|
|
92
|
-
ok(`Y2 ${tag} the scene fills the card's width, keeps its height, and nothing scrolls sideways`, y1 && y1.w >= y1.cw - 2 && y1.h > 60 && y1.h <= 152 && y1.scroll <= 0, JSON.stringify(y1));
|
|
93
|
-
if (SHOTS) { await sleep(400); await page.screenshot({ path: path.join(SHOTS, `day-deepavali-${tag}.png`) }); }
|
|
94
|
-
|
|
95
|
-
/* T1-T2 */
|
|
96
|
-
await page.click('#czViewer .yd-scene[data-ad-dress]');
|
|
97
|
-
const t1 = await until(() => page.evaluate(() => { const t = document.querySelector('#czViewer .ad-tip'); return t ? { text: t.querySelector('.ad-tip-t').textContent, icons: [...t.querySelectorAll('button')].map((b) => b.getAttribute('aria-label')) } : null; }));
|
|
98
|
-
ok(`T1 ${tag} a press says "Dressed for Deepavali." with "Not this one" and Dress for the day; no toast said he dressed`, t1 && t1.text === 'Dressed for Deepavali.' && t1.icons.length === 2 && /^Not this one/.test(t1.icons[0]) && !toasts.some((x) => /Deepavali|dress/i.test(x)), JSON.stringify({ t1, toasts }));
|
|
99
|
-
if (SHOTS) await page.screenshot({ path: path.join(SHOTS, `tap-${tag}.png`) });
|
|
100
|
-
// CI diagnostics (the press has timed out there with the tip detached and "not stable"): count how often Your day is drawn again after the tip opened
|
|
101
|
-
await page.evaluate(() => { window.__redraws = 0; const v = document.getElementById('czViewer'); new MutationObserver((ms) => { for (const m of ms) if ([...m.removedNodes].some((x) => x.nodeType === 1 && (x.matches('.ad-tip') || x.querySelector('.ad-tip')))) window.__redraws++; }).observe(v, { childList: true, subtree: true }); });
|
|
102
|
-
try { await page.click('#czViewer .ad-tip [data-ad-tip="skip"]', { timeout: 8000 }); }
|
|
103
|
-
catch (e) {
|
|
104
|
-
const d = await page.evaluate(() => ({ redraws: window.__redraws, tip: !!document.querySelector('.ad-tip'), btn: (() => { const b = document.querySelector('.ad-tip [data-ad-tip="skip"]'); if (!b) return null; const r = b.getBoundingClientRect(); return [r.x, r.y, r.width, r.height].map(Math.round); })(), imgs: document.querySelectorAll('#czViewer image').length }));
|
|
105
|
-
console.log(' ! T1 press needed the fallback: ' + JSON.stringify(d));
|
|
106
|
-
await page.evaluate(() => { const b = document.querySelector('.ad-tip [data-ad-tip="skip"]'); if (b) b.click(); });
|
|
107
|
-
}
|
|
108
|
-
const t2 = await until(() => page.evaluate(() => { const b = document.querySelector('#czViewer .yd-open'); return b && !b.querySelector('.ch-deepavali') && !b.querySelector('.ad-tip') ? { plain: true, btn: !!b.querySelector('[data-ad-dress]') } : null; }));
|
|
109
|
-
const saved = posts.find((p) => p.path === '/api/settings');
|
|
110
|
-
ok(`T2 ${tag} "Not this one" saves the calendar's setting, and he is plain at once`, t2 && !t2.btn && saved && JSON.parse(saved.body).key === 'adler.dress.skip' && JSON.parse(saved.body).value === 'deepavali:2026', JSON.stringify({ t2, saved }));
|
|
111
|
-
|
|
112
|
-
ok(`N ${tag} no page error`, !errors.length, JSON.stringify(errors));
|
|
113
|
-
await ctx.close();
|
|
114
|
-
}
|
|
115
|
-
return finish();
|
|
116
|
-
})();
|