Skip to content

Commit 2a9fb7b

Browse files
authored
Require user interaction to begin tests (#1628)
1 parent d8753e9 commit 2a9fb7b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

scripts/selenium.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,9 @@ const run = async (
632632
await awaitPage(driver, browser, version, `${host}/tests/${getvars}`);
633633

634634
log(task, "Running tests...");
635-
await driver.wait(until.elementLocated(By.id("status")), 30000);
635+
await driver.wait(until.elementLocated(By.id("run")), 5000);
636+
await click(driver, browser, "run");
637+
636638
statusEl = await driver.findElement(By.id("status"));
637639
try {
638640
await driver.wait(until.elementTextContains(statusEl, "upload"), 90000);

views/tests.ejs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ See the LICENSE file for copyright details
1010
<%- include('unsecurewarning') %>
1111
<%- include('extensioncheck', {sendToServer: true}) %>
1212
<% if (dev) {%><p class="error-notice">Note: you are running a development version of the collector!</p><% } %>
13-
<p id="status">Running tests...</p>
13+
14+
<p id="status">Ready to start tests</p>
1415
<form id="export" action="/export" method="post">
1516
<button id="export-download" class="export-button" type="submit" name="download" value="download" disabled><span class="mdi mdi-download"></span> Download results file</button>
1617
<button id="export-github" class="export-button <% if (!github) {%>always-disabled<% } %>" type="submit" name="github" value="github" disabled><span class="mdi mdi-github"></span> <% if (github) {%>Send results to mdn-bcd-results GitHub repo<% } else { %>GitHub export disabled<% } %></button>
1718
</form>
1819
<div id="results">
1920
<hr />
21+
<button id="run">Run Tests</button>
2022
</div>
2123
2224
<% let resourcesToLoad = new Set(); %>
@@ -68,7 +70,8 @@ See the LICENSE file for copyright details
6870
<% tests.forEach(function(test) { %>
6971
bcd.addTest("<%- test.ident %>", <%- JSON.stringify(test.tests) %>, "<%- test.exposure %>");
7072
<% }); %>
71-
window.onload = function() {
73+
document.getElementById('run').onclick = function() {
74+
document.getElementById('run').style.display = "none";
7275
bcd.go(
7376
undefined,
7477
<%- resourcesToLoad.size %>,

0 commit comments

Comments
 (0)