Prove: due gare dei tempi emerse nella prima CI di #37
La prova «al volante» lasciava andare /api/ricerca prima che la pagina, dopo la sua attesa di 150 ms, mandasse il testo: la richiesta passava non trattenuta e non veniva contata. Ora aspetta che sia partita. AfterACrashChromiumRestartsAndSubscriptionsSurvive leggeva lo stato fra il conteggio del riavvio e «Running», perché Reconnected arriva mentre il nuovo processo si collega: ora aspetta entrambi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9941a2fa1f
commit
a85d0e568e
3 files changed
+10
-3
No files matched your search
@@ -41,7 +41,9 @@ public sealed class BrowserLifecycleTests
|
||||
browser.Host.KillForRestart();
|
||||
await reconnected.Task.WaitAsync(TimeSpan.FromSeconds(30));
|
||||
var watch = Stopwatch.StartNew();
|
||||
while (browser.Host.Restarts == 0 && watch.Elapsed < TimeSpan.FromSeconds(10))
|
||||
// Reconnected is raised while the new process is being connected, before the supervisor counts the restart and
|
||||
// marks it Running: wait for both, not only for the count.
|
||||
while ((browser.Host.Restarts == 0 || browser.Host.State != SupervisedState.Running) && watch.Elapsed < TimeSpan.FromSeconds(10))
|
||||
{
|
||||
await Task.Delay(20);
|
||||
}
|
||||
|
||||
@@ -141,6 +141,8 @@ public sealed class ProfileSearchInterfaceTests
|
||||
await TypeAsync(ui, "mar");
|
||||
await ui.WaitAsync(Rows("@marta.rossi") + " === 1", "suggerimenti locali");
|
||||
await ui.WaitAsync("document.querySelector('.suggerimenti').textContent.includes('Stai usando il browser di Febe')", "avviso subito, prima della risposta");
|
||||
// The page sends the text after its debounce: release only once that request is held, or it would pass uncounted.
|
||||
await ui.WaitAsync("window.__asked.includes('POST /api/ricerca') && window.__started['/api/ricerca'] >= 1", "testo mandato a Febe");
|
||||
await ui.EvalAsync("window.__release('/api/ricerca')");
|
||||
await ui.WaitAsync("window.__done['/api/ricerca'] >= 1", "risposta arrivata");
|
||||
await ui.WaitAsync($"document.querySelector('.suggerimenti .stato-remoto').textContent === {JsonSerializer.Serialize(search.Message)}", "messaggio del server");
|
||||
|
||||
Reference in new issue
Block a user