Revisione: il browser che non risponde nemmeno alla navigazione viene comunque in primo piano (#67)
verifica / controlli (push) Successful in 18s
verifica / prove (push) Successful in 18m26s
verifica / installatore (push) Canceled after 0s
verifica / immagine (push) Canceled after 0s

Con la correzione #67 un browser che resta muto per tutta l'attesa conta come a riposo, e Febe prova ad aprire la
pagina iniziale. Un browser che si sta ancora riavviando dopo «Scollega» rifiuta però anche Page.navigate: l'errore
risaliva fino all'API e Alberto vedeva, dopo dieci secondi, un errore interno al posto della finestra. Ora quella
navigazione mancata si annota nel registro («non aperta (il browser non risponde)») e la finestra viene in primo
piano come prima. Nuova prova con un browser che non risponde a nulla, per «Usa il browser» e «Apri il browser».

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-29 12:28:37 +01:00
1 parent 8edb706e06
commit 8d1b344366
3 files changed
+56 -1

No files matched your search

@@ -149,6 +149,33 @@ public sealed class BrowserStartPageTests
Assert.AreEqual(Login, browser.FakeCdp.Url);
}
[TestMethod]
[Timeout(60_000, CooperativeCancellation = true)]
public async Task ABrowserThatAnswersNothingStillComesToTheFrontWithoutAnError()
{
var ct = TestContext.CancellationToken;
await using var bed = await DesktopTestBed.StartAsync();
await bed.App.Running.WaitAsync(TimeSpan.FromSeconds(20), ct);
var browser = bed.Browser!;
bed.App.Connection!.AddressWait = TimeSpan.FromMilliseconds(300);
// Still restarting (issue #67): no page and no navigation either. The window comes all the same, never a 500.
browser.FakeCdp.Silent = true;
browser.FakeCdp.RefusesNavigation = true;
var shown = browser.Shown;
await BeginAsync(bed, openLogin: false);
Assert.AreEqual(shown + 1, browser.Shown, "«Usa il browser»: the window came to the front");
var result = await bed.JsonAsync(HttpMethod.Post, "/api/browser/show");
StringAssert.Contains(result.GetProperty("message").GetString(), "primo piano");
Assert.AreEqual(shown + 2, browser.Shown, "«Apri il browser»: the window came to the front");
Assert.AreEqual("about:blank", browser.FakeCdp.Url, "nothing could open");
Assert.DoesNotContain(Login, browser.FakeCdp.Visited);
browser.FakeCdp.Silent = false;
browser.FakeCdp.RefusesNavigation = false;
}
[TestMethod]
[Timeout(60_000, CooperativeCancellation = true)]
public async Task ApriIlBrowserBringsTheWindowWithItsStartPageAndTheLoginAfterADisconnection()