Permalink
Browse files
Added client#clickAndWait()
- Loading branch information...
Showing
with
14 additions
and
1 deletion.
-
+1
−1
examples/google.js
-
+13
−0
lib/soda/client.js
|
@@ -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){
|
|
|
|
@@ -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