Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Sections dated before 2026-09-19 predate the cycle and stay as they are. Named m
`docs/RELEASE-PROCESS.md` §8.

## Unreleased
- fix(page-audit): **one DataGrid2 counts as one list**: `DOM_PROBE`'s `[class*="widget-datagrid"]` was a substring match, so one grid counted as nine lists (its root plus -content, -grid, -grid-head, -grid-body, -footer, -paging-bottom, -pb-start, -pb-end), and `live/empty-list-message` reported "9 lists on screen; 4 empty", a P1 FAIL with four `(unnamed)` findings, on a grid showing 20 rows. It now matches the `.widget-datagrid` class token. Golden input: a CDP MHTML capture of a live Mendix 11.8 DataGrid2 3.5.0 page. Field run on that app: "9 lists; 4 empty" → "1 lists on screen; 0 empty", page verdicts 20 pass / 6 fail → 21 / 5 (the five left are real static findings). — runtime field run on a live Mendix 11.8 app
- fix(e2e helpers): **`fullPageShot` captures the whole page when an inner container scrolls**: on Mendix 11.8, Atlas_SideBar and Atlas_TopBar keep the document viewport-tall and scroll `.mx-scrollcontainer-center`, so `fullPage: true` stopped at the viewport and the lower rows and paging bar were never in LOOK evidence. The page's scroll root is the outermost scroller that hides content and spans at least half the viewport; the viewport is grown by its hidden height for the shot (width unchanged) and restored, and only if that same element grew with the window (a fixed-height grid body does not, so it falls back to plain `fullPage` instead of a mostly blank 4196 px shot, review of #825); `complete` is that element's own leftover scroll; the call now returns a record (`scrollRoot`, `contentPx`, `capturedPx`, `complete`, `error`) instead of swallowing a failed shot, and retries a transient Chromium "Unable to capture screenshot" once. Atlas_Default, which scrolls the document, keeps plain `fullPage`. Golden input: CDP MHTML captures of both layouts. Field run on a live 11.8 app via `full-app-walkthrough.js`: `act-see-sidebar` 1440×900 → 1440×1244, `act-see-topbar` 900 → 1239, `act-raise` (Atlas_Default) 1278 unchanged (#812). — inbox sweep #811 (UI measurement field drop), runtime field run on a live Mendix 11.8 app
- fix(journey-runner): **`ui.no5xx` no longer FAILs a step on Mendix validation feedback**: a refused save answers HTTP 551 with a `{"datavalidation":[…]}` body, and the opt-in row counted it as a server error, so every negative-path step that proved a business rule with `no5xx: true` read FAIL. The row now reads a 551's body (`helpers.isValidationFeedback`) and keeps a datavalidation answer as a note on the row; a 500, and a 551 with any other or an unreadable body, still FAIL. Golden input: the captured 551 of a live Mendix 11.8.0 runtime (`tests/wave2/fixtures/runtime-mx118/`). Field run on that app, empty-title journey: `PASS 5 FAIL 1` → `PASS 6 FAIL 0`, happy path `PASS 10` unchanged (#818). — #814's independent review (report), runtime field run on a live Mendix 11.8 app
- new(doctor, bug ledger): **a guard for mxcli's silent MxBuild fallback**: when the project's Mendix version is not in `~/.mxcli/mxbuild/` (and no Studio Pro of that version exists), `mxcli docker build` / `docker check` fall back to the newest cached MxBuild and print its path but no version warning (`run --local` is exact-or-refuse); `bin/doctor.sh` now warns, naming the model version, the cached ones and `./mxcli setup mxbuild -p <app>.mpr` (`mxtk_mxbuild_cache_gap`, warning only, never changes a gate). Ledger entry `BUG-DRAFT-mxbuild-silent-version-fallback`; upstream issue not filed. — a four-app Mendix build (field run), independent review
- fix(gate-check): **a fresh clone no longer FAILs Stage 3 as "stale render"**: `blueprint.html` / `process-map.html` freshness used `[ render -ot source ]`, a nanosecond mtime compare, and a checkout stamps files in directory order (`process-map.html` lands before `process-model.json`), so an unedited project read stale on every clone (reproduced: 200-wireframe checkout, 10 of 10 clones). New `bin/lib/render-fresh.sh` keeps `-ot` as the first test (a pass never flips, no git call) and, only where `-ot` would FAIL, asks git once per render (one `log`, one `status`) whether the source was committed after the render's commit; measured 0.19 s for 200 sources all `-ot`-stale on a 300-commit history (a per-source git version cost 12.9 s). Limit: a depth-1 clone cannot see a genuinely stale render. Field run: a four-app Mendix build checked out on a second machine. — a four-app Mendix build (field run), independent review
- fix(test-stack-up, e2e-harness-base): **the app port follows the app's configured port, and a multi-app start is no longer pinned to 8080**: with no `APP_PORTS`, `test-stack-up.sh` puts `RUN_LOCAL_APP_PORT`, then `APP_PORT` from the `.docker/.env` beside the `.mpr` (`apps/<App>/.docker/.env`; the project-root one as fallback) first, ahead of the old fixed `8080 8081 8084` tail. A fresh `run --local` start for a model under `apps/` with no handshake and no configured port used to fall back to 8080 for every app (`--app-port 8080`); it now exits 4 naming `RUN_LOCAL_APP_PORT`. `e2e-harness-base.md` states that a PAD/Docker runtime listens on 8080 *inside* the container only. Fixtures T28–T32 added. Field run: a four-app Mendix build on 8081–8084 whose fresh start failed with every app pinned to 8080. — a four-app Mendix build (field run), independent review
Expand Down
105 changes: 103 additions & 2 deletions project-tests/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,109 @@ async function screenshotEl(page, selector, file) {
return true;
}

// A full-height shot (#812). `fullPage: true` measures the DOCUMENT, and Atlas_SideBar /
// Atlas_TopBar (mx 11.8) scroll an inner `.mx-scrollcontainer-center` inside a viewport-tall
// document: measured 1244 px of content behind a 900 px document, shot cut at 900. Atlas_Default
// scrolls the document, and that shape keeps the plain fullPage path. When an element scrolls,
// the viewport is grown by its hidden height (width unchanged, so no breakpoint moves), the shot
// is taken, and the viewport is restored. Returns a record, never a bare boolean: `complete` is
// false when the capture still came up short, so a cropped shot says so on its own record.
const SHOT_MAX_PX = 16000; // Chromium's texture limit is 16384; past this the shot is cut and says so
const SHOT_ATTR = 'data-mxtk-shot-root';
// Picks the page's scroll root: the OUTERMOST element that scrolls vertically, hides content and
// spans at least half the viewport. A fixed-height grid body inside the Atlas centre also
// qualifies on size, but it sits inside the centre, so the centre wins. The pick is tagged, so
// it is the same element that is re-measured after the window grows.
async function pickScrollRoot(page) {
return page.evaluate((attr) => {
for (const el of document.querySelectorAll(`[${attr}]`)) el.removeAttribute(attr);
const cands = [];
for (const el of document.querySelectorAll('body *')) {
const oy = getComputedStyle(el).overflowY;
if (oy !== 'auto' && oy !== 'scroll') continue;
if (el.scrollHeight - el.clientHeight > 4 && el.clientHeight >= innerHeight / 2) cands.push(el);
}
const outer = cands.filter(el => !cands.some(o => o !== el && o.contains(el)));
outer.sort((a, b) => b.clientHeight - a.clientHeight);
const el = outer[0];
if (el) el.setAttribute(attr, '1');
return { root: el ? `${el.tagName.toLowerCase()}.${String(el.className).trim().split(/\s+/)[0]}` : null,
contentPx: el ? el.scrollHeight : null, clientPx: el ? el.clientHeight : null,
docPx: document.documentElement.scrollHeight };
}, SHOT_ATTR).catch(() => ({ root: null, docPx: null }));
}
// The tagged root's own numbers now (null when it is gone).
async function measureRoot(page) {
return page.evaluate((attr) => {
const el = document.querySelector(`[${attr}]`);
return { contentPx: el ? el.scrollHeight : null, clientPx: el ? el.clientHeight : null,
docPx: document.documentElement.scrollHeight };
}, SHOT_ATTR).catch(() => ({ contentPx: null, clientPx: null, docPx: null }));
}
// One retry: under load Chromium can answer "Unable to capture screenshot" once, and the old
// `.catch(() => {})` then left no file and no word about it (seen 1 in 10 fixture runs on 4 busy CPUs).
async function screenshotRetry(page, opts) {
try { await page.screenshot(opts); }
catch (e) { await page.waitForTimeout(300); await page.screenshot(opts); }
}
async function fullPageShot(page, file) {
await page.screenshot({ path: file, fullPage: true }).catch(() => {});
const vp = page.viewportSize();
const pick = await pickScrollRoot(page);
const rec = { file, scrollRoot: pick.root || 'document', documentPx: pick.docPx,
contentPx: pick.root ? pick.contentPx : pick.docPx, capturedPx: null, method: 'fullPage', complete: null };
// A Node-side wait, not requestAnimationFrame: a page with scripting off (a saved MHTML) never
// runs rAF, and reading scrollHeight forces layout anyway. The wait is for the app's resize handlers.
const settle = () => page.waitForTimeout(250);
let grown = false;
if (pick.root && vp) {
try {
let m = { contentPx: pick.contentPx, clientPx: pick.clientPx };
// Grown up to three times: content tied to the viewport height can grow with it.
for (let i = 0; i < 3; i++) {
const left = m.contentPx - m.clientPx;
if (left <= 4) break;
const cur = page.viewportSize();
const h = Math.min(SHOT_MAX_PX, cur.height + left);
if (h <= cur.height) break;
await page.setViewportSize({ width: cur.width, height: h });
await settle();
const n = await measureRoot(page);
// Viewport-tied means the root's own box grew with the window. A fixed-height scroller
// (a 480 px grid body) does not: growing the window would only add blank page below it.
if (n.clientPx == null || n.clientPx - m.clientPx < (h - cur.height) / 2) break;
grown = true; m = n;
}
if (grown) {
rec.method = 'viewport grown by the scroll root\'s hidden height, then fullPage';
await screenshotRetry(page, { path: file, fullPage: true });
rec.capturedPx = Math.max(page.viewportSize().height, m.docPx || 0);
rec.contentPx = m.contentPx;
rec.complete = m.contentPx - m.clientPx <= 4; // the root's OWN leftover, not a re-pick
} else {
rec.method = 'fullPage (the scroller is not tied to the viewport; shot as it is)';
}
} catch (e) { rec.error = String(e.message).split('\n')[0]; }
finally {
if (page.viewportSize() && page.viewportSize().height !== vp.height) { await page.setViewportSize(vp).catch(() => {}); await settle().catch(() => {}); }
await page.evaluate((attr) => { for (const el of document.querySelectorAll(`[${attr}]`)) el.removeAttribute(attr); }, SHOT_ATTR).catch(() => {});
}
if (grown || rec.error) return rec;
rec.skippedScroller = pick.root; rec.scrollRoot = 'document'; rec.contentPx = pick.docPx;
}
await screenshotRetry(page, { path: file, fullPage: true }).then(async () => {
rec.capturedPx = (await measureRoot(page)).docPx; rec.complete = true;
}, (e) => { rec.error = String(e.message).split('\n')[0]; });
return rec;
}

// A refused save on Mendix is HTTP 551 with a `{"datavalidation":[…]}` body: designed validation
// feedback, not a server error (#818, captured on mx 11.8: an empty required Title). Only that
// exact shape is exempt. A 551 with any other body (or one whose body could not be read) stays a
// 5xx: the safer reading, since an unknown 551 is not proven to be feedback.
function isValidationFeedback(status, body) {
if (status !== 551) return false;
try { const o = JSON.parse(body); return !!o && typeof o === 'object' && Array.isArray(o.datavalidation); }
catch (e) { return false; }
}

async function computedStyles(page, checks) {
Expand Down Expand Up @@ -849,6 +950,6 @@ module.exports = {
humanMove, humanClick, humanType, humanTypeKeys, humanScroll,
navTo, ensureSidebar, copilotText, askCopilot, approveConfirmCard,
login, logout, assertIdentity, dismissModal, gotoTarget, visibleWithin,
screenshotEl, fullPageShot, computedStyles, oql, oqlRows, oqlScalar, oqlAliases, parseOqlOutput, scalarOf, mxcliBin, makeReporter,
screenshotEl, fullPageShot, isValidationFeedback, computedStyles, oql, oqlRows, oqlScalar, oqlAliases, parseOqlOutput, scalarOf, mxcliBin, makeReporter,
ensureDirs, parseTokens, path, fs,
};
34 changes: 24 additions & 10 deletions project-tests/e2e/journey-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,16 @@ function backLeftApp(url, baseUrl) {

// The opt-in `ui.no5xx` row (#564): every answer >= 500 between the step's first action and its
// landing guard. Mendix can render a page's frame while every data source on it failed (HTTP 560
// on /xas/), and the landing guard alone then reads PASS.
function no5xxVerdict(hits) {
// on /xas/), and the landing guard alone then reads PASS. `feedback` holds the 551 answers whose
// body is Mendix validation feedback (#818, helpers.isValidationFeedback): a refused save on a
// negative-path step is the app working, so they are a note on the row, never a hit.
function no5xxVerdict(hits, feedback = []) {
const note = feedback.length
? ` (${feedback.length} validation answer(s), HTTP 551 datavalidation, not counted: ${feedback.slice(0, 3).join('; ')}${feedback.length > 3 ? '; …' : ''})`
: '';
return hits.length
? { verdict: 'FAIL', detail: `${hits.length} answer(s) >= 500: ${hits.slice(0, 5).join('; ')}${hits.length > 5 ? '; …' : ''}` }
: { verdict: 'PASS', detail: 'no answer >= 500' };
? { verdict: 'FAIL', detail: `${hits.length} answer(s) >= 500: ${hits.slice(0, 5).join('; ')}${hits.length > 5 ? '; …' : ''}${note}` }
: { verdict: 'PASS', detail: `no answer >= 500${note}` };
}

// ── Device, network and position (#521) ─────────────────────────────────────
Expand Down Expand Up @@ -1079,15 +1084,24 @@ async function runJourney(page, j) {
// what it managed, or the walk goes quiet exactly where it matters most.
// ui.no5xx (opt-in, #564): watch every response from the first action to the landing guard.
const watch5xx = !!(step.ui && step.ui.no5xx === true);
const hits5xx = [];
const on5xx = (r) => { if (r.status() >= 500) hits5xx.push(`${r.status()} ${r.request().method()} ${r.url().slice(0, 120)}`); };
const hits5xx = [], feedback5xx = [], pending5xx = [];
const on5xx = (r) => {
const st = r.status();
if (st < 500) return;
const line = `${st} ${r.request().method()} ${r.url().slice(0, 120)}`;
if (st !== 551) { hits5xx.push(line); return; }
// Only a 551's body is read (#818); one that cannot be read stays a hit.
pending5xx.push(r.text().catch(() => '')
.then(body => (H.isValidationFeedback(st, body) ? feedback5xx : hits5xx).push(line)));
};
let no5xxDone = !watch5xx;
// Recorded before any bail-out, so a 5xx that is WHY the page never landed shows beside it.
const record5xx = () => {
const record5xx = async () => {
if (no5xxDone) return;
no5xxDone = true;
page.off('response', on5xx);
const v = no5xxVerdict(hits5xx);
await Promise.all(pending5xx.splice(0));
const v = no5xxVerdict(hits5xx, feedback5xx);
record('ui', `${step.name}: no HTTP 5xx during the step`, v.verdict, v.detail, req);
};
if (watch5xx) page.on('response', on5xx);
Expand Down Expand Up @@ -1136,7 +1150,7 @@ async function runJourney(page, j) {
} catch (e) {
record('ui', `${step.name}: actions completed`, 'FAIL', e.message.split('\n')[0], req);
leg.shot = await shoot(page, `${j.id}-step${i + 1}-ACTION-FAILED`);
record5xx();
await record5xx();
seal();
return; // the journey's state is now unknown; later steps would measure noise
}
Expand All @@ -1158,7 +1172,7 @@ async function runJourney(page, j) {
}
leg.reached = onPage;
}
record5xx();
await record5xx();

// The success shot, taken HERE: after the actions and the landing guard, before
// the text/trace/data rungs. That ordering is the whole point — this image is the
Expand Down
5 changes: 4 additions & 1 deletion project-tests/e2e/page-audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ function auditPageStatic(qn, wfFiles) {
const DOM_PROBE = function () {
const txt = (document.body && document.body.innerText) || '';
const errEl = document.querySelector('.mx-dialog-error, .modal-dialog .alert-danger, .mx-name-alerts .alert-danger');
const listSel = '.mx-datagrid, [class*="widget-datagrid"], .mx-listview, [class*="widget-gallery"]';
// `.widget-datagrid` is a class TOKEN: DataGrid2's root. The substring form `[class*=…]` also
// matched its -content, -grid, -grid-head, -grid-body, -footer, -paging-bottom, -pb-start and
// -pb-end parts (captured, mx 11.8 DataGrid2 3.5.0), so one 20-row grid read "9 lists; 4 empty".
const listSel = '.mx-datagrid, .widget-datagrid, .mx-listview, [class*="widget-gallery"]';
const lists = Array.prototype.slice.call(document.querySelectorAll(listSel)).map(function (el) {
const rows = el.querySelectorAll('tbody tr, [role="row"]:not([role="columnheader"]), .mx-listview-item, [class*="widget-gallery-item"]').length;
const name = (String(el.className).match(/mx-name-[\w-]+/) || ['(unnamed)'])[0];
Expand Down
31 changes: 31 additions & 0 deletions tests/wave2/fixtures/runtime-mx118/CAPTURE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
tests/wave2/fixtures/runtime-mx118/ — provenance (captured 2026-11-20, Linux x86-64)

Every file here is captured from a LIVE Mendix 11.8.0 runtime. Nothing was hand-written except
this file.

THE APP
A blank Mendix 11.8.0 app scaffolded with bin/init-project.sh, plus a Tasks module written
through exec.sh: entity Tasks.Task (Title string(200) NOT NULL with no error message, Notes,
Done), page Task_Overview (Atlas_Core.Atlas_Default, one DataGrid2 v3.5.0 "dgTasks"), the same
page under Atlas_Core.Atlas_SideBar ("dgSideBar"), and a popup Task_NewEdit. 30 Task rows at capture time
("1 to 20 of 30": 20 rendered per page).
Run with `mxcli run --local --db-type hsqldb` (mxcli v0.32.0), viewed in Playwright Chromium at
1280x900, deviceScaleFactor 1, logged in as the demo administrator.

FILES
xas-551-empty-required.json
The /xas/ answer to Save on the new-task popup with the required Title left empty:
status, method, URL, response headers and body, verbatim (Playwright response.text()).
Used by test-journey-551-validation.sh (#818).
overview-SideBar-1280x900.mhtml.gz
CDP Page.captureSnapshot (MHTML: DOM plus CSS) of the SideBar overview. The document is
900 px; .mx-scrollcontainer-center is 1244 px of content in a 900 px box (inner scroll).
Used by test-fullpageshot-inner-scroll.sh (#812) and test-page-audit-datagrid-count.sh.
overview-Default-1280x900.mhtml.gz
The same page under Atlas_Default: the document scrolls (1278 px), the centre does not.
Used by test-fullpageshot-inner-scroll.sh (#812), the shape that must keep plain fullPage.
test-fullpageshot-inner-scroll.sh also re-runs both captures with ONE appended CSS rule that
makes .widget-datagrid-grid-body a fixed 480/800 px scroller (review of #825): a style override
on the captured DOM, the only non-captured input in this directory.
Both MHTML files are gzip -9 -n of the snapshot bytes. Chromium renders them from file://
with scripting off; the fixtures measure layout and run DOM probes, never the app's JS.
Binary file not shown.
Binary file not shown.
13 changes: 13 additions & 0 deletions tests/wave2/fixtures/runtime-mx118/xas-551-empty-required.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"status": 551,
"statusText": "551",
"method": "POST",
"url": "http://127.0.0.1:8080/xas/",
"headers": {
"transfer-encoding": "chunked",
"cache-control": "no-store",
"date": "Fri, 20 Nov 2026 19:12:19 GMT",
"content-type": "application/json;charset=utf-8"
},
"body": "{\"datavalidation\":[{\"errorFields\":[{\"message\":\"\",\"name\":\"Title\"}],\"guid\":\"4785074604119779\"}]}"
}
Loading
Loading