Permalink
Browse files

Added chain syntax

  • Loading branch information...
1 parent 20b75e3 commit 877d8573065106ff80b53dd018dddfacef59b5e1 @tj tj committed Sep 3, 2010
Showing with 26 additions and 14 deletions.
  1. +26 −14 examples/google.js
View
@@ -12,17 +12,29 @@ var browser = soda.createClient({
browser: 'firefox'
});
-browser.session(function(err){
- browser.open('/', function(err, res){
- browser.type('q', 'Hello World', function(err, res){
- browser.clickAndWait('btnG', function(err, res){
- browser.assertTitle('Hello World - Google Search', function(err, res){
- if (err) throw err;
- browser.testComplete(function(err, res){
- console.log('done');
- });
- });
- });
- });
- });
-});
+// browser.session(function(err){
+// browser.open('/', function(err, res){
+// browser.type('q', 'Hello World', function(err, res){
+// browser.clickAndWait('btnG', function(err, res){
+// browser.assertTitle('Hello World - Google Search', function(err, res){
+// if (err) throw err;
+// browser.testComplete(function(err, res){
+// console.log('done');
+// });
+// });
+// });
+// });
+// });
+// });
+
+browser.chain
+ .open('/')
+ .type('q', 'Hello World')
+ .clickAndWait('btnG')
+ .assertTitle('Hello World - Google Search')
+ .testComplete()
+ .done(function(err, res){
+ console.log('done');
+ console.dir(err)
+ console.dir(res.body)
+ });

0 comments on commit 877d857

Please sign in to comment.