Fassung 1.6.2: sichtbare leere Layouts und direktes Befuellen im Editor
CMS quality / php (8.2) (push) Canceled after 0s
CMS quality / php (8.4) (push) Canceled after 0s
CMS quality / browser (push) Canceled after 0s
CMS quality / mysql (push) Canceled after 0s

This commit is contained in:
kantarci committed 2026-09-14 09:22:23 +02:00
1 parent 149e1fe520
commit 6a044e59e9
14 files changed
+314 -21

No files matched your search

+101
View File
@@ -175,6 +175,107 @@ try {
await leftHandle.dblclick(); await rightHandle.dblclick();
await page.locator('[data-panel="content"]').click();
checks.push({ name: 'resizable persistent panels, root sections, contextual image/text properties and full text width', passed: true });
// A layout starts empty: it must be visible, reachable and editable before it has any text.
const previewReady = () => page.locator('#preview-status').filter({ hasText: 'Entwurf ·' }).waitFor();
await frame.locator('h1').click();
await page.locator('#add-root-section').click();
await previewReady();
const emptySection = frame.locator('main > .editor-empty-container');
await emptySection.waitFor();
const newSectionId = await emptySection.getAttribute('id');
assert.ok((await emptySection.boundingBox()).height > 100, 'new empty section has a visible hit area');
await page.screenshot({ path: 'reports/editor/empty-section.png', fullPage: true });
await frame.getByRole('button', { name: '2 Spalten in dieser Sektion anlegen', exact: true }).press('Enter');
await previewReady();
const emptyColumns = frame.locator(`#${newSectionId} .block-column`);
assert.equal(await emptyColumns.count(), 2);
for (let index = 0; index < 2; index++) assert.ok((await emptyColumns.nth(index).boundingBox()).height > 80, 'empty column has a hit area');
const secondColumnId = await emptyColumns.nth(1).getAttribute('id');
const firstColumnId = await emptyColumns.first().getAttribute('id');
await frame.getByRole('button', { name: 'Spalte 2 von 2: Inhalt hinzufügen', exact: true }).press('Enter');
assert.equal(await page.locator('#library-search').evaluate(el => el === document.activeElement), true);
assert.match(await page.locator('#insert-hint').innerText(), /Spalte 2 von 2/);
await page.locator('#library-search').fill('Text');
await page.locator('#library [data-add="text"]').click();
await frame.locator(`#${secondColumnId} .block-text`).waitFor();
await previewReady();
assert.equal(await frame.locator(`#${firstColumnId} .editor-empty`).count(), 1, 'unfilled sibling stays visible');
await page.locator('#library-search').fill('');
const dragSource = page.locator('#library [data-add="button"]');
await frame.locator(`#${firstColumnId} .editor-empty`).scrollIntoViewIfNeeded();
await dragSource.scrollIntoViewIfNeeded();
const sourceBox = await dragSource.boundingBox();
let targetBox = await frame.locator(`#${firstColumnId} .editor-empty`).boundingBox();
await page.mouse.move(sourceBox.x + sourceBox.width / 2, sourceBox.y + sourceBox.height / 2);
await page.mouse.down();
await page.mouse.move(sourceBox.x + sourceBox.width / 2 + 10, sourceBox.y + sourceBox.height / 2, { steps: 3 });
await page.mouse.move(targetBox.x + targetBox.width / 2, targetBox.y + targetBox.height / 2, { steps: 10 });
// Chromium dispatches dragenter on the first move into a target, dragover on the next.
await page.mouse.move(targetBox.x + targetBox.width / 2, targetBox.y + targetBox.height / 2);
await page.locator('.ov-drop-label').filter({ hasText: 'Spalte 1 von 2' }).waitFor();
await page.screenshot({ path: 'reports/editor/empty-layout-drag.png', fullPage: true });
const beforeDragScroll = await page.locator('#preview').evaluate(el => el.contentWindow.scrollY);
const frameBox = await page.locator('#preview').boundingBox();
await page.mouse.move(frameBox.x + 50, frameBox.y + frameBox.height - 8, { steps: 5 });
await page.mouse.move(frameBox.x + 50, frameBox.y + frameBox.height - 8);
await page.waitForFunction(top => document.querySelector('#preview').contentWindow.scrollY > top + 10, beforeDragScroll);
await page.mouse.move(frameBox.x + 50, frameBox.y + frameBox.height / 2);
await page.mouse.move(frameBox.x + 50, frameBox.y + frameBox.height / 2);
await frame.locator(`#${firstColumnId} .editor-empty`).scrollIntoViewIfNeeded();
targetBox = await frame.locator(`#${firstColumnId} .editor-empty`).boundingBox();
await page.mouse.move(targetBox.x + targetBox.width / 2, targetBox.y + targetBox.height / 2, { steps: 6 });
await page.mouse.move(targetBox.x + targetBox.width / 2, targetBox.y + targetBox.height / 2);
await page.mouse.up();
await frame.locator(`#${firstColumnId} .button`).waitFor();
assert.equal(await frame.locator(`#${newSectionId} .editor-empty`).count(), 0, 'placeholders disappear after filling');
await page.locator('#undo').click(); await previewReady();
assert.equal(await frame.locator(`#${firstColumnId} .editor-empty`).count(), 1, 'undo restores the empty target');
await page.locator('#redo').click(); await previewReady();
await frame.locator(`#${firstColumnId} .button`).waitFor();
await page.locator('#undo').click(); await previewReady();
await page.locator('#undo').click(); await previewReady();
await page.screenshot({ path: 'reports/editor/empty-layout-desktop.png', fullPage: true });
await page.getByRole('button', { name: 'Mobil', exact: true }).click();
await frame.getByRole('button', { name: 'Spalte 2 von 2: Inhalt hinzufügen', exact: true }).scrollIntoViewIfNeeded();
await page.screenshot({ path: 'reports/editor/empty-layout-mobile.png', fullPage: true });
await page.getByRole('button', { name: 'Desktop', exact: true }).click();
await page.locator('#save').click();
await page.locator('#save-status').filter({ hasText: 'Entwurf gespeichert' }).waitFor();
await page.reload(); await previewReady();
assert.equal(await frame.locator(`#${newSectionId} .editor-empty`).count(), 2, 'saved empty columns survive reload');
for (const device of ['Desktop', 'Mobil']) {
await page.getByRole('button', { name: device, exact: true }).click();
const destination = frame.locator(`#${secondColumnId}`);
await destination.scrollIntoViewIfNeeded();
const box = await destination.boundingBox();
await page.locator(`#structure [data-block-id="${firstColumnId}"]`).dragTo(destination, {
targetPosition: device === 'Desktop' ? { x: box.width - 8, y: 8 } : { x: 8, y: box.height - 8 },
});
await previewReady();
assert.equal(await frame.locator(`#${newSectionId} .block-column`).first().getAttribute('id'), secondColumnId, `column order follows the ${device} layout`);
await page.locator('#undo').click(); await previewReady();
assert.equal(await frame.locator(`#${newSectionId} .block-column`).first().getAttribute('id'), firstColumnId);
}
await page.getByRole('button', { name: 'Desktop', exact: true }).click();
const savedEmptyDraft = await page.evaluate(async () => (await (await fetch(document.querySelector('#editor').dataset.api)).json()).document);
assert.equal(JSON.stringify(savedEmptyDraft).includes('editor-empty'), false, 'editing aids never enter content');
const publicBefore = await (await fetch(origin)).text();
assert.equal(publicBefore.includes(newSectionId), false, 'draft remains private');
await page.locator('#publish').click(); await page.locator('#confirm-publish').click();
await page.locator('#save-status').filter({ hasText: 'Veröffentlicht' }).waitFor();
const publishedEmpty = await (await fetch(origin)).text();
assert.ok(publishedEmpty.includes(newSectionId));
assert.equal(/editor-empty|data-editor-target|preview-containers|preview\.css|Inhalt hinzufügen/.test(publishedEmpty), false, 'public output has no editor aids');
// Restore the fixture through the same editor actions; subsequent tests retain their baseline.
await page.locator(`#structure [data-block-id="${newSectionId}"]`).click();
await page.locator('#delete').click();
await page.locator('#save').click();
await page.locator('#save-status').filter({ hasText: 'Entwurf gespeichert' }).waitFor();
await page.locator('#publish').click(); await page.locator('#confirm-publish').click();
await page.locator('#save-status').filter({ hasText: 'Veröffentlicht' }).waitFor();
await page.reload(); await previewReady();
checks.push({ name: 'empty sections and columns: keyboard insertion, exact drop target, undo, responsive preview, reload and public isolation', passed: true });
await frame.locator('h1').click();
assert.equal(await page.locator('#properties-title').innerText(), 'Überschrift');
await page.getByLabel('Text', { exact: true }).fill('Meine bearbeitete Website');