Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Commit

Permalink
add(test waitForUrl)
Browse files Browse the repository at this point in the history
  • Loading branch information
André Goulart committed Nov 17, 2015
1 parent a3493ad commit 8131bc8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/src/testWaitForUrl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var MockServer = require('mockserver');

module.exports = {
setUp: function(callback) {
this.client = require('../nightwatch.js').init();

callback();
},

testSuccess: function(test) {
var client = this.client.api;
client.waitForUrl('http://localhost/', 100, 0, function callback(result) {
test.equal(result, 'http://localhost/');
test.done();
});
},

testFailure: function(test) {
var client = this.client.api;
client.waitForUrl('http://localhost2/', 600, 0, function callback(result) {
test.equal(result, 'http://localhost/');
test.done();
});
},

tearDown: function(callback) {
this.client = null;
// clean up
callback();
}
};

0 comments on commit 8131bc8

Please sign in to comment.