Browse files

Added Client#type()

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

0 comments on commit 92c1933

Please sign in to comment.