create-pmos 0.539.0 → 0.540.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 +26 -14
- 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/changelog.json +25 -0
- package/workspace/guide/agent-capabilities.md +2 -0
- package/workspace/guide/settings.md +1 -1
- package/workspace/guide/today.md +8 -4
- package/workspace/guide/workflows.md +14 -12
- package/workspace/ini-workflow-test.js +1 -1
- package/workspace/lib/ai-cli.js +12 -1
- package/workspace/lib/headless.js +75 -1
- package/workspace/lib/job-graph.js +2 -0
- package/workspace/lib/run-tokens.js +70 -0
- package/workspace/lib/today-cli.js +57 -4
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
- package/workspace/public/pm/cozy-news.js +1 -1
- package/workspace/public/pm/cozy-onboard.js +2 -2
- package/workspace/public/pm/cozy-settings.js +42 -11
- package/workspace/public/pm/home-app.js +10 -1
- package/workspace/public/pm/ini-wf.js +3 -3
- package/workspace/public/pm/wf-page.css +26 -15
- package/workspace/public/pm/wf-page.js +96 -72
- package/workspace/public/premium-workflows.html +8 -23
- package/workspace/server.js +7 -2
- package/workspace/workflows-setup-test.js +50 -50
package/workspace/server.js
CHANGED
|
@@ -4612,11 +4612,14 @@ function startHeadless(base, workdir, kind, launchArgs, env, initialInput, addDi
|
|
|
4612
4612
|
const prompt = safeFirstInput(String(initialInput).replace(/\r+$/, ''));
|
|
4613
4613
|
// report-design-studio: writePaths names the one render file a report-design run may write; for a skill run, the folders it may write in (lib/headless.js ignores it for every other kind).
|
|
4614
4614
|
// A kind that reads the PM's sources gets the read-shaped connector tools of this login (lib/headless.js CONNECTOR_READ_KINDS).
|
|
4615
|
-
|
|
4615
|
+
// Lean launch (lib/headless.js LEAN LAUNCH): the PM's user settings no longer load, so their model is passed when no tier chose one.
|
|
4616
|
+
const lean = headlessLib.leanOf(kind, env);
|
|
4617
|
+
if (lean && !launchArgs.includes('--model')) { const m = headlessLib.userModelOf(env); if (m) launchArgs = ['--model', m, ...launchArgs]; }
|
|
4618
|
+
const args = headlessLib.argsFor(kind, { lean, modelArgs: launchArgs, addDirs: Array.isArray(addDirs) ? addDirs : [], writePaths: Array.isArray(writePaths) ? writePaths : [],
|
|
4616
4619
|
budgetUsd: !env ? null : kind === 'grill' ? env.PMOS_GRILL_BUDGET : kind === 'lab-proto' || kind === 'lab-scan' ? env.PMOS_LAB_BUDGET : null,
|
|
4617
4620
|
connectorTools: headlessLib.CONNECTOR_READ_KINDS.includes(kind) ? knownConnectorTools(env) : [],
|
|
4618
4621
|
team: kind === 'team' && env ? { role: env.PMOS_TEAM_ROLE, mode: env.PMOS_TEAM_MODE } : null });
|
|
4619
|
-
const s = { ...base, cwd: workdir, state: 'working', pty: null, tmux: null, headless: kind, child: null,
|
|
4622
|
+
const s = { ...base, cwd: workdir, state: 'working', pty: null, tmux: null, headless: kind, child: null, ...(lean ? { lean: true } : {}),
|
|
4620
4623
|
note: '', buf: '', cols: 80, rows: 24, clients: new Set(), created: nowISO(), lastOutputAt: Date.now() };
|
|
4621
4624
|
const say = (text) => {
|
|
4622
4625
|
const d = String(text).replace(/\r?\n/g, '\r\n');
|
|
@@ -4684,6 +4687,8 @@ function startHeadless(base, workdir, kind, launchArgs, env, initialInput, addDi
|
|
|
4684
4687
|
if (s.scratchDir) { try { fs.rmSync(s.scratchDir, { recursive: true, force: true }); } catch { /* the temp folder goes with the next clean-up */ } }
|
|
4685
4688
|
if (part) { feed(part); part = ''; }
|
|
4686
4689
|
const r = headlessLib.parseResult(resultLine || out);
|
|
4690
|
+
// The token log (lib/run-tokens.js): one line per finished run, for `pmos ai status`.
|
|
4691
|
+
require('./lib/run-tokens.js').record(STATE, { kind, origin: s.origin, lean, result: { ...r, ...headlessLib.usageOf(resultLine || out) }, ok: code === 0 && r.ok && !r.isError });
|
|
4687
4692
|
if (r.ok) say('\n' + headlessLib.logLines(r, code).join('\n') + '\n');
|
|
4688
4693
|
else if (out.trim() && !resultLine) say(r.text.split('\n').slice(-20).join('\n') + '\n');
|
|
4689
4694
|
if (err.trim()) say(dim(err.trim().split('\n').slice(-20).join('\n')) + '\n');
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
/* workflows-setup-test.js — Settings › Workflows (D99; canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft).
|
|
4
|
-
*
|
|
3
|
+
/* workflows-setup-test.js — Settings › Workflows (D99; canvas WfAModel, WfAStage, WfACond, WfARemove, WfANew, WfADraft). A sub-panel of
|
|
4
|
+
* Settings › Workspaces since UI grill U1: the old address /premium-workflows.html redirects to Home with ?settings=workflows, and Home
|
|
5
|
+
* opens Settings on it. Serves the real pages from the real server; /api/workflows and its writes answer from an in-memory list (fixtures/workflows-facts.js), so every press is captured.
|
|
5
6
|
* M the list and the picked workflow: counts, one numbered list across To do / In progress / Done, Optional and Only-when pills, ◆,
|
|
6
7
|
* the dashed Won't do · Archived column; Product feature is read-only with Copy
|
|
7
8
|
* S a stage opens in the Viewer: its name is the title (rename), category, output kind, template, To finish, Then with the fallback, Unless,
|
|
8
9
|
* Milestone, Moves on by itself; each change saves the whole workflow
|
|
9
10
|
* C Only when: plain words, How it reads today from the Board rows, Who decides; Save writes the condition
|
|
10
11
|
* D drag a stage into another column; A add a stage; R remove a stage in use asks where its initiatives go; W rename the workflow
|
|
11
|
-
* N New workflow:
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* N New workflow: + closes Settings and opens Home's own chat scoped "New workflow" (no second chat column); the draft waits as the
|
|
13
|
+
* list's draft row and shows in the Viewer; Create workflow, Edit by hand; blank or from a copy under the list
|
|
14
|
+
* P a phone: the list is the panel, a workflow opens with ←, the columns stack
|
|
15
|
+
* G Settings › Workspaces has a Workflows row that opens the sub-panel; ← goes back to Workspaces
|
|
14
16
|
* WF_SHOTS=<dir> also writes the screenshots at 1440 and 390. */
|
|
15
17
|
const fs = require('fs');
|
|
16
18
|
const path = require('path');
|
|
@@ -82,9 +84,16 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
82
84
|
await page.route('**/api/board-premium*', (r) => json(r, { ok: true, state: 'ready', model: { rows: F.rows() } }));
|
|
83
85
|
await page.route('**/api/briefing-premium/thread*', (r) => json(r, { ok: true, title: '', subject: '', turns: [], session: null, history: { messages: [] } }));
|
|
84
86
|
await page.route('**/api/briefing-premium/ask*', (r) => { posts.push({ path: '/api/briefing-premium/ask', body: JSON.parse(r.request().postData() || '{}') }); return json(r, { ok: true, session: 's1', started: true }); });
|
|
85
|
-
await page.goto(BASE + '/premium-workflows.html' + qs);
|
|
87
|
+
await page.goto(BASE + '/premium-workflows.html' + qs); // redirects to Home, which opens Settings › Workspaces › Workflows
|
|
88
|
+
await page.waitForSelector('#evSettings #wfMain', { timeout: 15000 }).catch(() => {});
|
|
86
89
|
return { page, ctx: c, errors, posts, db };
|
|
87
90
|
};
|
|
91
|
+
// Settings › Workspaces › Workflows the PM's way: the menu, Settings, Workspaces, the Workflows row
|
|
92
|
+
const openWf = async (pg) => {
|
|
93
|
+
await pg.click('#czFab'); await pg.click('[data-cz-settings]');
|
|
94
|
+
await pg.click('#evSettings [data-ev-sec="workspaces"]'); await pg.click('#evSettings [data-ev-sub="workflows"]');
|
|
95
|
+
await pg.waitForSelector('#evSettings #wfMain', { timeout: 8000 }).catch(() => {});
|
|
96
|
+
};
|
|
88
97
|
const shot = async (p, name) => { if (SHOTS) await p.screenshot({ path: path.join(SHOTS, name + '.png') }); };
|
|
89
98
|
const saves = (posts) => posts.filter((x) => x.path === '/api/workflows/save');
|
|
90
99
|
const lastWf = (posts) => { const s = saves(posts); return s.length ? s[s.length - 1].body.wf : null; };
|
|
@@ -105,14 +114,14 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
105
114
|
opt: !!document.querySelector('.wf-card.opt .wf-pill.dash'), only: (document.querySelector('.wf-pill.y') || {}).textContent || '',
|
|
106
115
|
adds: document.querySelectorAll('[data-add]').length, drag: document.querySelectorAll('.wf-card[draggable="true"]').length,
|
|
107
116
|
triageDrag: document.querySelector('.wf-card[data-stage="triage"]').getAttribute('draggable'),
|
|
108
|
-
|
|
117
|
+
where: [location.pathname, location.search, !document.querySelector('#evSettings').hidden, document.querySelector('#evSettings').classList.contains('ev-wide'), (document.querySelector('#evSettings [aria-current="page"]') || {}).textContent, (document.querySelector('#evSettings .ev-dr-hd h4') || {}).textContent],
|
|
109
118
|
}));
|
|
110
119
|
ok('M the list names each workflow with its count; Tender is picked', M.rows.join('|') === 'Product feature:12|Tender:4|Procurement:3|Migration:2' && M.sel === 'Tender', JSON.stringify(M.rows));
|
|
111
120
|
ok('M the header: the name, "10 stages · used by 4 initiatives"', M.title === 'Tender' && M.meta === '10 stages · used by 4 initiatives', JSON.stringify([M.title, M.meta]));
|
|
112
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));
|
|
113
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);
|
|
114
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]));
|
|
115
|
-
ok('M the
|
|
124
|
+
ok('M the old address lands on Home with Settings › Workspaces › Workflows open, wide; the address forgets ?settings and ?wf', M.where[0] === '/premium.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));
|
|
116
125
|
await shot(p, 'wf-model-1440');
|
|
117
126
|
|
|
118
127
|
/* ── S a stage in the Viewer (WfAStage) ── */
|
|
@@ -126,7 +135,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
126
135
|
unless: (b.querySelector('[data-st-ut]') || {}).value, uto: (b.querySelector('[data-st-uto]') || {}).value, ms: b.querySelector('[data-st-sw="milestone"]').getAttribute('aria-checked'), auto: b.querySelector('[data-st-sw="auto"]').getAttribute('aria-checked'),
|
|
127
136
|
rn: !!document.querySelector('#czViewer [data-cz-vw-rn]'), cols: getComputedStyle(b.querySelector('.wf-sgrid')).gridTemplateColumns.split(' ').length };
|
|
128
137
|
});
|
|
129
|
-
ok('S the stage opens in the Viewer, its name the title and the rename press: "Tender · stage 6 of 10"', v && S1.rn && S1.lbl === 'Tender · stage 6 of 10' && v.w >=
|
|
138
|
+
ok('S the stage opens in the Viewer, its name the title and the rename press: "Tender · stage 6 of 10"', v && S1.rn && S1.lbl === 'Tender · stage 6 of 10' && v.w >= 640, JSON.stringify([S1.lbl, v && v.w])); // inside Settings: the room beside the workflow
|
|
130
139
|
ok('S two columns: category, output kind, template, To finish; When it runs, Then, Unless, Milestone, Moves on by itself', S1.cols === 2 && S1.cat.join() === 'In progress' && S1.kind.join() === 'Document' && S1.when.join() === 'Always' && S1.tpl === 'Bid scoring sheet'
|
|
131
140
|
&& S1.fin.length === 2 && S1.then === '' && S1.unless === 'no bid scores above 60' && S1.uto === 'bids' && S1.ms === 'false' && S1.auto === 'true', JSON.stringify(S1));
|
|
132
141
|
ok('S Then shows the fallback when the next stage runs only sometimes', /Legal review runs only when its condition holds; otherwise it goes on to 8 · ◆ Award/.test(S1.note), S1.note);
|
|
@@ -196,7 +205,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
196
205
|
|
|
197
206
|
/* ── D drag a stage into another column ── */
|
|
198
207
|
await p.click('#czViewer [data-cz-vw="close"], #czViewer [aria-label="Close"]').catch(() => {});
|
|
199
|
-
await p.keyboard.press('Escape');
|
|
208
|
+
if (await viewer(p)) await p.keyboard.press('Escape'); // with no stage open, Escape would close Settings
|
|
200
209
|
await until(() => viewer(p).then((x) => !x));
|
|
201
210
|
const n1 = saves(D.posts).length;
|
|
202
211
|
await p.dragAndDrop('.wf-card[data-stage="contract"]', '.wf-drop[data-cat="done"]', { targetPosition: { x: 40, y: 4 } });
|
|
@@ -236,7 +245,8 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
236
245
|
await R.ctx.close();
|
|
237
246
|
|
|
238
247
|
/* ── W rename the workflow (RnA*) and ⋯ ── */
|
|
239
|
-
await p.keyboard.press('Escape'); await until(() => viewer(p).then((x) => !x));
|
|
248
|
+
if (await viewer(p)) { await p.keyboard.press('Escape'); await until(() => viewer(p).then((x) => !x)); }
|
|
249
|
+
ok('W Escape closed the stage first; Settings stays open', await p.evaluate(() => !document.querySelector('#evSettings').hidden));
|
|
240
250
|
await p.click('[data-wf-rn]');
|
|
241
251
|
await p.fill('#wfName', 'Public tender');
|
|
242
252
|
await p.press('#wfName', 'Enter');
|
|
@@ -264,50 +274,38 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
264
274
|
ok('M no page error on the editor', D.errors.length === 0, D.errors.join(' | '));
|
|
265
275
|
await D.ctx.close();
|
|
266
276
|
|
|
267
|
-
/* ── N New workflow (WfANew, WfADraft) ── */
|
|
277
|
+
/* ── N New workflow (WfANew, WfADraft): Home's own chat, the draft in Settings ── */
|
|
268
278
|
const N = await open({ qs: '' });
|
|
269
279
|
const q = N.page;
|
|
270
280
|
await until(() => q.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 4));
|
|
281
|
+
ok('N blank and from a copy sit under the list', await q.evaluate(() => /Or start one blank or from a copy/.test(document.querySelector('#wfList').innerText)));
|
|
271
282
|
await q.click('[data-wf-new]');
|
|
272
|
-
const NW = await until(() => q.evaluate(() => { const c = document.querySelector('#
|
|
273
|
-
ok('N + opens
|
|
283
|
+
const NW = await until(() => q.evaluate(() => { const c = document.querySelector('#hmChat') || document.querySelector('.hm-chat'); if (!c) return null; return { text: c.innerText, scope: (document.querySelector('.hm-chip') || {}).textContent || '', settings: !document.querySelector('#evSettings').hidden, second: !!document.querySelector('#wfChat') }; }).then((x) => (x && /Tell me how this work goes/.test(x.text) ? x : null)));
|
|
284
|
+
ok('N + closes Settings and opens Home\'s own chat scoped "New workflow", with the opening ask; no second chat column', NW && !NW.settings && /New workflow/.test(NW.scope) && !NW.second, JSON.stringify(NW));
|
|
274
285
|
await shot(q, 'wf-new-1440');
|
|
275
|
-
|
|
276
|
-
const geo = () => q.evaluate(() => {
|
|
277
|
-
const r = (e) => e.getBoundingClientRect(), c = document.querySelector('#wfChat');
|
|
278
|
-
const btns = [...c.querySelectorAll('#hmFoot button, #hmFoot .hm-scope, #hmFoot [class*="chip"]')].filter((b) => r(b).width > 0).map(r);
|
|
279
|
-
const hit = btns.some((a, i) => btns.some((b, j) => j > i && a.left < b.right - 1 && b.left < a.right - 1 && a.top < b.bottom - 1 && b.top < a.bottom - 1));
|
|
280
|
-
return { main: getComputedStyle(document.querySelector('#wfMain')).display, w: Math.round(r(c).width), hit, out: btns.some((b) => b.right > r(c).right + 1) };
|
|
281
|
-
});
|
|
282
|
-
const G1 = await geo();
|
|
283
|
-
ok('N the workflow is gone while New workflow shows; the chat has the column; the composer buttons do not overlap', G1.main === 'none' && G1.w >= 400 && !G1.hit && !G1.out, JSON.stringify(G1));
|
|
284
|
-
await q.fill('#wfChatIn textarea', 'We onboard a new supplier. Procurement checks the contract and the insurance first.');
|
|
286
|
+
await q.fill('#hmIn', 'We onboard a new supplier. Procurement checks the contract and the insurance first.');
|
|
285
287
|
await q.keyboard.press('Enter');
|
|
286
288
|
const ask = await until(() => N.posts.find((x) => x.path === '/api/briefing-premium/ask'));
|
|
287
|
-
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) &&
|
|
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));
|
|
288
290
|
N.db.draft = F.draft();
|
|
291
|
+
await openWf(q);
|
|
292
|
+
await until(() => q.evaluate(() => /Vendor onboarding/.test((document.querySelector('#wfList [data-wf="new"]') || {}).innerText || '')));
|
|
293
|
+
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)));
|
|
294
|
+
await q.click('#wfList [data-wf="new"]');
|
|
289
295
|
v = await until(() => viewer(q).then((x) => (x && x.title === 'Vendor onboarding' ? x : null)), 8000);
|
|
290
296
|
ok('N the draft shows in the Viewer as numbered stages per category, with Create workflow and Edit by hand', v && /To do\s*1\s*Triage/.test(v.text) && /In progress/.test(v.text) && /3\s*Security review/.test(v.text) && /Only when they touch customer data/.test(v.text) && /Done\s*6\s*◆ 90-day review/.test(v.text) && /Create workflow/.test(v.text) && /Edit by hand/.test(v.text), v && v.text);
|
|
291
|
-
ok('N the
|
|
297
|
+
ok('N beside it, the way back to its chat', await q.evaluate(() => !!document.querySelector('#wfMain [data-wf-new]') && /Continue in the chat/.test(document.querySelector('#wfMain').innerText)));
|
|
292
298
|
await shot(q, 'wf-draft-1440');
|
|
293
|
-
const G2 = await geo();
|
|
294
|
-
ok('N with the draft open beside it, the chat keeps a usable column and the composer does not overlap', G2.main === 'none' && G2.w >= 360 && !G2.hit && !G2.out, JSON.stringify(G2));
|
|
295
|
-
await q.setViewportSize({ width: 1180, height: 820 });
|
|
296
|
-
await q.waitForTimeout(200);
|
|
297
|
-
const G3 = await geo();
|
|
298
|
-
ok('N at 1180 wide with the draft open, the composer still does not overlap', G3.main === 'none' && G3.w >= 300 && !G3.hit && !G3.out, JSON.stringify(G3));
|
|
299
|
-
await shot(q, 'wf-draft-1180');
|
|
300
|
-
await q.setViewportSize({ width: 1440, height: 900 });
|
|
301
299
|
await q.click('#czViewer [data-wf-dcreate]');
|
|
302
300
|
await until(() => saves(N.posts).length);
|
|
303
301
|
const cw = lastWf(N.posts);
|
|
304
|
-
ok('N Create workflow saves the draft and opens it', cw && cw.id === 'vendor-onboarding' && cw.stages.length === 6 && await until(() => q.evaluate(() => (document.querySelector('.wf-h1') || {}).textContent === 'Vendor onboarding'
|
|
305
|
-
ok('N the next New workflow starts a new conversation', await q.evaluate(() => !localStorage.getItem('pmos.wf.chat')));
|
|
302
|
+
ok('N Create workflow saves the draft and opens it', cw && cw.id === 'vendor-onboarding' && cw.stages.length === 6 && await until(() => q.evaluate(() => (document.querySelector('.wf-h1') || {}).textContent === 'Vendor onboarding')), JSON.stringify(cw && cw.id));
|
|
303
|
+
ok('N the next New workflow starts a new conversation', await until(() => q.evaluate(() => !localStorage.getItem('pmos.wf.chat'))), await q.evaluate(() => localStorage.getItem('pmos.wf.chat')));
|
|
306
304
|
await N.ctx.close();
|
|
307
305
|
|
|
308
306
|
const E2 = await open({ qs: '', draft: F.draft() });
|
|
309
|
-
await until(() => E2.page.evaluate(() => document.querySelectorAll('#wfList .wfl').length ===
|
|
310
|
-
await E2.page.click('[data-wf
|
|
307
|
+
await until(() => E2.page.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 5));
|
|
308
|
+
await E2.page.click('#wfList [data-wf="new"]');
|
|
311
309
|
await until(() => viewer(E2.page).then((x) => x && x.title === 'Vendor onboarding'));
|
|
312
310
|
await E2.page.click('#czViewer [data-wf-dedit]');
|
|
313
311
|
await until(() => E2.page.evaluate(() => document.querySelectorAll('.wf-card').length === 6));
|
|
@@ -316,15 +314,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
316
314
|
await until(() => E2.posts.some((x) => x.path === '/api/workflows/draft'));
|
|
317
315
|
ok('N an edit by hand saves to the draft, not to the workflows', saves(E2.posts).length === 0 && E2.posts.find((x) => x.path === '/api/workflows/draft').body.draft.stages.length === 7);
|
|
318
316
|
await until(() => E2.page.evaluate(() => !!document.querySelector('#czViewer .cz-vw-ren input')));
|
|
319
|
-
await E2.page.keyboard.press('Escape');
|
|
317
|
+
await E2.page.keyboard.press('Escape'); // the name field first, then the stage; with no stage open, Escape would close Settings
|
|
318
|
+
await until(() => E2.page.evaluate(() => !document.querySelector('#czViewer .cz-vw-ren input')), 2000);
|
|
319
|
+
if (await viewer(E2.page)) await E2.page.keyboard.press('Escape');
|
|
320
320
|
await until(() => viewer(E2.page).then((x) => !x), 2000);
|
|
321
321
|
await E2.page.click('[data-wf-create]');
|
|
322
322
|
await until(() => saves(E2.posts).length);
|
|
323
323
|
ok('N Create workflow from the editor saves it', lastWf(E2.posts).id === 'vendor-onboarding' && lastWf(E2.posts).stages.length === 7);
|
|
324
|
-
await E2.page.click('[data-wf-new]');
|
|
325
|
-
await until(() => E2.page.evaluate(() => !!document.querySelector('[data-wf-blank]')));
|
|
326
324
|
const nb = saves(E2.posts).length;
|
|
327
|
-
await E2.page.click('[data-wf-blank]');
|
|
325
|
+
await E2.page.click('#wfList [data-wf-blank]');
|
|
328
326
|
await until(() => saves(E2.posts).length > nb);
|
|
329
327
|
ok('N Start blank makes a workflow with only Triage and opens its name field', lastWf(E2.posts).stages.length === 1 && lastWf(E2.posts).stages[0].key === 'triage' && await until(() => E2.page.evaluate(() => !!document.querySelector('#wfName'))));
|
|
330
328
|
ok('N no page error in New workflow', N.errors.length === 0 && E2.errors.length === 0, N.errors.concat(E2.errors).join(' | '));
|
|
@@ -335,7 +333,7 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
335
333
|
const r = P.page;
|
|
336
334
|
await until(() => r.evaluate(() => document.querySelectorAll('#wfList .wfl').length === 4));
|
|
337
335
|
const P1 = await r.evaluate(() => ({ list: getComputedStyle(document.querySelector('#wfList')).display, main: getComputedStyle(document.querySelector('#wfMain')).display, sw: document.documentElement.scrollWidth }));
|
|
338
|
-
ok('P on a phone the list is the
|
|
336
|
+
ok('P on a phone the list is the panel', P1.list !== 'none' && P1.main === 'none' && P1.sw <= 390, JSON.stringify(P1));
|
|
339
337
|
await shot(r, 'wf-list-390');
|
|
340
338
|
await r.click('#wfList [data-wf="tender"]');
|
|
341
339
|
await until(() => r.evaluate(() => document.querySelectorAll('.wf-card').length === 10));
|
|
@@ -353,13 +351,15 @@ process.on('unhandledRejection', (e) => { console.error(e); finish(1); });
|
|
|
353
351
|
await P.ctx.close();
|
|
354
352
|
if (SHOTS) { const K = await open({ dark: true }); await until(() => K.page.evaluate(() => document.querySelectorAll('.wf-card').length === 10)); await K.page.evaluate(() => { document.documentElement.dataset.theme = 'dark'; }); await shot(K.page, 'wf-model-1440-dark'); await K.ctx.close(); }
|
|
355
353
|
|
|
356
|
-
/* ── G Settings › Workflows ── */
|
|
357
|
-
const G = await open();
|
|
358
|
-
|
|
359
|
-
await
|
|
360
|
-
await
|
|
361
|
-
|
|
362
|
-
ok('G
|
|
354
|
+
/* ── G Settings › Workspaces › Workflows ── */
|
|
355
|
+
const G = await open({ qs: '' });
|
|
356
|
+
const g = G.page;
|
|
357
|
+
await g.click('#evSettings [data-ev-sub=""]');
|
|
358
|
+
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
|
+
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 === '/premium.html')));
|
|
361
|
+
await g.click('#evSettings [data-ev-close]');
|
|
362
|
+
ok('G no page error in Settings', G.errors.length === 0, G.errors.join(' | '));
|
|
363
363
|
await G.ctx.close();
|
|
364
364
|
finish();
|
|
365
365
|
})();
|