Permalink
Browse files

Added client#clickAndWait()

  • Loading branch information...
tj committed Sep 3, 2010
1 parent 92c1933 commit 5cddff08594e8d65a0f33c9eaec52f6fb62b131c
Showing with 14 additions and 1 deletion.
  1. +1 −1 examples/google.js
  2. +13 −0 lib/soda/client.js
View
@@ -15,7 +15,7 @@ var browser = soda.createClient({
browser.session(function(err){
browser.open('/', function(err, res){
browser.type('q', 'Hello World', function(err, res){
- browser.command('clickAndWait', ['btnG'], function(err, res){
+ browser.clickAndWait('btnG', function(err, res){
browser.command('assertTitle', ['Hello World - Google Search'], function(err, res){
if (err) throw err;
browser.command('testComplete', [], function(err, res){
View
@@ -148,6 +148,19 @@ Client.prototype.type = function(locator, str, fn){
return this.command('type', [locator, str], fn);
};
+/**
+ * Click `locator` and wait.
+ *
+ * @param {String} locator
+ * @param {Function} fn
+ * @return {Client}
+ * @api public
+ */
+
+Client.prototype.clickAndWait = function(locator, fn){
+ return this.command('clickAndWait', [locator], fn);
+};
+
/**
* Shortcut for `new selenium.Client()`.
*

0 comments on commit 5cddff0

Please sign in to comment.