Skip to content

Commit 19121c5

Browse files
committed
Start and Done notifications for test case and test suite playback
1 parent fc540d3 commit 19121c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ide/main/src/content/editor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,12 +844,14 @@ Editor.prototype.showInBrowser = function (url, newWindow) {
844844
Editor.prototype.playCurrentTestCase = function (next, index, total) {
845845
var self = this;
846846
self.getUserLog().info("Playing test case " + (self.app.getTestCase().getTitle() || ''));
847+
self.app.notify("testCasePlayStart", self.app.getTestCase());
847848
this.selDebugger.start(function (failed) {
848849
self.log.debug("finished execution of test case: failed=" + failed);
849850
var testCase = self.suiteTreeView.getCurrentTestCase();
850851
if (testCase) {
851852
testCase.testResult = failed ? "failed" : "passed";
852853
self.getUserLog().info("Test case " + testCase.testResult);
854+
self.app.notify("testCasePlayDone", testCase);
853855
} else {
854856
self.getUserLog().error("current test case not found");
855857
self.log.error("current test case not found");
@@ -875,6 +877,7 @@ Editor.prototype.playTestSuite = function (startIndex) {
875877
this.suiteTreeView.refresh();
876878
this.testSuiteProgress.reset();
877879
var self = this;
880+
self.app.notify("testSuitePlayStart");
878881
var total = this.app.getTestSuite().tests.length - startIndex;
879882
(function () {
880883
if (++index < self.app.getTestSuite().tests.length) {
@@ -884,6 +887,7 @@ Editor.prototype.playTestSuite = function (startIndex) {
884887
} else {
885888
//Suite done
886889
self.getUserLog().info("Test suite completed: " + self.testSuiteProgress.runs + " played, " + (self.testSuiteProgress.failures ? self.testSuiteProgress.failures + " failed" : " all passed!"));
890+
self.app.notify("testSuitePlayDone", total, self.testSuiteProgress.runs, self.testSuiteProgress.failures);
887891
}
888892
})();
889893
};

0 commit comments

Comments
 (0)