' +
'
prošlo
' + (c.pass || 0) + "
" +
'
spadlo
' + (c.fail || 0) + "
" +
@@ -1368,6 +1412,7 @@ async function load(){
if (prefs.view === "e2e") {
var rs = await records("e2e_runs", { sort: "-created", perPage: 40 })
.catch(function(){ return { items: [] }; });
+ liveRun = (rs.items || []).some(isLive);
fileTok = "";
try {
var ft = await api("/api/files/token", { method: "POST" });
@@ -1406,9 +1451,16 @@ function start(){
syncTabs();
load();
if (timer) clearInterval(timer);
- // A minute is plenty; this is not a metrics system. The admin view is excluded
+ // A minute is plenty for everything here except a test run in flight, which
+ // moves every few seconds and is worth watching. The admin view is excluded
// because a refresh under a half-typed form would wipe it.
- timer = setInterval(function(){ if (prefs.view !== "admin") load(); }, 60000);
+ var ticks = 0;
+ timer = setInterval(function(){
+ if (prefs.view === "admin") return;
+ ticks++;
+ var following = liveRun && prefs.view === "e2e";
+ if (following || ticks >= 12) { ticks = 0; load(); }
+ }, 5000);
}
if (tok) start(); else el("login").hidden = false;