From 9f59fba775a3528a0b129061e5718e70a8bb7a9a Mon Sep 17 00:00:00 2001 From: Danny Gleckler Date: Mon, 24 Jul 2023 14:41:16 -0400 Subject: [PATCH] Remember focus between tests --- src/server/pause.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/pause.js b/src/server/pause.js index e2a10468..1f972593 100644 --- a/src/server/pause.js +++ b/src/server/pause.js @@ -134,7 +134,7 @@ runBtn.addEventListener('click', run); const testName = document.querySelector('#test-name'); /* eslint-disable no-undef, no-invalid-this */ -let currentTest; +let currentTest, focusEl = runBtn; beforeEach(async function() { const fixture = new Promise(r => test.update = r); @@ -150,7 +150,7 @@ beforeEach(async function() { if (test.pause) { runBtn.disabled = false; skipBtn.disabled = false; - runBtn.focus(); + focusEl.focus(); } }); }); @@ -163,6 +163,7 @@ function start() { } function run() { + focusEl = runBtn; runBtn.disabled = true; skipBtn.disabled = true; test.run(); @@ -175,6 +176,7 @@ function runAll() { } function skip() { + focusEl = skipBtn; run(); try { currentTest.skip();