From 1eebb771e3940ddd6640ddc064d5fa6e539c536d Mon Sep 17 00:00:00 2001
From: Di Peng
Date: Fri, 3 Jun 2011 15:22:43 -0700
Subject: renamed $pause to $sleep AND $wait to $pause
Closes #207
---
src/scenario/dsl.js | 14 +++++++-------
src/scenario/output/Html.js | 4 ++--
src/validators.js | 2 +-
3 files changed, 10 insertions(+), 10 deletions(-)
(limited to 'src')
diff --git a/src/scenario/dsl.js b/src/scenario/dsl.js
index 13101fe9..9bd0caf7 100644
--- a/src/scenario/dsl.js
+++ b/src/scenario/dsl.js
@@ -4,12 +4,12 @@
/**
* Usage:
- * wait() waits until you call resume() in the console
+ * pause() pauses until you call resume() in the console
*/
-angular.scenario.dsl('wait', function() {
+angular.scenario.dsl('pause', function() {
return function() {
- return this.addFuture('waiting for you to resume', function(done) {
- this.emit('InteractiveWait', this.spec, this.step);
+ return this.addFuture('pausing for you to resume', function(done) {
+ this.emit('InteractivePause', this.spec, this.step);
this.$window.resume = function() { done(); };
});
};
@@ -17,11 +17,11 @@ angular.scenario.dsl('wait', function() {
/**
* Usage:
- * pause(seconds) pauses the test for specified number of seconds
+ * sleep(seconds) pauses the test for specified number of seconds
*/
-angular.scenario.dsl('pause', function() {
+angular.scenario.dsl('sleep', function() {
return function(time) {
- return this.addFuture('pause for ' + time + ' seconds', function(done) {
+ return this.addFuture('sleep for ' + time + ' seconds', function(done) {
this.$window.setTimeout(function() { done(null, time * 1000); }, time * 1000);
});
};
diff --git a/src/scenario/output/Html.js b/src/scenario/output/Html.js
index ccf7db6f..c1b15239 100644
--- a/src/scenario/output/Html.js
+++ b/src/scenario/output/Html.js
@@ -22,10 +22,10 @@ angular.scenario.output('html', function(context, runner, model) {
''
);
- runner.on('InteractiveWait', function(spec, step) {
+ runner.on('InteractivePause', function(spec, step) {
var ui = lastStepUiMap[spec.id];
ui.find('.test-title').
- html('waiting for you to resume.');
+ html('paused... resume when ready.');
});
runner.on('SpecBegin', function(spec) {
diff --git a/src/validators.js b/src/validators.js
index 0696c8d7..de67a965 100644
--- a/src/validators.js
+++ b/src/validators.js
@@ -387,7 +387,7 @@ extend(angularValidator, {
expect(textBox.attr('className')).not().toMatch(/ng-validation-error/);
input('text').enter('X');
expect(textBox.attr('className')).toMatch(/ng-input-indicator-wait/);
- pause(.6);
+ sleep(.6);
expect(textBox.attr('className')).not().toMatch(/ng-input-indicator-wait/);
expect(textBox.attr('className')).toMatch(/ng-validation-error/);
});
--
cgit v1.2.3