Compare commits

...
3 Commits
Author SHA1 Message Date
Alby96andClaude Opus 5.5 1553600b0d Unione di funzione/senza-terzi in funzione/dashboard: prove senza docs/ nell'immagine
verifica / controlli (push) Canceled after 0s
verifica / prove (push) Canceled after 0s
verifica / installatore (push) Canceled after 0s
verifica / immagine (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:34:08 +01:00
Alby96andClaude Opus 5.5 7666f7737d Prove: «Tutte le foto» sotto «Video» cerca davvero un video in seconda posizione (#59)
Nella demo i video secondi di un post dopo una foto sono pochi e lontani nel tempo: la prova li
cerca con l'API e apre la Libreria su quei giorni. Il segno «2/N» è il secondo dei due segni di
una tessera video, non il primo; e la demo non ha i file dei video, quindi il visualizzatore vale
anche quando mostra la copertina di un video mancante.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:34:00 +01:00
Alby96andClaude Opus 5.5 2d40bfe35b Prove: senza docs/ (costruzione dell'immagine) le due prove che li leggono si saltano
verifica / controlli (push) Canceled after 0s
verifica / prove (push) Canceled after 0s
verifica / installatore (push) Canceled after 0s
verifica / immagine (push) Canceled after 0s
Nell'esecuzione 449 la costruzione dell'immagine si è fermata su due prove:
InHouseAssetsTests (confronta la pila dei caratteri con docs/SPECIFICA.md) e
ScreenshotToolTests (elenca docs/schermate). Dentro l'immagine i sorgenti arrivano senza
docs/ (.dockerignore) e senza .git. Nuovo Repository.Docs, come GuideTests e
ImageContentsTests: rende la prova non conclusiva solo in quella copia; in un checkout la
prova va avanti e un percorso mancante la fa fallire. Provato togliendo docs/ e .git: le
due prove risultano ignorate; con docs/ passano.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 10:25:54 +01:00
4 changed files with 56 additions and 8 deletions

No files matched your search

@@ -28,4 +28,22 @@ internal static class Repository
return Path.Combine([root, .. parts]);
}
/// <summary>
/// A file or folder under docs/. The build of the Docker image copies the sources without docs/ (.dockerignore) and
/// without .git: there the test is inconclusive. In a checkout docs/ is always there, so the test goes on and a
/// missing path fails it.
/// </summary>
public static string Docs(params string[] parts)
{
var path = PathOf(["docs", .. parts]);
var root = Root()!;
var isCheckout = Directory.Exists(Path.Combine(root, ".git")) || File.Exists(Path.Combine(root, ".git"));
if (!Directory.Exists(Path.Combine(root, "docs")) && !isCheckout)
{
Assert.Inconclusive("Questa copia del repository non ha docs/ (costruzione dell'immagine Docker).");
}
return path;
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ public sealed partial class InHouseAssetsTests
// Exactly the stack of the specification (appendix B, «pila dei caratteri di sistema»), nothing more: no name of a
// font the Docker image leaves out (Liberation).
var specification = File.ReadAllText(Febe.Tests.Desktop.Support.Repository.PathOf("docs", "SPECIFICA.md"));
var specification = File.ReadAllText(Febe.Tests.Desktop.Support.Repository.Docs("SPECIFICA.md"));
var stated = SpecificationStack().Match(specification);
Assert.IsTrue(stated.Success, "la pila dell'appendice B");
Assert.AreEqual(stated.Groups[1].Value, stack.Groups[1].Value.Trim());
@@ -16,6 +16,30 @@ public sealed class LibraryModeInterfaceTests
private const string Switch = "document.querySelector('.strumenti .modo-mosaico')";
private const string Mode = Switch + ".querySelector('[aria-checked=true]').dataset.value";
/// <summary>The viewer shows a video: the player, or (the demo has no video files on disk) the cover of a missing video.</summary>
private const string ShowsAVideo = "(document.querySelector('.vis .scena video') !== null || /video/i.test(document.querySelector('.vis .scena .mancante')?.textContent || ''))";
/// <summary>
/// Walks «Video» in «Tutte le foto» through the API, newest first, to the first video that is the second file of a
/// series whose first file is no tile there: «dal=…&amp;al=…», from its day to the day of the tile before it, or "".
/// </summary>
private const string FindAVideoInSecondPlace = """
(async () => {
let cursor = null;
const list = [];
for (let page = 0; page < 60; page++) {
const answer = await (await fetch('/api/library?mode=files&kind=videos&limit=500' + (cursor ? '&cursor=' + cursor : ''))).json();
list.push(...answer.tiles);
const at = list.findIndex((t, i) => i > 0 && t.position === 2 && t.files > 1 && t.cover && t.cover.kind === 'video'
&& !list.some((o) => o.id === t.id && o.position === 1));
if (at > 0) return 'dal=' + list[at].day + '&al=' + list[at - 1].day;
if (!answer.older) return '';
cursor = answer.older;
}
return '';
})()
""";
[TestMethod]
public async Task TutteLeFotoShowsTheFilesOpensTheViewerOnTheFileAndIsRememberedPerPage()
{
@@ -73,13 +97,19 @@ public sealed class LibraryModeInterfaceTests
using var temp = new TempFolder("modo-video-ui");
await using var demo = await DemoHost.StartAsync(new DemoOptions(0, TestZones.Rome, temp.Path));
// In the demo the videos that are the second file of a post (the first a photo, no tile under «Video») are few and
// far back in time: the API finds the first one, and the Libreria opens on its days, from it to the tile before.
await ui.OpenAsync(new Uri(demo.Address, "/libreria?tipo=video"));
await ui.WaitAsync($"{Switch} !== null && document.querySelector('.mosaico .tess') !== null", "Libreria con «Video»");
var days = (await ui.EvalAsync(FindAVideoInSecondPlace)).GetString();
Assert.IsFalse(string.IsNullOrEmpty(days), "la demo ha un video in seconda posizione dopo una foto");
await ui.OpenAsync(new Uri(demo.Address, "/libreria?tipo=video&" + days));
await ui.WaitAsync($"{Switch} !== null && document.querySelector('.mosaico .tess') !== null", "Libreria con «Video» in quei giorni");
await ui.EvalAsync($"{Switch}.querySelector('[data-value=files]').click()");
// A video that is the second file of its post (the first is a photo, no tile under «Video»), not the first tile.
const string Second = "[...document.querySelectorAll('.mosaico .tess')].slice(1).find((t) => /^2\\/\\d+$/.test(t.querySelector('.segno span')?.textContent || ''))";
await ui.WaitAsync($"({Second}) !== undefined", "un video in seconda posizione " + ui.Report());
// That video, not the first tile. A video tile has two marks, its length and its place: the place is the one.
const string Second = "[...document.querySelectorAll('.mosaico .tess')].slice(1).find((t) => [...t.querySelectorAll('.segno span')].some((s) => /^2\\/\\d+$/.test(s.textContent.trim())))";
await ui.WaitAsync($"({Second}) !== undefined", "un video in seconda posizione");
// Clicking the voice already chosen keeps the mosaic, its place and the selection.
await ui.EvalAsync("document.querySelector('.mosaico').dataset.prova = 'stesso'");
@@ -87,7 +117,7 @@ public sealed class LibraryModeInterfaceTests
Assert.AreEqual("stesso", (await ui.EvalAsync("document.querySelector('.mosaico')?.dataset.prova || ''")).GetString(), "«Tutte le foto» di nuovo non ridisegna il mosaico");
await ui.EvalAsync($"({Second}).click()");
await ui.WaitAsync("document.querySelector('.vis .scena video') !== null && /file/.test(document.querySelector('.vis .dove').textContent)", "visualizzatore sul video");
await ui.WaitAsync($"{ShowsAVideo} && /file/.test(document.querySelector('.vis .dove').textContent)", "visualizzatore sul video");
const string Index = "Number((document.querySelector('.vis .dove').textContent.match(/file ([\\d.]+)/) || [])[1]?.replace(/\\./g, '') || 0)";
var at = (await ui.EvalAsync(Index)).GetInt32();
Assert.IsGreaterThan(1, at, ui.Report());
@@ -95,10 +125,10 @@ public sealed class LibraryModeInterfaceTests
// Left: the photo before it is not a tile, so the viewer goes to the tile before, a video of another post.
await ui.EvalAsync("document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowLeft', bubbles: true }))");
await ui.WaitAsync($"{Index} === {at - 1}", "la freccia va alla tessera precedente");
await ui.WaitAsync("document.querySelector('.vis .scena video') !== null", "di nuovo un video, mai la foto filtrata");
await ui.WaitAsync(ShowsAVideo, "di nuovo un video, mai la foto filtrata");
await ui.EvalAsync("document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight', bubbles: true }))");
await ui.WaitAsync($"{Index} === {at}", "e torna");
Assert.IsTrue((await ui.EvalAsync("document.querySelector('.vis .scena video') !== null")).GetBoolean());
Assert.IsTrue((await ui.EvalAsync(ShowsAVideo)).GetBoolean(), "un video, all'andata e al ritorno");
}
[TestMethod]
+1 -1
View File
@@ -37,7 +37,7 @@ public sealed partial class ScreenshotToolTests
[TestMethod]
public void TheListTakesEveryScreenshotOfTheFolderOnceWithItsStep()
{
var folder = Repository.PathOf("docs", "schermate");
var folder = Repository.Docs("schermate");
var steps = Repository.PathOf("tools", "Febe.Schermate", "passi");
var files = Shots.All.Select(s => s.File).ToList();
CollectionAssert.AllItemsAreUnique(files);