Allow redoing bad manual tests
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Tue, 26 Jul 2011 13:38:11 -0600
changeset 454 1353533c89ec
parent 453 c64051f6dfff
child 455 d98c950c9213
Allow redoing bad manual tests
manualtest.js
--- a/manualtest.js	Sun Jul 24 14:25:32 2011 -0600
+++ b/manualtest.js	Tue Jul 26 13:38:11 2011 -0600
@@ -81,13 +81,14 @@
 		var browserCell = document.createElement("td");
 		tr.appendChild(browserCell);
 		browserCell.innerHTML = localStorage[keyPrefix + JSON.stringify(test)];
+		doBrowserCellButton(browserCell, test);
 		document.getElementById("overlay").style.display = "";
 		doSameCell(tr);
 		runNextTest(test);
 	} else {
 		doBrowserCell(tr, test, function() {
 			doSameCell(tr);
-			runNextTest(test);
+			runNextTest();
 		});
 	}
 }
@@ -195,6 +196,30 @@
 	}
 
 	localStorage[keyPrefix + JSON.stringify(test)] = browserCell.innerHTML;
+
+	doBrowserCellButton(browserCell, test);
+}
+//@}
+
+function doBrowserCellButton(browserCell, test) {
+//@{
+	var button = document.createElement("button");
+	browserCell.lastChild.appendChild(button);
+	button.textContent = "Redo browser output";
+	button.onclick = function() {
+		localStorage.removeItem(keyPrefix + JSON.stringify(test));
+		var tr = browserCell.parentNode;
+		while (browserCell.nextSibling) {
+			tr.removeChild(browserCell.nextSibling);
+		}
+		tr.removeChild(browserCell);
+		doBrowserCell(tr, test, function() {
+			doSameCell(tr);
+			doTearDown();
+			document.getElementById("overlay").style.display = "";
+			tr.scrollIntoView();
+		});
+	};
 }
 //@}
 // vim: foldmarker=@{,@} foldmethod=marker