Skip to content

Commit

Permalink
Start and Done notifications for test case and test suite playback
Browse files Browse the repository at this point in the history
  • Loading branch information
samitbadle committed Feb 17, 2014
1 parent fc540d3 commit 19121c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ide/main/src/content/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,12 +844,14 @@ Editor.prototype.showInBrowser = function (url, newWindow) {
Editor.prototype.playCurrentTestCase = function (next, index, total) {
var self = this;
self.getUserLog().info("Playing test case " + (self.app.getTestCase().getTitle() || ''));
self.app.notify("testCasePlayStart", self.app.getTestCase());
this.selDebugger.start(function (failed) {
self.log.debug("finished execution of test case: failed=" + failed);
var testCase = self.suiteTreeView.getCurrentTestCase();
if (testCase) {
testCase.testResult = failed ? "failed" : "passed";
self.getUserLog().info("Test case " + testCase.testResult);
self.app.notify("testCasePlayDone", testCase);
} else {
self.getUserLog().error("current test case not found");
self.log.error("current test case not found");
Expand All @@ -875,6 +877,7 @@ Editor.prototype.playTestSuite = function (startIndex) {
this.suiteTreeView.refresh();
this.testSuiteProgress.reset();
var self = this;
self.app.notify("testSuitePlayStart");
var total = this.app.getTestSuite().tests.length - startIndex;
(function () {
if (++index < self.app.getTestSuite().tests.length) {
Expand All @@ -884,6 +887,7 @@ Editor.prototype.playTestSuite = function (startIndex) {
} else {
//Suite done
self.getUserLog().info("Test suite completed: " + self.testSuiteProgress.runs + " played, " + (self.testSuiteProgress.failures ? self.testSuiteProgress.failures + " failed" : " all passed!"));
self.app.notify("testSuitePlayDone", total, self.testSuiteProgress.runs, self.testSuiteProgress.failures);
}
})();
};
Expand Down

0 comments on commit 19121c5

Please sign in to comment.